/* ==========================================================================
   Dapur Pintar — sistem desain
   --------------------------------------------------------------------------
   Satu berkas, tanpa build pipeline (PRD §9.1: "tanpa build pipeline SPA
   terpisah"). Urutan: token → reset → tipografi → layout → komponen → gerak.

   Prinsip gerak: animasi menjelaskan perubahan (apa yang muncul, dari mana,
   ke mana), tidak menghibur. Semuanya di bawah 420 ms dan tunduk pada
   `prefers-reduced-motion`.
   ========================================================================== */

/* --- 1. Font ------------------------------------------------------------ */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin.7660bd9909fb.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext.341687eeeb6a.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* --- 2. Token ----------------------------------------------------------- */
:root {
  /* Warna merek: hijau herba (segar) + kunyit (hangat) + cabai (peringatan) */
  --herb-50: #edf7f1;
  --herb-100: #d3ecdd;
  --herb-200: #a7d9bd;
  --herb-300: #6fc096;
  --herb-400: #3da273;
  --herb-500: #1d8557;
  --herb-600: #146a45;
  --herb-700: #105538;
  --herb-800: #0d422c;

  --turmeric-100: #fdf0d2;
  --turmeric-200: #fadfa4;
  --turmeric-300: #f5c45f;
  --turmeric-400: #e5a021;
  --turmeric-500: #c47f0a;
  --turmeric-600: #9a6207;

  --chili-100: #fde5e2;
  --chili-200: #f9c2bc;
  --chili-300: #f08a80;
  --chili-400: #e0574a;
  --chili-500: #c53a2d;
  --chili-600: #9c2c21;

  --clove-100: #ece7f7;
  --clove-300: #b6a3e0;
  --clove-500: #7758c2;

  --ink-900: #14201a;
  --ink-700: #2f3d36;
  --ink-500: #5b6b62;
  --ink-400: #7d8c83;
  --ink-300: #a6b2aa;

  /* Permukaan (mode terang) */
  --bg: #f7f4ee;
  --bg-tint: radial-gradient(
      120% 90% at 10% -10%,
      rgba(29, 133, 87, 0.1) 0%,
      transparent 55%
    ),
    radial-gradient(90% 70% at 100% 0%, rgba(229, 160, 33, 0.12) 0%, transparent 50%);
  --surface: #ffffff;
  --surface-2: #fbf9f5;
  --surface-sunken: #f0ece4;
  --border: #e5e0d6;
  --border-strong: #d5cec1;

  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --text-faint: var(--ink-400);

  --primary: var(--herb-600);
  --primary-hover: var(--herb-700);
  --primary-soft: var(--herb-50);
  --primary-ring: rgba(20, 106, 69, 0.28);
  --on-primary: #ffffff;

  --accent: var(--turmeric-500);
  --accent-soft: var(--turmeric-100);
  --danger: var(--chili-500);
  --danger-soft: var(--chili-100);

  /* Radius & bayangan */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-full: 999px;

  --shadow-xs: 0 1px 2px rgba(20, 32, 26, 0.06);
  --shadow-sm: 0 2px 8px -2px rgba(20, 32, 26, 0.1),
    0 1px 2px rgba(20, 32, 26, 0.05);
  --shadow-md: 0 10px 24px -12px rgba(20, 32, 26, 0.22),
    0 2px 6px -2px rgba(20, 32, 26, 0.08);
  --shadow-lg: 0 26px 50px -22px rgba(20, 32, 26, 0.34),
    0 6px 14px -8px rgba(20, 32, 26, 0.12);
  --shadow-glow: 0 12px 30px -14px rgba(20, 106, 69, 0.5);

  /* Gerak */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 380ms;

  /* Ukuran */
  --nav-h: 68px;
  --rail-w: 252px;
  --tap: 44px; /* target ketuk minimal, PRD §10 */
  --page-max: 1240px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #10151a;
  --bg-tint: radial-gradient(
      120% 90% at 10% -10%,
      rgba(61, 162, 115, 0.16) 0%,
      transparent 55%
    ),
    radial-gradient(90% 70% at 100% 0%, rgba(229, 160, 33, 0.1) 0%, transparent 50%);
  --surface: #1a2128;
  --surface-2: #202932;
  --surface-sunken: #151b21;
  --border: #2c3742;
  --border-strong: #3b4855;

  --text: #eef3f0;
  --text-muted: #9dada4;
  --text-faint: #7b8a82;

  --primary: var(--herb-300);
  --primary-hover: var(--herb-200);
  --primary-soft: rgba(61, 162, 115, 0.16);
  --primary-ring: rgba(111, 192, 150, 0.32);
  --on-primary: #08150f;

  --accent: var(--turmeric-300);
  --accent-soft: rgba(229, 160, 33, 0.16);
  --danger: var(--chili-300);
  --danger-soft: rgba(224, 87, 74, 0.18);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 28px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 28px 56px -24px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 12px 32px -16px rgba(61, 162, 115, 0.55);

  color-scheme: dark;
}

