/* ============================================================
   KMINGO RECIPE COACH
   ============================================================ */

:root {
  /* Core ink */
  --ink:          #271c17;
  --ink-soft:     #47352d;
  --muted:        #69564c;
  --muted-light:  #766256;

  /* Warm surfaces */
  --paper:        #f5efe4;
  --panel:        #fffcf7;
  --warm:         #f8f2e9;
  --warm-mid:     #eee3d5;
  --warm-strong:  #f4e5da;

  --brand:        #a12c25;
  --brand-dark:   #80211d;
  --brand-light:  #f4ddd3;
  --brand-faint:  #fcf0e9;

  --navy:         #31231c;
  --navy-mid:     #423029;
  --navy-light:   #563d32;

  /* Borders */
  --line:         #e1d2c3;
  --line-warm:    #e8dbcf;
  --line-strong:  #c4ac9a;

  /* Shadows */
  --shadow-xs:    0 1px 2px #271c170d;
  --shadow-sm:    0 4px 12px #271c1710;
  --shadow:       0 8px 24px #271c1714;
  --shadow-lg:    0 18px 42px #271c1726;
  --shadow-brand: var(--shadow-xs);
  --shadow-brand-lg: var(--shadow-sm);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r:    10px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-full: 999px;

  /* Motion */
  --ease:     cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(0,0,.2,1);

  /* Layout */
  --shell-width: 1480px;
  --rail-width: 232px;
  --reading-width: 900px;
  --prompt-width: 708px;
  --panel-gutter: clamp(18px, 4vw, 54px);
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --display-font: Georgia, 'Noto Serif KR', 'Apple SD Gothic Neo', 'Malgun Gothic', serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }

button, textarea, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.5 'Instrument Sans', Inter, 'Segoe UI', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}

[hidden] { display: none !important; }

:where(button, a, select, input, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

button:disabled { cursor: not-allowed; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Product navigation */
.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  padding-block-start: env(safe-area-inset-top);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 65px;
  padding: 7px max(20px, calc((100vw - var(--shell-width)) / 2 + 20px));
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  flex: 0 0 30px;
}

.brand-mark img { width: 25px; height: 32px; object-fit: contain; }
.brand-copy { display: grid; gap: 1px; line-height: 1.2; }
.brand-copy strong { font-size: 17px; font-weight: 800; letter-spacing: .11em; }
.brand-copy small { color: var(--muted); font-size: 11px; }

.topbar-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 12px;
}

.topbar-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #367251;
}

.topbar-status strong { font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.topbar-tool,
.topbar-language select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.topbar-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  text-decoration: none;
}

.topbar-tool:hover,
.topbar-language select:hover { background: var(--warm); border-color: var(--line-strong); }
.topbar-language > span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
.topbar-language select { width: 100%; padding: 0 8px; cursor: pointer; }

:is(.topbar-tool, .sidebar-toggle-btn, .drawer-close, .mode-card, .composer, .quick-chip, .notice, .recommend-action-card) svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  width: min(100%, var(--shell-width));
  min-height: 0;
  margin-inline: auto;
}

.workspace--sidebar-expanded { grid-template-columns: var(--rail-width) minmax(0, 1fr); }

.sidebar {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 10px max(16px, env(safe-area-inset-bottom));
  background: var(--panel);
  border-inline-end: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.sidebar-heading,
.section-row { display: flex; align-items: center; justify-content: space-between; }
.sidebar-heading { margin-bottom: 8px; }
.sidebar h2 { margin: 0; font-size: 13px; font-weight: 750; }
@media (min-width: 768px) {
  .sidebar:not(.sidebar--expanded) :is(.sidebar-heading h2, .mode-card-copy, .sidebar-section) { display: none; }
}

.sidebar-toggle-btn,
.drawer-close,
.mobile-menu-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  background: transparent;
}

.sidebar-toggle-btn:hover,
.drawer-close:hover,
.mobile-menu-toggle:hover { background: var(--warm); border-color: var(--line); }
.mobile-menu-toggle, .mobile-menu-backdrop, .drawer-close { display: none; }
.mobile-menu-toggle span { width: 17px; height: 2px; border-radius: 1px; background: currentColor; }

.mode-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }

.mode-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  text-align: start;
}

.mode-card:hover { background: var(--warm); border-color: var(--line); }
.mode-card.active { border-color: var(--line-strong); background: var(--brand-faint); color: var(--brand-dark); }
.mode-card-icon { display: grid; place-items: center; color: var(--brand-dark); }
.mode-card-copy { display: grid; gap: 3px; min-width: 0; }
.mode-card-copy strong { font-size: 13px; line-height: 1.25; }
.mode-card-copy small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}
.mode-utility-divider { height: 1px; margin: 7px 0; background: var(--line-warm); }
.sidebar:not(.sidebar--expanded) .mode-card { grid-template-columns: 1fr; padding-inline: 0; }
.sidebar-section { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.sidebar-section .text-button { min-height: 44px; }

/* Opening prompt and conversation dock */
.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "dock" "chat";
  min-width: 0;
  min-height: 0;
  container-type: inline-size;
}

.composer-dock {
  grid-area: dock;
  min-width: 0;
  padding: clamp(24px, 5dvh, 54px) max(var(--panel-gutter), calc((100% - var(--prompt-width)) / 2)) 12px;
}

.hero { margin: 0 auto 22px; text-align: center; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .09em;
}

.hero h1 {
  margin: 0;
  font: 400 clamp(33px, 5.2vw, 68px)/1.04 var(--display-font);
  letter-spacing: -.046em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

:is(html[lang="ko"], html[lang="ja"], html[lang="zh"]) .hero h1 {
  font-family: inherit;
  font-size: clamp(27px, 4.2vw, 52px);
  font-weight: 750;
  letter-spacing: -.04em;
  line-height: 1.18;
}

.hero-copy {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.composer:focus-within { border-color: var(--brand); }

.composer textarea {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  max-height: min(160px, 23dvh);
  align-self: stretch;
  padding: 10px 8px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}

.composer textarea:focus-visible { outline-offset: 0; }
.composer textarea::placeholder { color: var(--muted); font-size: inherit; }
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

.mic-button,
.send-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--warm);
  color: var(--ink-soft);
}

.mic-button:hover { border-color: var(--brand); color: var(--brand-dark); }
.mic-button[aria-pressed="true"] { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-light); }
.send-button { border-color: var(--brand); background: var(--brand); color: #fff; }
.send-button:hover { background: var(--brand-dark); }
.send-button:disabled { opacity: .55; cursor: wait; }
.composer .send-button svg { width: 21px; height: 21px; }
.listening-label { color: var(--brand-dark); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.listening-label:empty { position: absolute; }
.composer:has(.listening-label:not(:empty)) .composer-actions { max-width: 170px; }

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.quick-prompts-label { margin-inline: 2px 5px; color: var(--muted); font-size: 12px; font-weight: 700; }

.quick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.quick-chip svg { width: 15px; height: 15px; color: var(--brand-dark); }
.quick-chip:hover { border-color: var(--line-strong); background: var(--brand-faint); }

.notice { margin-top: 2px; color: var(--muted); font-size: 12px; }

.notice summary {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 36px;
  padding-inline: 2px;
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.notice summary::-webkit-details-marker { display: none; }
.notice summary svg { width: 15px; height: 15px; }
.notice summary::after { content: ''; width: 6px; height: 6px; margin-inline: 2px; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.notice[open] summary::after { transform: translateY(2px) rotate(225deg); }
.notice summary:hover { color: var(--brand-dark); }
.notice p { margin: 0 0 3px; padding: 9px 12px; border-inline-start: 2px solid var(--line-strong); background: var(--warm); }

.chat-scroll {
  grid-area: chat;
  min-width: 0;
  min-height: 0;
  padding: 4px max(var(--panel-gutter), calc((100% - var(--reading-width)) / 2)) 22px;
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-strong) transparent;
}

.chat-panel:has(.message.user, .message.assistant, .recipe-layout, .coach-panel, .coach-complete) {
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "chat" "dock";

  .composer-dock { border-top: 1px solid var(--line); background: var(--warm); padding-top: 9px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .hero { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .chat-scroll { padding-block-start: 18px; }
  .composer textarea { min-height: 44px; padding-block: 8px; }
}

/* Mode tools and food discovery */
.mode-start {
  width: 100%;
  margin: 0 0 16px;
  padding: 16px 0 8px;
  border-top: 1px solid var(--line-strong);
}

.mode-start-header { margin: 0 0 12px; }
.mode-start-header h2 { margin: 0 0 3px; font-size: clamp(18px, 2.2vw, 24px); line-height: 1.25; }
.mode-start-header p, .discovery-head p { margin: 0; color: var(--muted); font-size: 13px; }

.recommend-action-panel {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
}

.recommend-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.recommend-action-card,
.discovery-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink);
  text-align: start;
}

.recommend-action-card:hover,
.discovery-card:hover { border-color: var(--brand); background: var(--brand-faint); }

.recommend-action-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
}

.recommend-action-card.is-active { border-color: var(--brand); background: var(--brand-faint); }
.recommend-action-panel.is-processing .recommend-action-card { pointer-events: none; opacity: .65; }
.recommend-action-visual { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-xs); background: var(--warm-mid); color: var(--brand-dark); }
.recommend-action-card strong, .discovery-card strong { display: block; font-size: 13px; line-height: 1.35; }
.recommend-action-card small, .discovery-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }

