:root {
  --bg-parchment: #fbf4e6;
  --bg-card: #fffaf0;
  --bg-soft: #fdf7eb;
  --ink: #4a3022;
  --ink-soft: #7b5a46;
  --crust: #d99b66;
  --crust-deep: #b56f36;
  --gingham-red: #d96b5b;
  --gingham-red-hover: #c55b4b;
  --sage: #6fa964;
  --blush: #f29b91;
  --frost-tint: #dff1f7;
  --cream-btn: #f6ead4;
  --cream-btn-hover: #efe0c2;
  --shadow-warm: rgba(74, 48, 34, 0.12);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background-color: var(--bg-parchment);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.8) 0%, transparent 45%),
    radial-gradient(circle at 82% 88%, rgba(235, 205, 165, 0.32) 0%, transparent 50%);
  display: flex;
  justify-content: center;
  padding: 1rem 0.85rem 2.25rem;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 32px;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow:
    0 10px 0 rgba(74, 48, 34, 0.08),
    0 24px 48px var(--shadow-warm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-self: flex-start;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.name-row h1 {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.icon-pill-btn {
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--cream-btn);
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  min-block-size: 30px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.icon-pill-btn:hover {
  background: var(--cream-btn-hover);
}

.day-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

:where(button) {
  -webkit-tap-highlight-color: transparent;
}

:where(button, input, select, summary):focus-visible {
  outline: 3px solid var(--gingham-red);
  outline-offset: 3px;
}

/* Tab Navigation */
.tab-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  background: var(--bg-soft);
  border: 2px solid rgba(74, 48, 34, 0.18);
  border-radius: 18px;
  padding: 0.3rem;
}

.tab-btn {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border: 2px solid transparent;
  border-radius: 13px;
  padding: 0.5rem 0.4rem;
  min-block-size: 40px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tab-btn:hover {
  color: var(--ink);
  background: rgba(246, 234, 212, 0.65);
}

.tab-btn[aria-selected="true"] {
  color: var(--ink);
  background: #f5d6a7;
  border-color: var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Active Bake Timer Banner (visible across tabs when a timer is running) */
.active-timer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: #fff2d9;
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 0.6rem 0.85rem;
  box-shadow: 0 3px 0 rgba(74, 48, 34, 0.1);
}

.active-timer-banner[hidden] {
  display: none;
}

.timer-banner-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.timer-banner-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.timer-banner-clock {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gingham-red);
  font-variant-numeric: tabular-nums;
}

/* Character Stage */
.stage-wrap {
  position: relative;
  background: linear-gradient(180deg, #fdf7eb 0%, #f6ebd6 100%);
  border: 2px solid rgba(74, 48, 34, 0.18);
  border-radius: 24px;
  padding: 0.85rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: background-color 0.45s ease;
}

.stage-wrap[data-mood="fridge"] {
  background: linear-gradient(180deg, #eef8fc 0%, #dfeef5 100%);
}

.speech-bubble {
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 0.4rem 0.85rem;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(74, 48, 34, 0.08);
  margin-bottom: 0.25rem;
  text-align: center;
  max-width: 92%;
}

.jar-button {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
  width: 245px;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  scale: 1;
  rotate: 0deg;
  transition: scale 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.jar-button:hover {
  scale: 1.02;
}

.jar-button:active {
  scale: 0.97;
}

.pet-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.status-pill {
  margin-top: 0.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 3px 0 rgba(74, 48, 34, 0.1);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage);
  border: 1.5px solid var(--ink);
}

.stage-wrap[data-mood="hungry"] .status-dot { background: #e89b48; }
.stage-wrap[data-mood="fed"] .status-dot { background: #e87a90; }
.stage-wrap[data-mood="fridge"] .status-dot { background: #6fb2d2; }

.tap-hint {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

/* Vitals Grid */
.vitals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.vital-card {
  background: var(--bg-soft);
  border: 2px solid rgba(74, 48, 34, 0.18);
  border-radius: 16px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.vital-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.vital-value {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.vital-bar-track {
  height: 8px;
  background: #efe3ce;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.15rem;
}

.vital-bar-fill {
  height: 100%;
  background: var(--sage);
  width: 60%;
  transition: width 0.35s ease, background-color 0.35s ease;
}

/* Action Buttons */
.action-row {
  display: flex;
  gap: 0.55rem;
}

.action-btn {
  flex: 1;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: #fffdf8;
  background: var(--gingham-red);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 0.68rem 0.85rem;
  min-block-size: 46px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  translate: 0 0;
  transition: background-color 0.15s ease, translate 0.1s ease, box-shadow 0.1s ease;
}

.action-btn:hover {
  background: var(--gingham-red-hover);
}

.action-btn:active {
  translate: 0 3px;
  box-shadow: 0 1px 0 var(--ink);
}

.action-btn.secondary {
  background: var(--crust);
  color: var(--ink);
}

.action-btn.secondary:hover {
  background: #cd8e58;
}

.action-btn.cream {
  background: var(--cream-btn);
  color: var(--ink);
}

.action-btn.cream:hover {
  background: var(--cream-btn-hover);
}

.action-btn.small {
  flex: none;
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  min-block-size: 36px;
  box-shadow: 0 2px 0 var(--ink);
}

.reminder-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: var(--bg-soft);
  border: 2px solid rgba(74, 48, 34, 0.16);
  border-radius: 16px;
  padding: 0.6rem 0.85rem;
  font-size: 0.83rem;
}

.reminder-actions {
  display: flex;
  gap: 0.4rem;
}

/* Preview Mood Drawer (collapsible so Tamagotchi stays clean!) */
.preview-details {
  background: var(--bg-soft);
  border: 2px solid rgba(74, 48, 34, 0.16);
  border-radius: 16px;
  padding: 0.65rem 0.85rem;
}

.preview-details summary {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-details summary::after {
  content: "+";
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.1rem;
  color: var(--ink);
}

.preview-details[open] summary::after {
  content: "−";
}

.preview-body {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.mood-btn {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--cream-btn);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
  min-block-size: 38px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ink);
  translate: 0 0;
  transition: background-color 0.15s ease, translate 0.1s ease, box-shadow 0.1s ease;
}

.mood-btn:hover {
  background: var(--cream-btn-hover);
}

.mood-btn[aria-pressed="true"] {
  background: #f5d6a7;
  translate: 0 2px;
  box-shadow: 0 0 0 var(--ink);
}

/* Cards for Care & Bake tabs */
.info-card {
  background: var(--bg-soft);
  border: 2px solid rgba(74, 48, 34, 0.18);
  border-radius: 20px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.info-card h2 {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0;
}

.info-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.48;
  color: var(--ink-soft);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Checklist / Guide items */
.guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.guide-item {
  background: var(--bg-card);
  border: 1.8px solid rgba(74, 48, 34, 0.2);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.guide-item.is-done {
  background: #f3f7ee;
  border-color: rgba(111, 169, 100, 0.55);
}

.guide-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  flex: 1;
}

.check-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--sage);
  margin-top: 1px;
  flex-shrink: 0;
  cursor: pointer;
}

.guide-item.is-done .check-title {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.guide-desc {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-soft);
  padding-left: 1.75rem;
}

.guide-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding-left: 1.75rem;
  margin-top: 0.2rem;
}

.fold-tracker {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.fold-chip {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--cream-btn);
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  min-block-size: 32px;
  cursor: pointer;
}

.fold-chip[aria-pressed="true"] {
  background: #c8e5be;
}

/* Ratio Table */
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.ratio-pill {
  background: var(--bg-card);
  border: 1.8px solid rgba(74, 48, 34, 0.22);
  border-radius: 14px;
  padding: 0.55rem 0.5rem;
  text-align: center;
}

.ratio-pill strong {
  display: block;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1rem;
  color: var(--ink);
}

.ratio-pill span {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-soft);
  margin-top: 0.1rem;
}

/* Feeding Log */
.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.log-entry {
  background: var(--bg-card);
  border: 1.5px solid rgba(74, 48, 34, 0.16);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.log-entry-main {
  font-weight: 700;
  color: var(--ink);
}

.log-entry-sub {
  font-size: 0.76rem;
  color: var(--ink-soft);
}

/* Ingredients List */
.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.ingredient-box {
  background: var(--bg-card);
  border: 1.8px solid rgba(74, 48, 34, 0.18);
  border-radius: 13px;
  padding: 0.55rem 0.7rem;
}

.ingredient-box strong {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1rem;
  display: block;
}

.ingredient-box span {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.segmented {
  display: inline-flex;
  background: var(--cream-btn);
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  padding: 2px;
}

.segmented button {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.78rem;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: #fffdf8;
}

/* Native <dialog> Modals */
dialog.storybook-dialog {
  width: min(420px, calc(100% - 2rem));
  background: var(--bg-card);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 26px;
  padding: 1.35rem;
  box-shadow: 0 20px 50px rgba(74, 48, 34, 0.28);
}

dialog.storybook-dialog::backdrop {
  background: rgba(74, 48, 34, 0.42);
  backdrop-filter: blur(2px);
}

dialog.storybook-dialog h2 {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.3rem;
  margin: 0 0 0.35rem;
}

.dialog-subtitle {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.ratio-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ratio-choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-soft);
  border: 2px solid rgba(74, 48, 34, 0.22);
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
}

.ratio-choice:has(input:checked) {
  background: #f5d6a7;
  border-color: var(--ink);
}

.ratio-choice input {
  accent-color: var(--gingham-red);
  width: 18px;
  height: 18px;
}

.ratio-choice-text strong {
  display: block;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.96rem;
}

.ratio-choice-text span {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 700;
}

.field-group input[type="text"],
.field-group input[type="date"],
.field-group input[type="datetime-local"],
.field-group select {
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  width: 100%;
}

.dialog-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* Bake Scheduler */
.scheduler-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.scheduler-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.schedule-summary {
  background: #fff4df;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.schedule-summary[hidden] {
  display: none;
}

.schedule-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.schedule-next-pill {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.step-time-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--crust-deep);
  background: #fff3de;
  border: 1.5px solid rgba(181, 111, 54, 0.45);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.sub-schedule-list {
  margin: 0.3rem 0 0;
  padding-left: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Photo Check-In Dialog & Log Thumbnails */
.photo-preview-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  border: 2px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  display: grid;
  place-items: center;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-status-box {
  background: #fff4df;
  border: 1.8px solid rgba(74, 48, 34, 0.25);
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 0.85rem;
}

.photo-sync-controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.photo-rise-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.photo-sync-controls input[type="range"] {
  width: 100%;
  accent-color: var(--gingham-red);
}

.log-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.8px solid var(--ink);
  flex-shrink: 0;
}

.log-entry-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Connect Gemini / Claude AI Onboarding Card */
.ai-connect-card {
  background: var(--bg-soft);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.ai-connect-card[hidden] {
  display: none;
}

.ai-connect-card.is-connected {
  border-color: var(--sage);
  background: #f3f7ee;
}

.ai-connect-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.ai-connect-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ai-connect-title-row h2 {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0;
}

.conn-pill {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
  border: 1.5px solid var(--ink);
}

.conn-pill.waiting {
  background: #fff1cf;
  color: var(--ink);
}

.conn-pill.connected {
  background: #d4eccb;
  color: #25501e;
  border-color: #4f8546;
}

.mcp-url-box {
  background: var(--bg-card);
  border: 1.8px solid rgba(74, 48, 34, 0.22);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mcp-url-box span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.mcp-url-box code {
  font-size: 0.8rem;
  word-break: break-all;
  user-select: all;
  color: var(--ink);
}

.ai-connect-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ai-connect-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ai-connect-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-steps-box {
  background: var(--bg-card);
  border: 1.8px solid rgba(74, 48, 34, 0.18);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.ai-steps-box strong {
  color: var(--ink);
}

.ai-steps-box ol {
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.starter-prompt-row {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1.5px dashed rgba(74, 48, 34, 0.2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.starter-prompt-row em {
  font-size: 0.82rem;
  color: var(--ink);
  flex: 1;
  min-width: 180px;
}

/* ============================================================
   SVG CHARACTER ANIMATIONS (Layered Cutout + Hand-Drawn Feel)
   ============================================================ */

.dough-rig {
  transform-box: fill-box;
  transform-origin: center bottom;
  translate: 0 0;
  scale: 1 1;
  rotate: 0deg;
}

.peak-rise-mover {
  translate: 0 0;
  transition: translate 0.35s ease-out;
}

.poke-squish {
  transform-box: fill-box;
  transform-origin: center bottom;
  scale: 1 1;
  rotate: 0deg;
}

.arm-left, .arm-right {
  transform-box: fill-box;
  rotate: 0deg;
}
.arm-left { transform-origin: right center; }
.arm-right { transform-origin: left center; }

.eyes-blink {
  transform-box: fill-box;
  transform-origin: center;
  scale: 1 1;
}

.beanie-group {
  transform-box: fill-box;
  transform-origin: center bottom;
  translate: 0 0;
  rotate: 0deg;
}

.particle {
  opacity: 0;
  translate: 0 0;
  scale: 1;
}

.mood-layer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

[data-mood="peak"] .mood-peak,
[data-mood="hungry"] .mood-hungry,
[data-mood="fed"] .mood-fed,
[data-mood="fridge"] .mood-fridge {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .stage-wrap:not([data-paused="true"])[data-mood="peak"] .dough-rig {
    animation: breathe-happy 2.6s ease-in-out infinite;
  }

  .stage-wrap:not([data-paused="true"])[data-mood="peak"] .arm-left {
    animation: wave-left 1.8s ease-in-out infinite;
  }

  .stage-wrap:not([data-paused="true"])[data-mood="peak"] .arm-right {
    animation: wave-right 1.8s ease-in-out infinite;
  }

  .stage-wrap:not([data-paused="true"])[data-mood="hungry"] .dough-rig {
    animation: shiver-hungry 3.2s ease-in-out infinite;
  }

  .stage-wrap:not([data-paused="true"])[data-mood="fed"] .dough-rig {
    animation: munch-bounce 1.2s ease-in-out infinite;
  }

  .stage-wrap:not([data-paused="true"])[data-mood="fridge"] .dough-rig {
    animation: breathe-sleepy 3.8s ease-in-out infinite;
  }

  .stage-wrap:not([data-paused="true"]) .eyes-blink {
    animation: blink 4.4s ease-in-out infinite;
  }

  .stage-wrap:not([data-paused="true"])[data-mood="peak"] .bubble-1 {
    animation: float-bubble 2.8s ease-in-out infinite;
  }
  .stage-wrap:not([data-paused="true"])[data-mood="peak"] .bubble-2 {
    animation: float-bubble 3.2s ease-in-out 0.9s infinite;
  }
  .stage-wrap:not([data-paused="true"])[data-mood="peak"] .bubble-3 {
    animation: float-bubble 2.5s ease-in-out 1.6s infinite;
  }

  .stage-wrap:not([data-paused="true"])[data-mood="fed"] .sparkle-1 {
    animation: twinkle 1.8s ease-in-out infinite;
  }
  .stage-wrap:not([data-paused="true"])[data-mood="fed"] .sparkle-2 {
    animation: twinkle 2.1s ease-in-out 0.6s infinite;
  }
  .stage-wrap:not([data-paused="true"])[data-mood="fed"] .sparkle-3 {
    animation: twinkle 1.6s ease-in-out 1.1s infinite;
  }

  .stage-wrap:not([data-paused="true"])[data-mood="fridge"] .zzz-1 {
    animation: float-zzz 3.2s ease-out infinite;
  }
  .stage-wrap:not([data-paused="true"])[data-mood="fridge"] .zzz-2 {
    animation: float-zzz 3.2s ease-out 1.1s infinite;
  }
  .stage-wrap:not([data-paused="true"])[data-mood="fridge"] .zzz-3 {
    animation: float-zzz 3.2s ease-out 2.2s infinite;
  }

  .stage-wrap:not([data-paused="true"]) .poke-squish.is-poked {
    animation: squish-giggle 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .stage-wrap:not([data-paused="true"]) .flour-burst.is-active .flour-speck {
    animation: flour-fall 0.95s ease-out forwards;
  }
  .stage-wrap:not([data-paused="true"]) .flour-burst.is-active .flour-speck:nth-child(2) { animation-delay: 0.06s; }
  .stage-wrap:not([data-paused="true"]) .flour-burst.is-active .flour-speck:nth-child(3) { animation-delay: 0.12s; }
  .stage-wrap:not([data-paused="true"]) .flour-burst.is-active .flour-speck:nth-child(4) { animation-delay: 0.04s; }
  .stage-wrap:not([data-paused="true"]) .flour-burst.is-active .flour-speck:nth-child(5) { animation-delay: 0.1s; }
  .stage-wrap:not([data-paused="true"]) .flour-burst.is-active .flour-speck:nth-child(6) { animation-delay: 0.15s; }

  .stage-wrap:not([data-paused="true"]) .heart-burst.is-active .heart-pop {
    animation: heart-rise 0.85s ease-out forwards;
  }
  .stage-wrap:not([data-paused="true"]) .heart-burst.is-active .heart-pop:nth-child(2) { animation-delay: 0.1s; }
}

@keyframes breathe-happy {
  0%, 100% { scale: 1 1; }
  50% { scale: 1.035 0.97; }
}

@keyframes wave-left {
  0%, 100% { rotate: 0deg; }
  50% { rotate: -14deg; }
}

@keyframes wave-right {
  0%, 100% { rotate: 0deg; }
  50% { rotate: 14deg; }
}

@keyframes shiver-hungry {
  0%, 72%, 100% { translate: 0 0; scale: 1 1; }
  76% { translate: -2px 0; scale: 1.02 0.98; }
  80% { translate: 2px 0; scale: 0.99 1.01; }
  84% { translate: -1.5px 0; }
  88% { translate: 1.5px 0; }
  92% { translate: 0 0; }
}

@keyframes munch-bounce {
  0%, 100% { scale: 1 1; }
  35% { scale: 1.05 0.95; }
  65% { scale: 0.98 1.03; }
}

@keyframes breathe-sleepy {
  0%, 100% { scale: 1 1; }
  50% { scale: 1.045 0.96; }
}

@keyframes blink {
  0%, 44%, 48%, 100% { scale: 1 1; }
  46% { scale: 1 0.12; }
}

@keyframes float-bubble {
  0% { opacity: 0; translate: 0 8px; scale: 0.7; }
  25% { opacity: 0.95; }
  80% { opacity: 0.85; }
  100% { opacity: 0; translate: 0 -26px; scale: 1.08; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; scale: 0.7; rotate: 0deg; }
  50% { opacity: 1; scale: 1.12; rotate: 18deg; }
}

@keyframes float-zzz {
  0% { opacity: 0; translate: 0 6px; scale: 0.75; }
  25% { opacity: 0.9; }
  85% { opacity: 0.7; }
  100% { opacity: 0; translate: 14px -26px; scale: 1.1; }
}

@keyframes squish-giggle {
  0% { scale: 1 1; rotate: 0deg; }
  22% { scale: 1.14 0.84; rotate: -3deg; }
  50% { scale: 0.92 1.09; rotate: 3deg; }
  75% { scale: 1.04 0.97; rotate: -1.5deg; }
  100% { scale: 1 1; rotate: 0deg; }
}

@keyframes flour-fall {
  0% { opacity: 0; translate: 0 -36px; scale: 0.7; }
  20% { opacity: 1; }
  100% { opacity: 0; translate: 0 42px; scale: 1.1; }
}

@keyframes heart-rise {
  0% { opacity: 0; translate: 0 6px; scale: 0.6; }
  25% { opacity: 1; scale: 1.1; }
  100% { opacity: 0; translate: 0 -38px; scale: 0.95; }
}