/* --- 3. Reset ----------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-tint);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out);
}
img,
svg {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
  padding: 0;
}
:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
::selection {
  background: var(--primary-soft);
  color: var(--primary-hover);
}
[hidden] {
  display: none !important;
}
[x-cloak] {
  display: none !important;
}

/* --- 4. Tipografi ------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.t-display {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.t-h1 {
  font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.t-h2 {
  font-size: clamp(1.12rem, 1rem + 0.5vw, 1.35rem);
  font-weight: 700;
}
.t-h3 {
  font-size: 1rem;
  font-weight: 700;
}
.t-body {
  font-size: 0.95rem;
}
.t-sm {
  font-size: 0.86rem;
}
.t-xs {
  font-size: 0.775rem;
}
.t-muted {
  color: var(--text-muted);
}
.t-faint {
  color: var(--text-faint);
}
.t-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.t-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.t-center {
  text-align: center;
}
.t-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- 5. Utilitas tata letak -------------------------------------------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap, 12px);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--gap, 10px);
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.grid {
  display: grid;
  gap: var(--gap, 14px);
}
.grid > * {
  min-width: 0;
}
.grid-cards {
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- 6. Cangkang aplikasi ---------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100dvh;
}
/* Grid item punya `min-width: auto`, sehingga kolom konten ikut melebar
   mengikuti isi terlebar (mis. strip yang bisa digulir). Tanpa ini seluruh
   halaman menggeser ke samping di layar desktop. */
.app > * {
  min-width: 0;
}
.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 18px 16px calc(var(--nav-h) + 32px);
}

@media (min-width: 900px) {
  .app {
    grid-template-columns: var(--rail-w) 1fr;
  }
  .page {
    padding: 28px 32px 56px;
  }
}

/* Rail navigasi desktop */
.rail {
  display: none;
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px);
  flex-direction: column;
  gap: 6px;
}
@media (min-width: 900px) {
  .rail {
    display: flex;
  }
}
.rail__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 20px;
}
.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 21px;
  background: linear-gradient(145deg, var(--herb-400), var(--herb-700));
  box-shadow: var(--shadow-glow);
  flex: none;
}
.brand__name {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.06rem;
  line-height: 1.15;
}
.brand__tag {
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.rail__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  position: relative;
  transition: background var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.rail__link:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateX(2px);
}
.rail__link.is-active {
  background: var(--primary-soft);
  color: var(--primary-hover);
}
.rail__link.is-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  translate: 0 -50%;
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
  animation: slide-in-left var(--t-base) var(--ease-spring);
}
.rail__icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex: none;
}
.rail__foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Navigasi bawah (mobile) — semua alur utama dalam jangkauan satu tangan */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1px solid var(--border);
}
@media (min-width: 900px) {
  .tabbar {
    display: none;
  }
}
.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tap);
  color: var(--text-faint);
  font-size: 0.66rem;
  font-weight: 600;
  position: relative;
  transition: color var(--t-fast) var(--ease-out);
}
.tabbar__item span:first-child {
  font-size: 1.28rem;
  line-height: 1;
  transition: transform var(--t-base) var(--ease-spring);
}
.tabbar__item:active span:first-child {
  transform: scale(0.86);
}
.tabbar__item.is-active {
  color: var(--primary);
}
.tabbar__item.is-active span:first-child {
  transform: translateY(-2px) scale(1.08);
}
.tabbar__item.is-active::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 26px;
  height: 26px;
  border-radius: var(--r-full);
  background: var(--primary-soft);
  z-index: -1;
  animation: pop-in var(--t-base) var(--ease-spring);
}

/* Header halaman */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base) var(--ease-out);
}
.topbar.is-stuck {
  border-bottom-color: var(--border);
}
@media (min-width: 900px) {
  .topbar {
    display: none;
  }
}