.discovery-deck { padding-block: 14px; border-block: 1px solid var(--line); }
.discovery-head { margin: 0 0 10px; }
.discovery-head h3 { margin: 0 0 3px; font-size: 17px; }
.discovery-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.discovery-card { display: grid; align-content: start; overflow: hidden; padding: 0; }
.discovery-card-copy { display: block; padding: 9px 11px; }
.discovery-card-media { display: block; height: clamp(78px, 12vw, 138px); background: var(--warm-mid); }
.discovery-card-media img { width: 100%; height: 100%; object-fit: cover; }
.discovery-controls { display: grid; gap: 7px; margin-top: 14px; }
.discovery-selector { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: start; gap: 7px; }
.discovery-selector h4 { margin: 7px 0 0; font-size: 12px; }
.discovery-chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.discovery-chip-row button { min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--panel); color: var(--ink-soft); font-size: 12px; }
.discovery-chip-row button:hover, .discovery-chip-row button.is-selected { border-color: var(--brand); background: var(--brand-faint); color: var(--brand-dark); }

@media (max-width: 767px) {
  :root { --panel-gutter: 14px; }
  .topbar { min-height: 57px; padding: 6px 10px; gap: 6px; }
  .topbar-status, .brand-copy small, .topbar-tool span { display: none; }
  .topbar-actions { margin-inline-start: auto; gap: 4px; }
  .topbar-tool { width: 44px; padding: 0; }
  .topbar-language select { max-width: 82px; padding-inline: 4px; font-size: 12px; }
  .brand { gap: 4px; }
  .brand-mark { display: none; }
  .brand-copy strong { font-size: 14px; }
  .mobile-menu-toggle { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
  .workspace, .workspace--sidebar-expanded { grid-template-columns: minmax(0, 1fr); }
  .workspace .sidebar {
    position: fixed;
    z-index: 3;
    inset: env(safe-area-inset-top) auto env(safe-area-inset-bottom) 0;
    display: none;
    width: min(340px, calc(100% - 32px));
    padding: 12px 16px 20px;
    box-shadow: var(--shadow-lg);
  }
  .workspace--mobile-menu-open .sidebar { display: block; }
  .workspace .sidebar .sidebar-heading h2,
  .workspace .sidebar .sidebar-section { display: block; }
  .workspace .sidebar .mode-card-copy { display: grid; }
  .workspace .sidebar:not(.sidebar--expanded) .mode-card { grid-template-columns: 24px minmax(0, 1fr); padding-inline: 9px; }
  .workspace .sidebar .mode-list { grid-template-columns: minmax(0, 1fr); }
  .sidebar-toggle-btn { display: none; }
  .drawer-close { display: grid; }
  .workspace--mobile-menu-open .mobile-menu-backdrop {
    position: fixed;
    z-index: 2;
    inset: 0;
    display: block;
    border: 0;
    background: #271c1766;
  }
  .composer-dock { padding-top: 24px; }
  .hero { margin-bottom: 15px; }
  .hero-copy { font-size: 13px; }
  .composer { grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 6px; }
  .composer textarea { padding: 7px; }
  .composer:has(.listening-label:not(:empty)) .composer-actions { max-width: none; }
  .quick-prompts { flex-wrap: nowrap; overflow-x: auto; padding: 3px; margin-inline: -3px; }
  .quick-prompts-label { flex: none; }
  .quick-chip { min-height: 44px; flex: none; }
  .notice summary { min-height: 44px; }
  .mode-start { padding-top: 12px; }
  .recommend-action-grid { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .recommend-action-card { align-items: center; padding: 6px 8px; }
  .discovery-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discovery-cards--featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .discovery-cards--featured .discovery-card-copy { padding-inline: 6px; }
  .discovery-selector { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .discovery-chip-row button { min-height: 44px; }
  .chat-panel:has(.message.user, .message.assistant, .recipe-layout, .coach-panel, .coach-complete) .composer {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 5px;
  }
}

@media (max-height: 530px) {
  .composer-dock { padding-top: 8px; padding-bottom: 4px; }
  .hero { margin-bottom: 8px; }
  .hero .eyebrow, .hero-copy { display: none; }
  .hero h1 { font-size: clamp(25px, 5vw, 36px); }
  .composer { grid-template-columns: minmax(0, 1fr) auto; column-gap: 5px; }
  .composer textarea { min-height: 44px; }
  .notice[open] p { max-height: 20dvh; overflow: auto; }
}

/* rich glow strip behind mascot */

/* ---- Mode list ---- */

/* Active: inset left accent */

/* Compact tooltip */

/* ---- Expanded sidebar ---- */

/* ---- Saved recipes section ---- */
.prompt-list, .saved-list { display: grid; gap: 5px; }

.prompt-card, .saved-card {
  width: 100%;
  border: 1px solid var(--line-warm);
  border-radius: var(--r-xs);
  background: var(--warm);
  padding: 8px 10px;
  color: var(--ink-soft);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  transition: background .15s, border-color .15s, color .15s;
}
.prompt-card:hover, .saved-card:hover {
  background: var(--panel);
  border-color: var(--brand);
  color: var(--ink);
}
.saved-card strong { display: block; margin-bottom: 1px; font-size: 12px; color: var(--ink); }
.saved-card span   { color: var(--muted); font-size: 11px; }

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

.section-row h2 {
  min-width: 0;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  flex: 0 0 auto;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity .15s;
}
.text-button:hover { opacity: .7; }

.empty-saved {
  border-radius: var(--r-xs);
  background: var(--warm);
  padding: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.media-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.media-action {
  min-height: var(--size-media-action);
  display: grid;
  grid-template-columns: var(--size-media-icon) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  border: 1.5px solid rgba(247, 104, 122, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--surface-accent-soft);
  color: var(--text-primary);
  text-align: left;
}

.media-action:hover,
.media-action:focus-visible,
.media-action[aria-expanded="true"] {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-raised);
}

.media-action:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.media-action.is-busy:disabled {
  cursor: wait;
}

.media-action.is-busy .media-action-icon {
  animation: mediaPulse 900ms ease-in-out infinite alternate;
}

.media-action-icon {
  width: var(--size-media-icon);
  height: var(--size-media-icon);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: white;
  font-size: 14px;
  font-weight: 900;
}

.media-action strong,
.media-action small {
  display: block;
}

.media-action strong {
  font-size: 12px;
}

.media-action small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

.media-form {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1.5px solid rgba(247, 104, 122, 0.18);
  border-radius: var(--radius-md);
  background: white;
}

.media-form label {
  font-size: 11px;
  font-weight: 900;
}

.media-form input {
  width: 100%;
  min-width: 0;
  border: 1.5px solid rgba(13, 27, 42, 0.1);
  border-radius: 13px;
  padding: 10px 11px;
  color: var(--text-primary);
}

.media-form-actions {
  display: flex;
  gap: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@keyframes mediaPulse {
  to {
    transform: scale(0.9);
    opacity: 0.72;
  }
}


.account-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-warm);
  border-radius: var(--r-xs);
  background: var(--warm);
  padding: 11px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.account-card.muted {
  color: var(--muted);
}

.account-card strong {
  color: var(--ink);
  font-size: 13px;
}

.account-card span,
.auth-message {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 7px;
}

.auth-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
}

.auth-submit,
.logout-button,
.auth-toggle {
  min-height: 36px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}

.auth-submit,
.logout-button {
  border: 0;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(247,80,110,.22);
}

.auth-toggle {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--brand-dark);
}

.account-required {
  display: grid;
  gap: 8px;
}

.account-required strong {
  color: var(--ink);
}

/* Custom scrollbar */

/* ============================================================
   MODE START
   ============================================================ */

.mode-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 18px 0;
}

.mode-chip-grid button {
  border: 1px solid rgba(247,80,110,.20);
  border-radius: var(--r-sm);
  background: var(--brand-faint);
  color: var(--brand-dark);
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  transition: background .15s, border-color .15s;
}
.mode-chip-grid button:hover {
  background: var(--brand-light);
  border-color: var(--brand);
}
.mode-chip-grid button.is-selected,
.mode-chip-grid button[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(247,80,110,.24);
  transform: translateY(-1px);
}

.mode-starter-prompts {
  display: grid;
  gap: 5px;
  padding: 12px 18px 18px;
}

.mode-starter-prompts button {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--warm);
  color: var(--ink-soft);
  padding: 11px 14px 11px 38px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  position: relative;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .12s cubic-bezier(.4,0,.2,1);
}
.mode-starter-prompts button::before {
  content: "→";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  transition: transform .14s;
}
.mode-starter-prompts button:hover {
  background: var(--panel);
  border-color: var(--brand);
  color: var(--ink);
  transform: translateX(2px);
}
.mode-starter-prompts button:hover::before {
  transform: translateY(-50%) translateX(2px);
}
.mode-starter-prompts button:active { transform: translateX(0); }

.recommend-video-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.recommend-action-detail[hidden] {
  display: none;
}

.recommend-action-detail-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(247,80,110,.2);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.78);
  padding: 12px;
  box-shadow: 0 3px 12px rgba(13,27,42,.04);
}

.recommend-action-detail-copy {
  display: grid;
  gap: 3px;
}

.recommend-action-detail-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  word-break: keep-all;
}

.recommend-action-detail-copy span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  word-break: keep-all;
}

.recommend-video-row input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink);
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 600;
}

.recommend-video-row input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(247,80,110,.12);
}

.recommend-video-row button {
  min-width: 72px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-brand);
}

.recommend-action-status {
  min-height: 16px;
  margin: -4px 0 0;
  color: var(--brand-dark);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.4;
}

.recommend-action-status:empty { display: none; }

.recommend-action-panel.is-processing .recommend-action-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.recommend-action-panel.is-processing .recommend-action-status::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 2px solid rgba(247,80,110,.24);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: recommend-analysis-spin .7s linear infinite;
}

@keyframes recommend-analysis-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 460px) {

  .recommend-video-row {
    grid-template-columns: 1fr;
  }

  .recommend-video-row button {
    min-height: 42px;
  }
}

/* ============================================================
   FILTER PANEL
   ============================================================ */

.filter-panel {
  margin: 12px 18px 0;
  border: 1px solid rgba(247,80,110,.18);
  border-radius: var(--r);
  background: var(--brand-faint);
  overflow: hidden;
}
.filter-panel[open] {
  border-color: rgba(247,80,110,.42);
  box-shadow: 0 8px 22px rgba(247,80,110,.12);
}

.filter-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  user-select: none;
}
.filter-panel[open] summary {
  background: linear-gradient(90deg, rgba(247,80,110,.11), rgba(247,80,110,.03));
}
.filter-panel summary::-webkit-details-marker { display: none; }

.filter-panel summary::after {
  content: "›";
  color: var(--brand);
  font-size: 17px;
  display: inline-block;
  transform: rotate(90deg);
  transition: transform .18s var(--ease);
  line-height: 1;
  flex-shrink: 0;
}
.filter-panel[open] summary::after { transform: rotate(270deg); }

.filter-panel summary small {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel-body {
  border-top: 1px solid rgba(247,80,110,.10);
  background: var(--panel);
  padding: 14px 14px 16px;
}
.filter-panel:not([open]) .filter-panel-body { display: none; }

.filter-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.filter-panel-title strong { font-size: 12.5px; color: var(--ink); }
.filter-panel-title button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  padding: 0;
}

.filter-group { margin-bottom: 12px; }
.filter-group:last-of-type { margin-bottom: 0; }

.filter-group > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.filter-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all .14s var(--ease);
}
.filter-chip:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-faint);
}
.filter-chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(247,80,110,.28);
}

.prefs-saved-note {
  margin: 10px 0 0;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 600;
}