/* --- 7. Kartu & permukaan ---------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.card--flat {
  box-shadow: none;
  background: var(--surface-2);
}
.card--pad-sm {
  padding: 14px;
}
.card--interactive {
  cursor: pointer;
}
.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card--interactive:active {
  transform: translateY(-1px) scale(0.995);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.panel__body {
  padding: 16px 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 12px;
}

/* Hero sapaan di beranda */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--herb-700) 0%, var(--herb-500) 55%, #2a9e6b 100%);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  filter: blur(2px);
}
.hero::before {
  width: 260px;
  height: 260px;
  right: -70px;
  top: -110px;
  background: radial-gradient(circle, rgba(245, 196, 95, 0.42), transparent 68%);
  animation: drift 16s var(--ease-in-out) infinite alternate;
}
.hero::after {
  width: 220px;
  height: 220px;
  left: -60px;
  bottom: -130px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 66%);
  animation: drift 20s var(--ease-in-out) infinite alternate-reverse;
}
.hero__title {
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero__sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  max-width: 46ch;
}
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.hero__stat {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-full);
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: background var(--t-fast) var(--ease-out);
}
.hero__stat:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* --- 8. Tombol ---------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--r-full);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  font-size: 0.9rem;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease-spring),
    box-shadow var(--t-base) var(--ease-out), background var(--t-fast) var(--ease-out),
    filter var(--t-fast) var(--ease-out);
}
.btn:hover {
  filter: brightness(0.97);
  box-shadow: var(--shadow-sm);
}
.btn:active {
  transform: scale(0.96);
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.btn--primary {
  --btn-bg: linear-gradient(140deg, var(--herb-500), var(--herb-700));
  --btn-fg: #fff;
  --btn-bd: transparent;
  box-shadow: var(--shadow-glow);
}
[data-theme="dark"] .btn--primary {
  --btn-bg: linear-gradient(140deg, var(--herb-300), var(--herb-500));
  --btn-fg: #08150f;
}
.btn--accent {
  --btn-bg: linear-gradient(140deg, var(--turmeric-300), var(--turmeric-500));
  --btn-fg: #40260a;
  --btn-bd: transparent;
}
.btn--danger {
  --btn-bg: var(--danger-soft);
  --btn-fg: var(--danger);
  --btn-bd: transparent;
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-bd: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover {
  --btn-bg: var(--surface-2);
  color: var(--text);
}
.btn--soft {
  --btn-bg: var(--primary-soft);
  --btn-fg: var(--primary-hover);
  --btn-bd: transparent;
}
.btn--sm {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.83rem;
}
.btn--block {
  width: 100%;
}
.btn--icon {
  padding: 0;
  width: var(--tap);
  min-height: var(--tap);
  flex: none;
}
.btn--icon.btn--sm {
  width: 36px;
  min-height: 36px;
}

/* Riak sentuh — umpan balik taktil tanpa JS */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, currentColor 12%, transparent 12.5%);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}
.btn:active::after {
  animation: ripple 480ms var(--ease-out);
}

/* Tombol aksi mengambang (mobile) */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  z-index: 55;
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  color: #fff;
  background: linear-gradient(140deg, var(--herb-500), var(--herb-700));
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: pop-in var(--t-slow) var(--ease-spring) backwards 220ms;
  transition: transform var(--t-base) var(--ease-spring);
}
.fab:hover {
  transform: scale(1.07) rotate(90deg);
}
.fab:active {
  transform: scale(0.92);
}
@media (min-width: 900px) {
  .fab {
    bottom: 28px;
    right: 28px;
  }
}

/* --- 9. Chip, badge, pil ------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.chip--ok {
  background: var(--herb-50);
  border-color: var(--herb-200);
  color: var(--herb-700);
}
.chip--warn {
  background: var(--turmeric-100);
  border-color: var(--turmeric-200);
  color: var(--turmeric-600);
}
.chip--bad {
  background: var(--chili-100);
  border-color: var(--chili-200);
  color: var(--chili-600);
}
.chip--info {
  background: var(--clove-100);
  border-color: var(--clove-300);
  color: var(--clove-500);
}
.chip--alt {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary-hover);
}
.chip--love {
  background: var(--chili-100);
  border-color: transparent;
  color: var(--chili-500);
}
.chip--muted {
  opacity: 0.85;
}
[data-theme="dark"] .chip--ok {
  background: rgba(61, 162, 115, 0.16);
  border-color: rgba(61, 162, 115, 0.3);
  color: var(--herb-200);
}
[data-theme="dark"] .chip--warn {
  background: rgba(229, 160, 33, 0.16);
  border-color: rgba(229, 160, 33, 0.3);
  color: var(--turmeric-200);
}
[data-theme="dark"] .chip--bad,
[data-theme="dark"] .chip--love {
  background: rgba(224, 87, 74, 0.18);
  border-color: rgba(224, 87, 74, 0.32);
  color: var(--chili-200);
}
[data-theme="dark"] .chip--info {
  background: rgba(119, 88, 194, 0.2);
  border-color: rgba(182, 163, 224, 0.35);
  color: var(--clove-300);
}

.badge-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.tabbar__badge {
  position: absolute;
  top: 6px;
  left: 50%;
  translate: 4px 0;
}

/* --- 10. Kartu resep / rekomendasi ------------------------------------- */
.recipe-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.recipe-card__top {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}
.recipe-card__art {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  background: var(--surface-sunken);
  transition: transform var(--t-slow) var(--ease-spring);
}
.card--interactive:hover .recipe-card__art {
  transform: scale(1.09) rotate(-5deg);
}
.recipe-card[data-accent="herb"] .recipe-card__art {
  background: linear-gradient(145deg, var(--herb-100), var(--herb-50));
}
.recipe-card[data-accent="turmeric"] .recipe-card__art {
  background: linear-gradient(145deg, var(--turmeric-200), var(--turmeric-100));
}
.recipe-card[data-accent="chili"] .recipe-card__art {
  background: linear-gradient(145deg, var(--chili-200), var(--chili-100));
}
.recipe-card[data-accent="clove"] .recipe-card__art {
  background: linear-gradient(145deg, var(--clove-300), var(--clove-100));
}
.recipe-card__title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.015em;
}
.recipe-card__meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 2px;
}
.recipe-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.recipe-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.recipe-card__lack {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Cincin coverage — angka utama tiap kartu rekomendasi */
.ring {
  --value: 0;
  --size: 54px;
  --thick: 6px;
  --ring-color: var(--primary);
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(
    var(--ring-color) calc(var(--value) * 3.6deg),
    var(--surface-sunken) 0
  );
  animation: ring-fill var(--t-slow) var(--ease-out);
}
.ring::before {
  content: "";
  position: absolute;
  inset: var(--thick);
  border-radius: 50%;
  background: var(--surface);
}
.ring__label {
  position: relative;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.ring--ok {
  --ring-color: var(--herb-400);
}
.ring--warn {
  --ring-color: var(--turmeric-400);
}
.ring--bad {
  --ring-color: var(--chili-400);
}
.ring--lg {
  --size: 72px;
  --thick: 8px;
}
.ring--lg .ring__label {
  font-size: 1.05rem;
}

/* --- 11. Baris bahan (status tersedia/kurang/tidak ada) ----------------- */
.ing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
}
.ing-row:last-child {
  border-bottom: 0;
}
.ing-row__icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: var(--surface-sunken);
}
.ing-row__name {
  font-weight: 600;
  font-size: 0.92rem;
}
.ing-row__sub {
  font-size: 0.775rem;
  color: var(--text-faint);
}
.ing-row__status {
  margin-left: auto;
  flex: none;
  text-align: right;
}
.ing-row[data-tone="ok"] .ing-row__icon {
  background: var(--herb-50);
}
.ing-row[data-tone="warn"] .ing-row__icon {
  background: var(--turmeric-100);
}
.ing-row[data-tone="bad"] .ing-row__icon {
  background: var(--chili-100);
}
.ing-row[data-tone="muted"] {
  opacity: 0.62;
}
[data-theme="dark"] .ing-row[data-tone="ok"] .ing-row__icon {
  background: rgba(61, 162, 115, 0.18);
}
[data-theme="dark"] .ing-row[data-tone="warn"] .ing-row__icon {
  background: rgba(229, 160, 33, 0.18);
}
[data-theme="dark"] .ing-row[data-tone="bad"] .ing-row__icon {
  background: rgba(224, 87, 74, 0.2);
}