.recipe-builder-panel {
  margin: 12px 18px 0;
  border: 1px solid rgba(247,80,110,.18);
  border-radius: var(--r);
  background: var(--panel);
  padding: 14px;
  box-shadow: 0 2px 10px rgba(13,27,42,.04);
}
.recipe-builder-layout {
  display: grid;
  grid-template-columns: minmax(320px, .88fr) minmax(360px, 1.12fr);
  gap: 18px;
  align-items: start;
}
.recipe-builder-form { min-width: 0; }
.recipe-builder-head { display: grid; gap: 4px; margin-bottom: 12px; }
.recipe-builder-head strong { color: var(--ink); font-size: 14px; font-weight: 800; }
.recipe-builder-head span,
.recipe-builder-footer p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.recipe-builder-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.recipe-builder-actions button,
.recipe-builder-footer button {
  border: 1px solid rgba(247,80,110,.24);
  border-radius: var(--r-sm);
  background: var(--brand-faint);
  color: var(--brand-dark);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s var(--ease), background .15s, border-color .15s;
}
.recipe-builder-actions button:hover,
.recipe-builder-footer button:hover { background: var(--brand-light); border-color: var(--brand); transform: translateY(-1px); }
.recipe-builder-stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 14px;
}
.recipe-builder-stepper button {
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 1px solid rgba(247,80,110,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  padding: 7px 4px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s var(--ease), border-color .15s, background .15s, color .15s;
}
.recipe-builder-stepper button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  background: var(--brand-faint);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
}
.recipe-builder-stepper button.is-active {
  border-color: var(--brand);
  background: var(--brand-faint);
  color: var(--brand-dark);
}
.recipe-builder-stepper button.is-active span,
.recipe-builder-stepper button.is-done span {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(247,80,110,.24);
}
.recipe-builder-stepper button:hover { transform: translateY(-1px); }
.recipe-builder-step-panel {
  display: grid;
  gap: 11px;
  min-height: 286px;
  border: 1px solid rgba(247,80,110,.12);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,248,240,.74)),
    var(--panel);
  padding: 13px;
}
.recipe-builder-step-panel[hidden] { display: none; }
.recipe-builder-step-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.24;
}
.recipe-builder-step-panel p,
.recipe-builder-manual p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.recipe-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.recipe-choice-card {
  display: grid;
  gap: 9px;
  align-content: start;
  min-height: 170px;
  border: 1px solid rgba(247,80,110,.18);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  padding: 0 0 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(13,27,42,.06);
  transition: transform .14s var(--ease), border-color .14s, box-shadow .14s, background .14s;
}
.recipe-choice-card:hover,
.recipe-choice-card.is-selected {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: var(--brand-faint);
  box-shadow: 0 7px 18px rgba(247,80,110,.14);
}
.recipe-choice-card > span:not(.recipe-choice-visual) {
  display: block;
  padding: 0 12px;
}
.recipe-choice-visual {
  display: block;
  width: 100%;
  height: 72px;
  border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0;
  background: var(--warm);
  overflow: hidden;
}
.recipe-start-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-choice-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.65), rgba(255,255,255,0) 42%),
    linear-gradient(145deg, rgba(247,80,110,.96), rgba(194,59,43,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 16px rgba(247,80,110,.22);
}
.recipe-choice-icon-1 {
  background:
    linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,0) 40%),
    linear-gradient(145deg, #D4A032, #F7687A);
}
.recipe-choice-icon-2 {
  background:
    linear-gradient(135deg, rgba(255,255,255,.6), rgba(255,255,255,0) 40%),
    linear-gradient(145deg, var(--navy), #562033);
}
.recipe-choice-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}
.recipe-choice-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.recipe-draft-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recipe-draft-chip {
  min-height: 38px;
  border: 1px solid rgba(247,80,110,.2);
  border-radius: var(--r-full);
  background: #fff;
  color: var(--ink);
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s var(--ease), background .15s, border-color .15s, color .15s;
}
.recipe-draft-chip:hover,
.recipe-draft-chip.is-selected {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.recipe-taste-board,
.recipe-cuisine-board,
.recipe-texture-board {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(247,80,110,.14);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,240,238,.56)),
    var(--panel);
  padding: 12px;
}
.recipe-taste-board h4,
.recipe-cuisine-board h4,
.recipe-texture-board h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}
.recipe-taste-scale {
  display: grid;
  gap: 7px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.78);
  padding: 9px;
}
.recipe-taste-scale-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.recipe-taste-scale-head strong {
  color: var(--brand-dark);
  font-size: 12px;
  line-height: 1.3;
}
.recipe-scale-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 7px;
}
.recipe-scale-option {
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 5px;
  min-height: 76px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  padding: 5px 2px;
  cursor: pointer;
  transition: transform .12s var(--ease), background .15s, color .15s;
}
.recipe-scale-option span {
  display: block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(247,80,110,.38);
  border-radius: var(--r-full);
  background: rgba(255,255,255,.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 5px 14px rgba(13,27,42,.08);
  transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s;
}
.recipe-scale-option-1 span { width: 31px; height: 31px; }
.recipe-scale-option-2 span { width: 38px; height: 38px; }
.recipe-scale-option-3 span { width: 46px; height: 46px; }
.recipe-scale-option-4 span { width: 56px; height: 56px; }
.recipe-scale-option em {
  color: inherit;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}
.recipe-scale-option:hover,
.recipe-scale-option.is-selected {
  background: var(--brand-faint);
  color: var(--brand-dark);
  transform: translateY(-1px);
}
.recipe-scale-option:hover span,
.recipe-scale-option.is-selected span {
  border-color: var(--brand);
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.85), rgba(255,255,255,0) 38%),
    linear-gradient(145deg, var(--brand), var(--brand-dark));
  box-shadow: 0 8px 20px rgba(247,80,110,.22);
}
.recipe-cuisine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.recipe-cuisine-grid .recipe-draft-chip {
  justify-content: center;
  border-radius: var(--r-sm);
  min-height: 44px;
}
.recipe-builder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px; }
.recipe-builder-grid label,
.recipe-builder-field { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.recipe-builder-grid input,
.recipe-builder-grid select,
.recipe-builder-field input,
.recipe-builder-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--warm);
  color: var(--ink);
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
}
.recipe-builder-field { margin-top: 9px; }
.recipe-builder-field small { color: var(--muted-light); font-size: 10px; font-weight: 800; }
.recipe-builder-field textarea { min-height: 58px; resize: vertical; line-height: 1.45; }
.recipe-builder-grid input:focus,
.recipe-builder-grid select:focus,
.recipe-builder-field input:focus,
.recipe-builder-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(247,80,110,.12); }
.recipe-photo-draft {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.recipe-photo-draft > button,
.recipe-photo-preview button {
  border: 1px solid rgba(247,80,110,.24);
  border-radius: var(--r-sm);
  background: var(--brand-faint);
  color: var(--brand-dark);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s var(--ease), background .15s, border-color .15s;
}
.recipe-photo-draft > button:hover,
.recipe-photo-preview button:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  transform: translateY(-1px);
}
.recipe-photo-draft p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
.recipe-photo-preview {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--warm);
  padding: 8px;
}
.recipe-photo-preview[hidden] { display: none; }
.recipe-photo-preview img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--panel);
}
.recipe-photo-preview div {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.recipe-photo-preview strong,
.recipe-photo-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipe-photo-preview strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.recipe-photo-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.recipe-builder-summary {
  display: grid;
  gap: 8px;
  min-height: 120px;
  border: 1px dashed rgba(247,80,110,.26);
  border-radius: var(--r-sm);
  background: var(--brand-faint);
  color: var(--muted);
  padding: 12px;
  font-size: 12px;
  font-weight: 800;
}
.recipe-builder-summary span {
  display: grid;
  grid-template-columns: minmax(128px, 148px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.recipe-builder-summary strong {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.45;
  word-break: keep-all;
}
.recipe-builder-summary em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.recipe-builder-manual {
  border: 1px solid rgba(247,80,110,.18);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.78);
  padding: 10px;
}
.recipe-builder-manual summary {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.recipe-builder-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.recipe-builder-footer p { margin: 0; }
.recipe-builder-footer button { flex: 0 0 auto; min-width: 94px; }
.recipe-builder-footer button[data-recipe-builder-prev] { background: #fff; color: var(--brand-dark); box-shadow: none; }
.recipe-builder-footer button[data-recipe-builder-next],
.recipe-builder-footer button[data-recipe-draft-action="submit"] { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.recipe-builder-footer button[hidden] { display: none; }
.recipe-builder-footer button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.recipe-builder-assist {
  display: grid;
  gap: 14px;
  min-width: 0;
  border-radius: var(--r);
  background:
    linear-gradient(135deg, rgba(255,248,250,.96), rgba(248,242,235,.84)),
    var(--warm);
  padding: 14px;
}
.recipe-builder-assist-head {
  display: grid;
  gap: 4px;
}
.recipe-builder-assist-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}
.recipe-builder-assist-head span {
  max-width: 58ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.recipe-builder-assist-section {
  display: grid;
  gap: 9px;
}
.recipe-builder-assist-section h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
}
.recipe-preset-grid {
  display: grid;
  gap: 9px;
}
.recipe-preset-grid-examples {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.recipe-preset-grid-themes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.recipe-preset-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "media copy"
    "media cta";
  gap: 8px 10px;
  min-height: 118px;
  border: 1px solid rgba(247,80,110,.16);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.82);
  color: var(--ink);
  padding: 10px;
  text-align: left;
  box-shadow: 0 1px 4px rgba(13,27,42,.04);
  transition: transform .14s var(--ease), border-color .14s, box-shadow .14s, background .14s;
}
.recipe-preset-card:hover {
  transform: translateY(-1px);
  border-color: rgba(247,80,110,.42);
  background: var(--panel);
  box-shadow: 0 5px 16px rgba(13,27,42,.08);
}
.recipe-preset-card:active { transform: translateY(0); }
.recipe-preset-card-theme {
  grid-template-columns: 1fr;
  grid-template-areas:
    "media"
    "copy"
    "cta";
  gap: 9px;
  min-height: 172px;
  overflow: hidden;
  padding: 0 0 10px;
}
.recipe-preset-media {
  grid-area: media;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,.92) 0 12%, transparent 13%),
    linear-gradient(145deg, rgba(247,80,110,.95), rgba(194,59,43,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.46), 0 4px 12px rgba(247,80,110,.2);
}
.recipe-preset-card-theme .recipe-preset-media {
  width: 100%;
  height: 86px;
  border-radius: calc(var(--r-sm) - 1px) calc(var(--r-sm) - 1px) 0 0;
  background: var(--warm);
  box-shadow: none;
  overflow: hidden;
}
.recipe-preset-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-preset-card-theme .recipe-preset-copy {
  padding: 0 10px;
}
.recipe-preset-card-theme .recipe-preset-cta {
  margin: 0 10px;
}
.recipe-preset-copy {
  grid-area: copy;
  display: grid;
  gap: 3px;
  min-width: 0;
}
.recipe-preset-copy strong,
.recipe-preset-copy small,
.recipe-preset-copy em {
  min-width: 0;
  overflow-wrap: anywhere;
}
.recipe-preset-copy strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.28;
}
.recipe-preset-copy small {
  color: var(--muted-light);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.3;
}
.recipe-preset-copy em {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}
.recipe-preset-cta {
  grid-area: cta;
  justify-self: start;
  align-self: end;
  border-radius: var(--r-full);
  background: var(--brand-faint);
  color: var(--brand-dark);
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.25;
}
.recipe-builder-status {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--brand-dark);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.45;
}
@container (max-width: 1040px) {
  .recipe-builder-layout { grid-template-columns: 1fr; }
  .recipe-preset-grid-examples { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recipe-preset-grid-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 767px) {
  .recipe-preset-grid-examples,
  .recipe-preset-grid-themes { grid-template-columns: 1fr; }
  .recipe-preset-card { min-height: 0; }
  .recipe-choice-grid { grid-template-columns: 1fr; }
  .recipe-builder-stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recipe-builder-step-panel { min-height: 0; }
  .recipe-cuisine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .recipe-builder-grid { grid-template-columns: 1fr; }
  .recipe-builder-panel { margin: 10px 0 0; padding: 12px; }
  .recipe-builder-assist { padding: 12px; }
  .recipe-builder-stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recipe-builder-stepper button { grid-template-columns: 24px 1fr; justify-items: start; align-items: center; min-height: 44px; padding: 8px; }
  .recipe-builder-stepper button strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .recipe-draft-chip { min-height: 42px; padding: 9px 14px; }
  .recipe-choice-card { min-height: 154px; grid-template-columns: 1fr; align-items: stretch; }
  .recipe-builder-summary span { grid-template-columns: 1fr; gap: 3px; }
  .recipe-taste-board,
  .recipe-cuisine-board,
  .recipe-texture-board { padding: 10px; }
  .recipe-taste-scale { padding: 8px 6px; }
  .recipe-taste-scale-head { grid-template-columns: 1fr; gap: 2px; }
  .recipe-taste-scale-head span { display: none; }
  .recipe-scale-options { gap: 3px; }
  .recipe-scale-option { min-height: 68px; padding: 4px 0; }
  .recipe-scale-option span { width: 20px; height: 20px; border-width: 2px; }
  .recipe-scale-option-1 span { width: 25px; height: 25px; }
  .recipe-scale-option-2 span { width: 31px; height: 31px; }
  .recipe-scale-option-3 span { width: 38px; height: 38px; }
  .recipe-scale-option-4 span { width: 46px; height: 46px; }
  .recipe-scale-option em { font-size: 9px; }
  .recipe-cuisine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recipe-photo-preview { grid-template-columns: 56px 1fr; }
  .recipe-photo-preview img { width: 56px; height: 56px; }
  .recipe-builder-footer { align-items: stretch; flex-direction: column; }
  .recipe-builder-footer button { width: 100%; }
}

/* ============================================================
   MESSAGES
   ============================================================ */

.message {
  margin: 0 0 10px;
  border-radius: var(--r);
  padding: 11px 15px;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.message.system,
.message.assistant {
  max-width: 84%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  border-radius: 4px var(--r) var(--r) var(--r);
}

/* Mingo avatar beside each assistant message */
.message.assistant {
  position: relative;
  margin-inline-start: 38px;
}
.message.assistant::before {
  content: '';
  position: absolute;
  left: -38px;
  top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: url('uploads/BI_2.png') center 34% / 64% auto no-repeat, var(--panel);
  flex-shrink: 0;
}

.message.user {
  width: fit-content;
  max-width: 78%;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: var(--brand-light);
  color: var(--ink);
  font-weight: 500;
  border-radius: var(--r) 4px var(--r) var(--r);
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.pill-button {
  border: 1px solid rgba(247,80,110,.24);
  border-radius: var(--r-sm);
  background: var(--brand-faint);
  color: var(--brand-dark);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  transition: background .14s;
}
.pill-button:hover {
  background: var(--brand-light);
  border-color: var(--brand);
}

/* ============================================================
   RECIPE TEASER
   ============================================================ */

.recipe-teaser {
  max-width: 560px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.recipe-teaser span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.recipe-teaser h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.recipe-teaser p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.recipe-teaser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.recipe-teaser-actions button {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 700;
  transition: all .14s var(--ease);
}
.recipe-teaser-actions button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-faint);
}
.recipe-teaser-actions button:first-child {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}
.recipe-teaser-actions button:first-child:hover { background: var(--brand-dark); }

/* ============================================================
   RECOMMENDATIONS
   ============================================================ */

.recommendation-panel {
  max-width: 720px;
  margin: 0 0 18px;
}

.recommendation-intro { max-width: 100%; }

.recommendation-grid {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.recommendation-card {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 15px 17px;
  color: var(--ink);
  text-align: left;
  transition: border-color .14s, box-shadow .14s, transform .12s var(--ease);
}
.recommendation-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.recommendation-card strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.recommendation-card span,
.recommendation-card em { color: var(--muted); font-size: 13px; font-style: normal; line-height: 1.5; }
.recommendation-card small {
  width: fit-content;
  border-radius: var(--r-sm);
  background: var(--warm);
  padding: 3px 9px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}
.recommendation-card b { color: var(--brand-dark); font-size: 12px; font-weight: 600; }

html[lang="ja"] .recommendation-card,
html[lang="ja"] .recommendation-intro {
  line-break: strict;
  word-break: keep-all;
  overflow-wrap: normal;
}

html[lang="ja"] .ja-phrase,
html[lang="ja"] .mode-chip-grid button {
  white-space: nowrap;
}

html[lang="ja"] .recommendation-card wbr,
html[lang="ja"] .recommendation-intro wbr { display: inline; }

.action-result-card {
  max-width: 720px;
  margin: 12px 0 18px;
  border: 1px solid var(--brand-soft);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #fff 0%, var(--brand-faint) 100%);
  box-shadow: var(--shadow-sm), 0 0 0 6px rgba(247, 104, 122, .06);
  padding: 18px 20px;
  color: var(--ink);
  animation: resultLift .42s var(--ease) both;
}

.action-result-card span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.action-result-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.action-result-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
}

.action-result-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.shopping-marketplace-hint {
  display: block;
  margin-top: 6px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.shopping-region-control {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.shopping-region-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.shopping-region-control select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--brand-soft);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.shopping-link-list {
  gap: 10px;
  padding-left: 0 !important;
  list-style: none;
}

.shopping-section {
  margin-top: 16px;
}

.shopping-section h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.shopping-link-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 12px;
  box-shadow: var(--shadow-xs);
}

.shopping-link-item strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.shopping-link-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shopping-link-item nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.shopping-link-item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--brand-soft);
  border-radius: var(--r-pill);
  background: var(--brand-faint);
  color: var(--brand-dark);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}

.shopping-link-item a:hover,
.shopping-link-item a:focus-visible {
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.shopping-cart-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.shopping-cart-choice input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--brand-dark);
}

.shopping-cart-actions {
  margin-top: 16px;
}

.shopping-cart-send {
  min-height: 44px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--brand-dark);
  border-radius: var(--r-md);
  background: var(--brand-dark);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.shopping-cart-send:disabled {
  background: var(--panel);
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}

.shopping-cart-choice input:focus-visible,
.shopping-cart-send:focus-visible,
.shopping-cart-actions a:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 3px;
}

.shopping-cart-actions nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.shopping-cart-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-dark);
  text-underline-offset: 3px;
}

.shopping-sponsored-panel {
  margin-top: 16px;
  border: 1px solid var(--brand-soft);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--brand-faint), var(--panel));
  padding: 12px;
  box-shadow: var(--shadow-xs);
}

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

.shopping-sponsored-head span {
  border-radius: var(--r-pill);
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
}

.shopping-sponsored-head strong {
  color: var(--ink);
  font-size: 13px;
}

.shopping-sponsored-grid {
  display: grid;
  gap: 10px;
}

.shopping-sponsored-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 10px;
}

.shopping-sponsored-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--warm);
}

.shopping-sponsored-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.shopping-sponsored-card > div {
  min-width: 0;
}