/* --- 12. Kartu stok ----------------------------------------------------- */
.stock-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.stock-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.stock-item__icon {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: var(--surface-sunken);
  position: relative;
}
.stock-item__dot {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.stock-item[data-fresh="fresh"] .stock-item__dot {
  background: var(--herb-400);
}
.stock-item[data-fresh="soon"] .stock-item__dot {
  background: var(--turmeric-400);
}
.stock-item[data-fresh="urgent"] .stock-item__dot {
  background: var(--chili-400);
  animation: pulse-dot 2s var(--ease-in-out) infinite;
}
.stock-item[data-fresh="expired"] .stock-item__dot {
  background: var(--ink-400);
}
.stock-item__bar {
  height: 4px;
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  overflow: hidden;
  margin-top: 6px;
}
.stock-item__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--herb-400), var(--herb-500));
  transform-origin: left;
  animation: bar-grow 620ms var(--ease-out) backwards;
}
.stock-item[data-fresh="urgent"] .stock-item__fill,
.stock-item[data-fresh="expired"] .stock-item__fill {
  background: linear-gradient(90deg, var(--chili-300), var(--chili-500));
}

/* Stepper cepat +/− */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-sunken);
  border-radius: var(--r-full);
  padding: 3px;
}
.stepper button {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text-muted);
  transition: background var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-spring);
}
.stepper button:hover {
  background: var(--surface);
  color: var(--text);
}
.stepper button:active {
  transform: scale(0.86);
}

/* --- 13. Form ----------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field__label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-muted);
}
.field__hint {
  font-size: 0.75rem;
  color: var(--text-faint);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}
.input::placeholder {
  color: var(--text-faint);
}
.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.input-group {
  display: flex;
  gap: 8px;
}
.input-group .input {
  flex: 1 1 auto;
}
.input-group .select {
  flex: 0 0 118px;
}

.search {
  position: relative;
}
.search .input {
  padding-left: 42px;
}
.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -50%;
  color: var(--text-faint);
  pointer-events: none;
}

/* Segmented control (filter) */
.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  background: var(--surface-sunken);
  border-radius: var(--r-full);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar {
  display: none;
}
.segmented__item {
  padding: 7px 15px;
  border-radius: var(--r-full);
  font-size: 0.83rem;
  font-weight: 650;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.segmented__item:hover {
  color: var(--text);
}
.segmented__item.is-active {
  background: var(--surface);
  color: var(--primary-hover);
  box-shadow: var(--shadow-xs);
}

/* Checkbox belanja */
.check {
  --box: 24px;
  display: inline-grid;
  place-items: center;
  width: var(--box);
  height: var(--box);
  flex: none;
  border-radius: 8px;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-spring);
}
.check:hover {
  border-color: var(--primary);
}
.check:active {
  transform: scale(0.88);
}
.check.is-checked {
  background: var(--primary);
  border-color: var(--primary);
}
.check svg {
  width: 14px;
  height: 14px;
  stroke: var(--on-primary);
  stroke-width: 3.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  opacity: 0;
}
.check.is-checked svg {
  opacity: 1;
  animation: draw-check 320ms var(--ease-out) forwards;
}

.shop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: opacity var(--t-base) var(--ease-out),
    background var(--t-base) var(--ease-out);
}
.shop-row.is-bought {
  opacity: 0.5;
  background: var(--surface-2);
}
.shop-row.is-bought .shop-row__name {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--text-faint);
}

/* --- 14. Statistik ------------------------------------------------------ */
.stat {
  padding: 15px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-base) var(--ease-out);
}
.stat:hover {
  transform: translateY(-2px);
}
.stat__value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.stat__spark {
  position: absolute;
  right: -6px;
  bottom: -8px;
  font-size: 2.6rem;
  opacity: 0.1;
  pointer-events: none;
}
.stat[data-tone="ok"] .stat__value {
  color: var(--herb-500);
}
.stat[data-tone="warn"] .stat__value {
  color: var(--turmeric-500);
}
.stat[data-tone="bad"] .stat__value {
  color: var(--danger);
}