.shopping-sponsored-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.shopping-sponsored-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin-top: 8px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--panel);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: var(--shadow-brand);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}

.shopping-sponsored-card a:hover,
.shopping-sponsored-card a:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand-lg);
}

@media (max-width: 560px) {
  .coach-step-focus {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .shopping-link-item {
    grid-template-columns: 1fr;
  }

  .shopping-link-item nav {
    justify-content: stretch;
  }

  .shopping-link-item a {
    flex: 1 1 calc(50% - 6px);
  }

  .shopping-sponsored-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .shopping-sponsored-card img {
    width: 52px;
    height: 52px;
  }
}

button.is-running {
  transform: translateY(-1px) scale(.985);
  box-shadow: var(--shadow-brand);
  opacity: .9;
  cursor: wait;
}

@keyframes resultLift {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   K-FOOD ANSWER
   ============================================================ */

.kfood-answer {
  max-width: 720px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.kfood-answer header {
  padding: 20px 22px 16px;
  background: linear-gradient(140deg, var(--navy) 0%, #1a3050 100%);
  color: #fff;
}

.kfood-answer header span {
  display: block;
  margin-bottom: 5px;
  color: rgba(255,180,191,.85);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.kfood-answer h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.015em;
}

.kfood-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.kfood-grid section {
  background: var(--panel);
  padding: 16px 18px;
}

.kfood-grid h4 {
  margin: 0 0 5px;
  color: var(--brand-dark);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.kfood-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.kfood-answer footer {
  padding: 12px 18px;
  background: var(--warm);
  border-top: 1px solid var(--line);
}

.kfood-answer footer button {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 8px 15px;
  font-size: 12px;
  font-weight: 700;
  transition: all .14s var(--ease);
}
.kfood-answer footer button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-faint);
}

/* ============================================================
   RECIPE LAYOUT  (container query for side-by-side)
   ============================================================ */

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  width: 100%;
  margin: 14px 0 26px;
}

/* Wide enough panel: recipe card + Kmingo card side by side */
@container (min-width: 890px) {
  .recipe-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
  .kmingo-prompt,
  .kmingo-active-card {
    position: sticky;
    top: 16px;
    margin-top: 6px;
  }
}

/* ============================================================
   RECIPE CARD  — The hero visual element
   ============================================================ */

.recipe-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

/* ---- Header ---- */
.recipe-hero {
  margin: 0;
  padding: 26px 24px 22px;
  border-top: 3px solid var(--brand);
  border-bottom: 1px solid var(--line);
  background: var(--warm);
  color: var(--ink);
}

.recipe-hero h3 {
  margin: 0 0 9px;
  font-family: var(--display-font);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -.025em;
}

.recipe-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.68;
  max-width: 540px;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.recipe-meta span {
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: .005em;
}

/* ---- Body ---- */
.recipe-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  background: var(--panel);
  min-width: 0;
}

/* Ingredients column */
.recipe-body > section:not(.recipe-note) {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

/* Divider between ingredients and instructions */
.recipe-body > section:not(.recipe-note):first-child {
  border-right: 1px solid var(--line);
}

/* Full-width note sections */
.recipe-note {
  grid-column: 1 / -1;
  padding: 17px 24px;
  border-top: 1px solid var(--line);
}

.recipe-body h4 {
  margin: 0 0 11px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ---- Ingredients ---- */
ul.ingredients {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

ul.ingredients li {
  position: relative;
  padding: 5px 0 5px 18px;
  border-bottom: 1px solid var(--warm-mid);
}
ul.ingredients li:last-child { border-bottom: none; }
ul.ingredients li::before {
  content: "•";
  position: absolute;
  left: 2px;
  top: 5px;
  color: var(--brand);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

/* ---- Instructions ---- */
ol.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

ol.steps li {
  position: relative;
  padding: 7px 0 7px 38px;
  counter-increment: step;
  border-bottom: 1px solid var(--warm-mid);
}
ol.steps li:last-child { border-bottom: none; }
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 7px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--warm);
  border: 1.5px solid var(--line-warm);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---- Note section bodies ---- */
.recipe-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.72;
}

.gochujang-integration {
  background: var(--brand-faint);
}
.gochujang-integration h4 { color: var(--muted) !important; }

.filter-note {
  background: var(--warm);
}
.filter-note h4 { color: var(--muted); }

.kmingo-twist-section {
  background: var(--brand-faint);
}
.kmingo-twist-section h4 { color: var(--brand-dark) !important; }

/* Safety note: soft amber */
.recipe-body > .recipe-note:last-of-type {
  background: linear-gradient(to right, #fffbf4, var(--panel));
}
.recipe-body > .recipe-note:last-of-type h4 { color: #8a7040 !important; }

/* ============================================================
   RECIPE ACTIONS
   ============================================================ */

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 22px;
  background: var(--warm);
  border-top: 1px solid var(--line);
}

.recipe-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 700;
  transition: all .14s var(--ease);
}
.recipe-actions button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-faint);
}

/* Primary CTA: Start Cooking Coach */
.recipe-actions button[data-action="cook"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
  padding: 10px 20px;
  font-size: 13px;
}
.recipe-actions button[data-action="cook"]:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: var(--shadow-brand-lg);
  transform: translateY(-1px);
}

/* Kmingo button: pink outline accent */
.recipe-actions button[data-action="kmingo"] {
  border-color: rgba(247,80,110,.28);
  color: var(--brand-dark);
  background: var(--brand-faint);
}
.recipe-actions button[data-action="kmingo"]:hover {
  background: var(--brand-light);
  border-color: var(--brand);
}

/* ============================================================
   KMINGO ACTIVE CARD (after twist added)
   ============================================================ */

.kmingo-active-card {
  border: 1px solid rgba(247,80,110,.24);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, #fff9fa 0%, #ffdde6 100%);
  padding: 20px;
}

.kmingo-active-card > span {
  display: block;
  margin-bottom: 9px;
  color: var(--brand-dark);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.kmingo-active-card > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.75;
}

/* ============================================================
   KMINGO SIDE PROMPT
   ============================================================ */

.kmingo-prompt {
  border: 1.5px solid rgba(247,80,110,.22);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #fff9fa 0%, #ffe3eb 100%);
  padding: 22px 20px;
  animation: kmingoGlow 3.2s ease-in-out infinite alternate;
}

.kmingo-prompt h4 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: none;
}

.kmingo-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.kmingo-prompt button {
  display: block;
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: var(--shadow-brand);
  transition: background .14s, transform .12s, box-shadow .14s;
}
.kmingo-prompt button:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand-lg);
}
.kmingo-prompt button:active { transform: translateY(0); }

@keyframes kmingoGlow {
  from { box-shadow: 0 4px 16px rgba(247,80,110,.10); }
  to   { box-shadow: 0 12px 36px rgba(247,80,110,.28); }
}

/* ============================================================
   COOKING COACH  — Live guided cooking experience
   ============================================================ */

.coach-panel {
  max-width: 720px;
  margin: 14px 0 22px;
  border-radius: var(--r-xl);
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Header */
.coach-panel header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px 12px;
  border-top: 3px solid var(--brand);
  border-bottom: 1px solid var(--line);
  background: var(--warm);
  color: var(--ink);
  padding: 22px 22px 18px;
}

.coach-return {
  grid-column: 2;
  grid-row: 1;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink);
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  transition: background .14s;
}
.coach-return:hover { border-color: var(--brand); background: var(--brand-faint); }

.coach-panel h3 {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(22px, 2.7vw, 30px);
  font-weight: 400;
  letter-spacing: -.012em;
  line-height: 1.22;
}

.coach-panel header > :is(p, .coach-progress, .auto-read-toggle, .auto-read-status) { grid-column: 1 / -1; }
:is(html[lang="ko"], html[lang="ja"], html[lang="zh"]) :is(.recipe-hero h3, .coach-panel h3) { font-family: inherit; font-weight: 700; }

.coach-panel > header > p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.52;
}

.coach-progress {
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--line);
}
.coach-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .4s var(--ease-out);
}

.auto-read-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  width: fit-content;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.auto-read-toggle input { accent-color: var(--brand); }

.auto-read-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  padding: 9px 11px;
  color: var(--ink-soft);
}

.auto-read-status strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.auto-read-status small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.auto-read-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.auto-read-status.ready .auto-read-status-dot,
.auto-read-status.complete .auto-read-status-dot {
  background: var(--brand);
}

.auto-read-status.speaking .auto-read-status-dot {
  background: var(--brand);
  animation: autoReadPulse 1.1s ease-in-out infinite;
}

.auto-read-status.error .auto-read-status-dot {
  background: var(--brand-dark);
}

@keyframes autoReadPulse {
  0%, 100% { transform: scale(.78); opacity: .55; }
  50% { transform: scale(1.22); opacity: 1; }
}

/* ---- Steps container ---- */
.coach-steps {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--warm);
}

/* ---- Step: BASE ---- */
.coach-step {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 10px 12px;
  transition: opacity .2s var(--ease), box-shadow .2s;
}

/* ---- Step: COMPLETED ---- */
.coach-step.complete {
  background: var(--warm);
  border-color: var(--line-warm);
}

.coach-step.complete small,
.coach-step.upcoming small { display: none; }

/* ---- Step: ACTIVE (current) ---- */
.coach-step.active {
  grid-template-columns: 1fr;
  border-color: var(--line-strong);
  border-left: 4px solid var(--brand);
  background: var(--panel);
  padding: 16px 18px 18px 18px;
  box-shadow: var(--shadow-xs);
}

.current-step-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-self: start;
  margin-bottom: 4px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  padding: 5px 11px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.coach-step-main {
  display: grid;
  grid-template-columns: auto auto minmax(0,1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
}

.coach-step input {
  margin: 0;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.coach-step-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--brand-faint);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.coach-step.active .coach-step-number {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: var(--shadow-brand);
  font-size: 17px;
}

.coach-step strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}
.coach-step.active strong {
  font-size: 18px;
  line-height: 1.28;
  letter-spacing: -.012em;
}

.coach-step small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.coach-step.active small {
  display: block;
  margin-top: 5px;
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.coach-step-focus {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 12px;
  margin: 6px 0 2px 68px;
  align-items: start;
}

.coach-step-visual {
  aspect-ratio: 4 / 3;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--warm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.coach-step-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coach-commerce-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(247,80,110,.16);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--panel) 0%, var(--brand-faint) 100%);
  padding: 12px;
}

.coach-commerce-panel > span {
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.coach-commerce-panel > strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.coach-product-list {
  display: grid;
  gap: 7px;
}

.coach-product-card {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  padding: 9px 10px;
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}

.coach-product-card span {
  color: var(--brand-dark);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.coach-product-card strong {
  font-size: 12px;
  line-height: 1.3;
}

.coach-product-card small {
  display: block !important;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  -webkit-line-clamp: unset;
}

.coach-product-card b {
  justify-self: start;
  margin-top: 2px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
}

.coach-product-card:hover,
.coach-product-card:focus-visible {
  border-color: var(--brand-soft);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.coach-cue-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-left: 68px;
}

.coach-cue-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid rgba(247,80,110,.16);
  border-radius: var(--r-full);
  background: var(--brand-faint);
  color: var(--brand-dark);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
}

.coach-cue-row svg,
.coach-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coach-step-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.coach-action {
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 10px 8px;
  font-size: 11.5px;
  font-weight: 800;
  transition: all .14s var(--ease);
  white-space: normal;
}
.coach-action-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: var(--warm);
  color: var(--ink-soft);
}
.coach-action:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-faint);
  transform: translateY(-1px);
}
.coach-action:hover .coach-action-icon {
  background: var(--panel);
  color: var(--brand-dark);
}

/* Active: "Next Step" is the primary button */
.coach-action-next {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}
.coach-action-next .coach-action-icon {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.coach-action-next:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: var(--shadow-brand-lg);
}
.coach-action-next:hover .coach-action-icon {
  background: rgba(255,255,255,.22);
  color: #fff;
}

/* ============================================================
   COACH COMPLETE
   ============================================================ */

.coach-complete {
  max-width: 580px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--panel);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.coach-complete span {
  display: block;
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.coach-complete h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.022em;
}

.coach-complete p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.coach-complete div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.coach-complete button {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  transition: all .14s var(--ease);
}
.coach-complete button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-faint);
}

/* ============================================================
   FEEDBACK PANEL
   ============================================================ */

.feedback-panel {
  max-width: 680px;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.feedback-panel h3 {
  margin: 0 0 13px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.012em;
}

.feedback-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.feedback-options button,
.feedback-submit {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--warm);
  color: var(--ink-soft);
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  transition: all .14s var(--ease);
}
.feedback-options button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-faint);
}
.feedback-options button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.feedback-submit {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}
.feedback-submit:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.feedback-submit:disabled { opacity: .45; cursor: not-allowed; }

.feedback-panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.feedback-panel textarea {
  width: 100%;
  min-height: 64px;
  font-size: 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  padding: 9px 12px;
  color: var(--ink);
  background: var(--warm);
  resize: vertical;
  transition: border-color .14s, background .14s;
}
.feedback-panel textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(247,80,110,.10);
}

.feedback-thanks {
  margin: 10px 0 0;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}
/* little speech bubble tail */

textarea {
  width: 100%;
  min-height: 48px;
  max-height: 140px;
  resize: none;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 12px 15px;
  outline: none;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.35;
  background: var(--warm);
  transition: border-color .14s, background .14s, box-shadow .14s;
  min-width: 0;
}
textarea:focus {
  border-color: var(--brand);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(247,80,110,.10);
}
textarea::placeholder { color: var(--muted-light); font-size: 13.5px; line-height: 1.35; }

/* ============================================================
   FOCUS STATES (accessibility)
   ============================================================ */

button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ============================================================
   RESPONSIVE — TABLET  ≤ 900px
   ============================================================ */

@media (max-width: 900px) {
  :root { --app-px: 20px; }

  /* Workspace stacks vertically */

  /* Sidebar becomes a compact horizontal tab row */

  /* Show compact label, hide icon */

  /* Active underline instead of left accent */

  /* Recipe layout: always single column on tablet */
  .recipe-layout {
    grid-template-columns: 1fr !important;
  }
  .kmingo-prompt,
  .kmingo-active-card {
    position: static !important;
    top: auto !important;
    margin-top: 0;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE  ≤ 620px
   ============================================================ */

@media (max-width: 767px) {

  /* Messages fill width */
  .message.system,
  .message.assistant,
  .message.user { max-width: 100%; }

  /* Recipe header */
  .recipe-hero { padding: 22px 18px 18px; }
  .recipe-hero h3 { font-size: 20px; }

  /* Recipe body: single column */
  .recipe-body {
    grid-template-columns: 1fr;
  }
  .recipe-body > section:not(.recipe-note):first-child {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  /* Recipe actions: CTA full width */
  .recipe-actions { padding: 13px 16px; gap: 7px; }
  .recipe-actions button { font-size: 12px; padding: 9px 14px; }
  .recipe-actions button[data-action="cook"] {
    width: 100%;
    text-align: center;
    display: block;
    font-size: 13px;
  }

  /* K-food: single column */
  .kfood-grid { grid-template-columns: 1fr; }

  .coach-step { grid-template-columns: 1fr; }
  .coach-step-focus {
    grid-template-columns: 1fr;
    margin-left: 0;
  }
  .coach-step-actions {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .coach-cue-row { margin-left: 0; }

  /* Composer: slightly smaller */
  textarea { min-height: 58px; padding: 11px 13px; }
  textarea::placeholder { font-size: 12.5px; }

  /* Mode tabs: even smaller */

  /* Chat scroll: less horizontal padding */
  .message.assistant { margin-inline-start: 0; }
  .message.assistant::before { display: none; }

  .coach-panel header { grid-template-columns: minmax(0, 1fr); }
  .coach-return { grid-column: 1; grid-row: 2; justify-self: start; }

  /* Coach complete: no centering */
  .coach-complete { text-align: left; }
  .coach-complete div { justify-content: flex-start; }
}

/* ============================================================
   WIDE DESKTOP  ≥ 1440px
   ============================================================ */

@media (min-width: 1440px) {
  :root { --app-px: 64px; }
}

/* ============================================================
   WELCOME CARDS (shown inside mode-start panels)
   ============================================================ */

.welcome-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 18px 18px;
}

.welcome-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 15px 13px 14px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, transform .12s var(--ease);
  box-shadow: var(--shadow-xs);
}

.welcome-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(247,80,110,.07);
  transform: translateY(-2px);
}

.welcome-card:active { transform: translateY(0); }

.welcome-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--brand-faint);
  border: 1px solid rgba(247,80,110,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.welcome-card strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
}