/* --- 15. Lembar (bottom sheet / modal) --------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 18, 14, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in var(--t-base) var(--ease-out);
}
@media (min-width: 720px) {
  .sheet-backdrop {
    align-items: center;
    padding: 24px;
  }
}
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: sheet-up var(--t-slow) var(--ease-spring);
}
@media (min-width: 720px) {
  .sheet {
    border-radius: var(--r-xl);
    animation: pop-in var(--t-base) var(--ease-spring);
  }
}
.sheet__grip {
  width: 42px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--border-strong);
  margin: 6px auto 14px;
}
@media (min-width: 720px) {
  .sheet__grip {
    display: none;
  }
}
.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sheet__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 14px 0 2px;
  margin-top: 18px;
  background: linear-gradient(transparent, var(--surface) 28%);
}

/* --- 16. Toast ---------------------------------------------------------- */
.toast-stack {
  position: fixed;
  left: 50%;
  translate: -50% 0;
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100vw - 28px));
  pointer-events: none;
}
@media (min-width: 900px) {
  .toast-stack {
    bottom: 26px;
  }
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  background: var(--ink-900);
  color: #f4f8f5;
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  animation: toast-in var(--t-slow) var(--ease-spring);
}
[data-theme="dark"] .toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.toast.is-leaving {
  animation: toast-out var(--t-base) var(--ease-in-out) forwards;
}
.toast__icon {
  font-size: 1.1rem;
  flex: none;
}
.toast--ok .toast__icon {
  color: var(--herb-300);
}
.toast--bad .toast__icon {
  color: var(--chili-300);
}
.toast__action {
  margin-left: auto;
  flex: none;
  color: var(--herb-300);
  font-weight: 750;
  padding: 4px 8px;
  border-radius: var(--r-xs);
}
.toast__action:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- 16b. Tombol akun demo --------------------------------------------- */
.demo-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
  transition: transform var(--t-fast) var(--ease-spring),
    border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.demo-btn:hover {
  transform: translateX(3px);
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.demo-btn:active {
  transform: scale(0.98);
}
.demo-btn__name {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
}
.demo-btn__role {
  display: block;
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--primary);
}
.demo-btn__hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-faint);
  line-height: 1.35;
}
.demo-btn__go {
  flex: none;
  color: var(--text-faint);
  font-size: 1.05rem;
  transition: transform var(--t-base) var(--ease-spring), color var(--t-fast) var(--ease-out);
}
.demo-btn:hover .demo-btn__go {
  transform: translateX(3px);
  color: var(--primary);
}

/* --- 17. Keadaan kosong & memuat --------------------------------------- */
.empty {
  text-align: center;
  padding: 44px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.empty__art {
  font-size: 2.6rem;
  margin-bottom: 10px;
  display: inline-block;
  animation: float 4.5s var(--ease-in-out) infinite;
}
.empty__title {
  font-weight: 700;
  margin-bottom: 4px;
}
.empty__text {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 42ch;
  margin: 0 auto 16px;
}

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(
    100deg,
    var(--surface-sunken) 30%,
    var(--surface-2) 45%,
    var(--surface-sunken) 60%
  );
  background-size: 260% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* Indikator htmx */
.htmx-indicator {
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out);
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}
.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  animation: spin 720ms linear infinite;
}
.htmx-swapping {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.htmx-settling {
  animation: fade-up var(--t-base) var(--ease-out);
}

/* Bilah progres tipis di puncak halaman saat htmx bekerja */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 200;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--herb-400), var(--turmeric-300));
  opacity: 0;
  transition: transform 420ms var(--ease-out), opacity 220ms var(--ease-out);
}
.route-progress.is-loading {
  opacity: 1;
  transform: scaleX(0.72);
}
.route-progress.is-done {
  opacity: 0;
  transform: scaleX(1);
  transition: transform 180ms var(--ease-out), opacity 320ms var(--ease-out) 120ms;
}

/* --- 18. Banner ritual (rekonsiliasi, cek bumbu) ----------------------- */
.banner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.banner__icon {
  font-size: 1.4rem;
  flex: none;
}
.banner__title {
  font-weight: 700;
  font-size: 0.9rem;
}
.banner__text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- 19. Garis waktu riwayat ------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 26px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--border), transparent);
}
.timeline__item {
  position: relative;
  padding: 9px 0;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
}
.timeline__item[data-kind="IN"]::before {
  border-color: var(--herb-400);
}
.timeline__item[data-kind="OUT"]::before {
  border-color: var(--turmeric-400);
}
.timeline__item[data-kind="WASTE"]::before {
  border-color: var(--chili-400);
}

/* --- 20. Papan rencana mingguan ---------------------------------------- */
/* Tujuh hari harus terbaca sebagai satu minggu utuh. Membiarkannya membungkus
   jadi 6+1 memutus bacaan itu, jadi lebar sempit digulir ke samping. */