.welcome-card span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

@media (max-width: 767px) {
  .welcome-cards {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 14px;
  }
  .welcome-card { flex-direction: row; align-items: center; padding: 11px 13px; }
  .welcome-card-icon { flex-shrink: 0; }
}

/* ============================================================
   KMINGO SIDE CARD — flamingo accent glyph
   ============================================================ */

.kmingo-prompt { position: relative; overflow: hidden; }

.kmingo-prompt::after {
  content: "🦩";
  position: absolute;
  bottom: -6px;
  right: 10px;
  font-size: 52px;
  line-height: 1;
  opacity: .09;
  pointer-events: none;
  transform: scaleX(-1);
}

/* Matches whatever class app.js uses for a pending message */
.message.loading,
.mingo-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r);
  background: var(--warm);
  border: 1px solid var(--line-warm);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  max-width: 380px;
}

.mingo-loading-face {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  overflow: hidden;
  flex-shrink: 0;
  animation: mingoBounce .9s ease-in-out infinite;
}

.mingo-loading-face img {
  width: 110%;
  height: 110%;
  margin: -5%;
  object-fit: contain;
  object-position: center 25%;
}

.mingo-loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.mingo-loading-dots span {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.mingo-loading-dots span:nth-child(2) { animation-delay: .2s; }
.mingo-loading-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: .25; transform: scale(.8); }
  40%           { opacity: 1;   transform: scale(1.1); }
}

@keyframes mingoBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Typing indicator dots inside any assistant loading bubble */
.typing-indicator {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 12px 18px;
}

.typing-indicator span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-light);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .18s; }
.typing-indicator span:nth-child(3) { animation-delay: .36s; }

/* ============================================================
   COACH COMPLETE — Celebration card
   ============================================================ */

.coach-complete {
  position: relative;
  overflow: hidden;
  border-color: rgba(247,80,110,.20);
  /* confetti layer lives in background so pseudo-elements are free */
  background-image:
    radial-gradient(circle, rgba(247,80,110,.55) 1.8px, transparent 1.8px),
    radial-gradient(circle, rgba(255,200,40,.55)  1.8px, transparent 1.8px),
    radial-gradient(circle, rgba(80,160,247,.48)  1.8px, transparent 1.8px),
    radial-gradient(circle, rgba(80,220,160,.48)  1.8px, transparent 1.8px),
    radial-gradient(circle, rgba(200,80,247,.42)  1.8px, transparent 1.8px),
    radial-gradient(circle, rgba(247,80,110,.40)  1.8px, transparent 1.8px),
    radial-gradient(circle, rgba(255,140,60,.50)  1.8px, transparent 1.8px),
    linear-gradient(155deg, #fff9fa 0%, #ffeaf0 100%);
  background-size:
    44px 44px, 56px 56px, 38px 38px, 52px 52px, 34px 34px, 48px 48px, 62px 62px,
    100% 100%;
  background-position:
    6px 10px, 24px 22px, 14px 36px, 38px 8px, 50px 28px, 20px 50px, 8px 44px,
    0 0;
  animation: confettiReveal .65s var(--ease-out) .1s both;
}

@keyframes confettiReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Mingo celebration badge — ::before as centered block */
.coach-complete::before {
  content: "";
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: url('uploads/BI_2.png') center 22% / 82% no-repeat, var(--brand);
  box-shadow: 0 8px 28px rgba(247,80,110,.40);
  margin: 0 auto 18px;
  position: relative;
  z-index: 2;
  animation: mingoCelebrate .8s var(--ease-out) .15s both;
}

/* Subtle shimmer ring around badge */
.coach-complete::after {
  content: "";
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247,80,110,.22) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  animation: badgeGlow 1.8s ease-in-out .8s infinite alternate;
}

@keyframes mingoCelebrate {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.14) rotate(5deg);  opacity: 1; }
  80%  { transform: scale(.97) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes badgeGlow {
  from { opacity: .5; transform: translateX(-50%) scale(.9); }
  to   { opacity: 1;  transform: translateX(-50%) scale(1.1); }
}

/* Keep text content above confetti bg and pseudo-elements */
.coach-complete > * { position: relative; z-index: 3; }

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .mingo-loading-face {
    animation: none !important;
  }

  /* Freeze confetti in-place at end state */
  .coach-complete {
    animation: none !important;
    opacity: 1 !important;
  }
  .coach-complete::before {
    animation: none !important;
    transform: scale(1) !important;
    opacity: 1 !important;
  }
  .coach-complete::after {
    animation: none !important;
    opacity: .6 !important;
  }

  .mingo-loading-dots span { animation: none !important; opacity: .6 !important; }
  .typing-indicator span   { animation: none !important; opacity: .6 !important; }

  /* flatten ambient animations */
  .kmingo-prompt { animation: none !important;
    box-shadow: var(--shadow-sm) !important; }
}

/* Generate Recipe — pink */

/* Recommend Recipe — pink accent (consistent with brand) */

/* Ask K-Food — pink accent (consistent with brand) */

/* Eyebrow gets a fun pill background */

/* Filter chips — pop on active */
.filter-chip.active { transform: scale(1.03); }

/* Starter prompt chips — subtle lift on hover */
.mode-chip-grid button { transition: transform .12s cubic-bezier(.4,0,.2,1), background .14s; }
.mode-chip-grid button:hover { transform: translateY(-1px) scale(1.03); }

/* Recommendation cards — left accent on hover */
.recommendation-card { border-left: 3px solid var(--line, #e7e1db); }
.recommendation-card:hover { border-left-color: #f7506e; }

/* Send button — fun rotate on hover */

/* Style any message that has only a typing indicator inside */
.message.assistant:has(.typing-indicator) {
  background: var(--warm);
  padding: 10px 14px;
}

/* Per-step video timestamp links (YouTube-generated recipes) */
.steps .step-ts {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(247, 104, 122, 0.12);
  color: #c23b2b;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.steps .step-ts:hover {
  background: rgba(247, 104, 122, 0.24);
}

/* Unified customer navigation follows the existing warm, photo-led shell. */
.app-shell { grid-template-rows: auto auto minmax(0, 1fr); }
.customer-nav { display: flex; justify-content: center; gap: clamp(4px, 2vw, 28px); padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.customer-nav a { display: grid; place-items: center; min-height: 44px; padding: 4px 10px; color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; border-bottom: 2px solid transparent; }
.customer-nav a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.customer-nav a:hover { color: var(--brand); }
.guest-data-note { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 767px) { .customer-nav { gap: 0; justify-content: space-between; } .customer-nav a { padding-inline: 7px; } }