.week-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(148px, 1fr));
  overflow-x: auto;
  padding-bottom: 6px;
}
@media (max-width: 640px) {
  .week-grid {
    grid-template-columns: repeat(7, 78vw);
    scroll-snap-type: x mandatory;
  }
  .day-col {
    scroll-snap-align: center;
  }
}
.day-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  min-height: 150px;
  transition: border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out);
}
.day-col.is-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.day-col__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
}

/* Slot makan = zona jatuh. Perlu tinggi minimum yang benar-benar bisa
   dibidik sambil menyeret; label setinggi 17 px praktis mustahil dikenai. */
.slot {
  min-height: 62px;
  padding: 5px 6px 7px;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
  border: 1.5px dashed transparent;
  transition: border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out);
}
.slot:hover {
  border-color: var(--border-strong);
}
.slot.is-drop-target {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.slot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}
.slot__add {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--text-faint);
  background: var(--surface-sunken);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-spring);
}
.slot:hover .slot__add,
.slot__add:focus-visible {
  opacity: 1;
}
.slot__add:hover {
  background: var(--primary);
  color: var(--on-primary);
  transform: scale(1.12);
}
/* Peranti sentuh tidak punya hover — dan tidak punya drag & drop HTML5 sama
   sekali, jadi tombol ini satu-satunya jalan menambah menu di ponsel. */
@media (hover: none) {
  .slot__add {
    opacity: 1;
  }
}
.plan-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  cursor: grab;
  transition: transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out);
}
.plan-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.plan-chip.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

/* --- 20b. Kolam resep (sumber seret) ----------------------------------- */
/* Tersusun ke bawah, bukan menyamping. Dengan 100 resep, gulir mendatar
   menyembunyikan hampir seluruh katalog di luar layar — daftar vertikal
   memperlihatkan banyak judul sekaligus dan lebih mudah dipindai. */
.recipe-pool {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(52dvh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.recipe-pool__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  min-height: var(--tap);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: grab;
  transition: transform var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.recipe-pool__item:hover {
  transform: translateX(3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.recipe-pool__item.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.recipe-pool__icon {
  font-size: 1.3rem;
  flex: none;
  width: 28px;
  text-align: center;
}
.recipe-pool__name {
  font-weight: 650;
  font-size: 0.9rem;
  line-height: 1.3;
}
.recipe-pool__meta {
  font-size: 0.74rem;
  color: var(--text-faint);
}
.recipe-pool__grip {
  flex: none;
  color: var(--text-faint);
  font-size: 0.95rem;
  letter-spacing: -2px;
}
.recipe-pool__empty {
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* --- 21. Aksesori ------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 16px 0;
}
.scroll-x {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.scroll-x > * {
  scroll-snap-align: start;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--primary-soft);
  color: var(--primary-hover);
  flex: none;
}
.kbd {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  font-weight: 700;
}

/* --- 22. Animasi -------------------------------------------------------- */
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}
@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translate(-6px, -50%);
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}
@keyframes shimmer {
  to {
    background-position: -160% 0;
  }
}
@keyframes ripple {
  from {
    opacity: 0.22;
    transform: scale(0.2);
  }
  to {
    opacity: 0;
    transform: scale(2.4);
  }
}
@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
}
@keyframes ring-fill {
  from {
    background: conic-gradient(var(--ring-color) 0deg, var(--surface-sunken) 0);
  }
}
@keyframes draw-check {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(224, 87, 74, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(224, 87, 74, 0);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
@keyframes drift {
  to {
    transform: translate(-28px, 22px) scale(1.12);
  }
}
@keyframes count-up {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

/* Masuk halaman + stagger. `--i` disetel di template untuk urutan muncul. */
.enter {
  animation: fade-up var(--t-slow) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.enter-pop {
  animation: pop-in var(--t-base) var(--ease-spring) backwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.enter-fade {
  animation: fade-in var(--t-slow) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}

/* Kartu yang baru saja berubah — kilau singkat agar mata menemukannya */
.flash {
  animation: flash-bg 1.1s var(--ease-out);
}
@keyframes flash-bg {
  from {
    background-color: var(--primary-soft);
  }
}

/* --- 23. Hormati preferensi gerak -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- 24. Cetak ---------------------------------------------------------- */
@media print {
  .rail,
  .tabbar,
  .fab,
  .topbar,
  .toast-stack {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .card,
  .panel {
    box-shadow: none;
    border-color: #ccc;
  }
}
