:root {
  --bg: #eef7ef;
  --bg-soft: #d9ecd8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #173626;
  --muted: #607b69;
  --line: rgba(23, 72, 44, 0.16);
  --line-soft: rgba(23, 72, 44, 0.08);
  --accent: #2d8a53;
  --accent-2: #78b840;
  --shadow: 0 24px 48px rgba(52, 98, 68, 0.18);
  --shadow-soft: 0 10px 24px rgba(52, 98, 68, 0.12);
  --radius: 22px;
  --motion-fast: 180ms;
  --motion-base: 260ms;
  --motion-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09110d;
  --bg-soft: #0f1a14;
  --surface: rgba(21, 33, 26, 0.84);
  --surface-strong: #17261d;
  --text: #e6f3ea;
  --muted: #9eb7a8;
  --line: rgba(166, 209, 181, 0.24);
  --line-soft: rgba(166, 209, 181, 0.13);
  --accent: #5fbe7f;
  --accent-2: #97d769;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

/* ── Prevent iOS auto-zoom on form focus ── */
input,
textarea,
select {
  font-size: 16px !important;
  touch-action: manipulation;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(720px 360px at 15% -4%, rgba(66, 164, 85, 0.2), transparent 68%),
    radial-gradient(680px 420px at 100% 10%, rgba(158, 205, 103, 0.28), transparent 66%),
    linear-gradient(170deg, var(--bg), var(--bg-soft));
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background var(--motion-base) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.55;
  animation: floatOrb 11s ease-in-out infinite;
}

body::before {
  width: 280px;
  height: 280px;
  top: 10%;
  right: -120px;
  background: radial-gradient(circle at 30% 30%, rgba(160, 215, 116, 0.72), rgba(160, 215, 116, 0));
}

body::after {
  width: 260px;
  height: 260px;
  bottom: 12%;
  left: -100px;
  background: radial-gradient(circle at 40% 40%, rgba(91, 169, 100, 0.66), rgba(91, 169, 100, 0));
  animation-delay: 1.8s;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(235, 247, 233, 0.76);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 20px rgba(74, 115, 79, 0.08);
  transition: background var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease);
}

html[data-theme="dark"] .topbar {
  border-bottom-color: rgba(166, 209, 181, 0.16);
  background: rgba(12, 22, 16, 0.78);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.brand {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.brand__main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__copy {
  min-width: 0;
}

.brand__actions {
  flex: 0 0 auto;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px rgba(74, 153, 79, 0.2);
  overflow: hidden;
  animation: gentleFloat 4s ease-in-out infinite;
}

.logo-mark {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

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

.profile-menu {
  position: relative;
}

.profile-menu[open] {
  z-index: 25;
}

.profile-menu summary {
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu__trigger {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(101, 145, 108, 0.24);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(74, 115, 79, 0.12);
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease), background var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease);
}

.profile-menu__trigger:hover,
.profile-menu[open] .profile-menu__trigger {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(74, 115, 79, 0.18);
}

.profile-menu__trigger:focus-visible {
  outline: 2px solid rgba(45, 138, 83, 0.34);
  outline-offset: 3px;
}

.profile-menu__icon {
  width: 20px;
  height: 20px;
  display: block;
}

.profile-menu__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 156px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(244, 253, 242, 0.92));
  box-shadow: 0 18px 34px rgba(47, 93, 59, 0.16);
}

.profile-menu__item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #244c35;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
}

.profile-menu__item:hover,
.profile-menu__item:focus-visible,
.profile-menu__item.is-active {
  background: rgba(86, 160, 97, 0.12);
  color: #1f7a3e;
  outline: none;
}

html[data-theme="dark"] .profile-menu__trigger {
  border-color: rgba(157, 203, 173, 0.24);
  background: rgba(21, 33, 26, 0.88);
  color: #d6eadc;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .profile-menu__dropdown {
  border-color: rgba(166, 209, 181, 0.18);
  background: linear-gradient(165deg, rgba(24, 39, 30, 0.98), rgba(16, 27, 21, 0.96));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .profile-menu__item {
  color: #d6eadc;
}

html[data-theme="dark"] .profile-menu__item:hover,
html[data-theme="dark"] .profile-menu__item:focus-visible,
html[data-theme="dark"] .profile-menu__item.is-active {
  background: rgba(122, 183, 77, 0.18);
  color: #f3ffef;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 14px calc(130px + env(safe-area-inset-bottom));
}

.data-source-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(39, 99, 61, 0.2);
  background: rgba(255, 255, 255, 0.66);
  color: #1c5a3b;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(46, 99, 66, 0.1);
}

.data-source-note.is-warning {
  border-color: rgba(140, 87, 22, 0.28);
  color: #734610;
  background: rgba(255, 247, 226, 0.9);
}

.data-source-note.is-danger {
  border-color: rgba(148, 39, 39, 0.3);
  color: #7b1f1f;
  background: rgba(255, 235, 235, 0.92);
}

html[data-theme="dark"] .data-source-note {
  border-color: rgba(166, 209, 181, 0.2);
  background: rgba(20, 32, 25, 0.76);
  color: #d8eee0;
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(248, 255, 247, 0.74)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease);
}

html[data-theme="dark"] .card {
  background:
    linear-gradient(165deg, rgba(28, 42, 33, 0.95), rgba(16, 27, 21, 0.84)),
    var(--surface);
}

.reveal {
  animation: fadeUp 0.5s ease both;
}

.state-enter {
  animation: stateIn 0.38s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stateIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-panel {
  margin: 2px 0 14px;
  padding: 18px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  background:
    linear-gradient(140deg, rgba(31, 129, 66, 0.95), rgba(103, 170, 73, 0.9)),
    #2f8a53;
  color: #f6fff5;
  box-shadow: 0 20px 36px rgba(52, 108, 67, 0.28);
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -48px;
  top: -78px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
  animation: heroShine 4.2s ease-in-out infinite;
}

.hero-kicker {
  margin: 0;
  opacity: 0.9;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.hero-title {
  margin: 8px 0 8px;
  font-size: 21px;
  line-height: 1.24;
  max-width: 24ch;
}

.hero-copy {
  display: grid;
  gap: 0;
  z-index: 1;
}

.hero-desc {
  margin: 0;
  max-width: 42ch;
  font-size: 12px;
  opacity: 0.92;
  line-height: 1.45;
}

.hero-actions {
  z-index: 1;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 14px;
  color: #1e5f3c;
  text-decoration: none;
  background: #f3ffe9;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.22s ease;
}

html[data-theme="dark"] .hero-link {
  color: #d6f6df;
  background: rgba(24, 54, 34, 0.74);
  border-color: rgba(187, 227, 192, 0.34);
}

.hero-link svg {
  width: 16px;
  height: 16px;
}

.hero-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(29, 80, 49, 0.25);
}

@media (max-width: 520px) {
  .hero-panel {
    padding: 14px;
    gap: 10px;
    align-items: flex-start;
  }

  .hero-kicker {
    font-size: 11px;
  }

  .hero-title {
    margin: 6px 0 6px;
    font-size: 18px;
    line-height: 1.3;
    max-width: 21ch;
  }

  .hero-desc {
    font-size: 11.5px;
    line-height: 1.35;
    max-width: 30ch;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-link {
    padding: 9px 12px;
    font-size: 11.5px;
    width: 100%;
  }
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.section-title {
  margin: 6px 2px 8px;
  font-size: 21px;
}

.list-count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.search-wrap {
  margin: 10px 0 14px;
}

.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

html[data-theme="dark"] .search-input {
  background: rgba(17, 30, 23, 0.86);
}

.search-input::placeholder {
  color: #7a9182;
}

.search-input:focus {
  border-color: rgba(52, 138, 82, 0.46);
  box-shadow: 0 0 0 4px rgba(45, 138, 83, 0.12);
  transform: translateY(-1px);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

html[data-theme="dark"] .filter-chip {
  background: rgba(24, 39, 30, 0.86);
  border-color: rgba(166, 209, 181, 0.22);
  color: #a9c1b3;
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(52, 138, 82, 0.45);
  color: #2a6946;
}

html[data-theme="dark"] .filter-chip:hover {
  border-color: rgba(122, 192, 144, 0.48);
  color: #d5ebdc;
}

.filter-chip.is-active {
  border-color: rgba(52, 138, 82, 0.48);
  background: rgba(120, 184, 64, 0.18);
  color: #214f34;
}

html[data-theme="dark"] .filter-chip.is-active {
  border-color: rgba(122, 192, 144, 0.56);
  background: linear-gradient(145deg, rgba(64, 126, 81, 0.48), rgba(110, 166, 78, 0.42));
  color: #e5f5ea;
}

.view-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 3px;
}

html[data-theme="dark"] .view-toggle {
  border-color: rgba(166, 209, 181, 0.2);
  background: rgba(20, 34, 26, 0.9);
}

.toggle-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
}

html[data-theme="dark"] .toggle-btn {
  color: #9eb7a8;
}

.toggle-btn.is-active {
  background: linear-gradient(150deg, rgba(68, 159, 84, 0.22), rgba(120, 184, 64, 0.22));
  color: #1f5536;
}

html[data-theme="dark"] .toggle-btn.is-active {
  background: linear-gradient(150deg, rgba(77, 163, 105, 0.42), rgba(132, 189, 96, 0.38));
  color: #e4f4e9;
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.grid.list {
  grid-template-columns: 1fr;
  gap: 12px;
}

.grid.gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ramuan-card {
  align-items: stretch;
}

.ramuan-thumb {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(47, 127, 72, 0.92), rgba(138, 191, 87, 0.92)),
    #2f8a53;
  color: #f7fff5;
  border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.ramuan-thumb strong {
  font-size: 13px;
  line-height: 1.25;
}

.ramuan-thumb span {
  font-size: 11px;
  line-height: 1.25;
  opacity: 0.92;
}

.item {
  display: flex;
  gap: 14px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  padding: 9px;
  border-radius: 18px;
  transition: transform var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease), background var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease);
}

.item:hover {
  transform: translateY(-2px);
  border-color: rgba(52, 138, 82, 0.3);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .item:hover {
  background: rgba(25, 41, 31, 0.94);
}

.item:active {
  transform: translateY(0);
}

.grid.gallery .item {
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
}

.grid.gallery .thumb {
  width: 100%;
  height: 150px;
  border-radius: 15px;
}

.grid.gallery .ramuan-thumb {
  width: 100%;
  height: 150px;
  border-radius: 15px;
  justify-items: center;
  text-align: center;
}

.grid.gallery .item h4 {
  font-size: 14px;
}

.grid.gallery .meta {
  font-size: 11px;
}

.thumb {
  width: 80px;
  height: 62px;
  aspect-ratio: 4 / 3;
  border-radius: 13px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
}

.item h4 {
  margin: 0;
  font-size: 16px;
}

.item .meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.ramuan-excerpt {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.ramuan-chip-row {
  margin-top: 10px;
}

.empty {
  margin: 14px 4px 4px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.load-more-trigger {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 0 0;
}

.load-more-text {
  font-size: 13px;
  color: var(--muted);
}

.load-more-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(46, 92, 56, 0.22);
  border-top-color: rgba(52, 138, 82, 0.74);
  display: none;
  animation: spin 0.7s linear infinite;
}

.load-more-trigger.is-loading .load-more-spinner {
  display: inline-block;
}

.load-more-trigger.is-loading .load-more-text {
  color: #2f7149;
}

.load-more-trigger:not(.is-loading) .load-more-spinner {
  animation-play-state: paused;
}

.load-more-actions {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-loadmore {
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
}

.load-more-done {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.pad {
  padding: 14px 14px 18px;
}

.hero {
  width: 100%;
  height: 240px;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  display: block;
  background: #d4e6d6;
}

.h1 {
  margin: 10px 0 4px;
  font-size: 26px;
  line-height: 1.15;
}

.latin {
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
}

.divider {
  height: 1px;
  margin: 14px 0;
  background: var(--line-soft);
}

.h3 {
  margin: 12px 0 8px;
  font-size: 14px;
}

html[data-theme="dark"] .h3 {
  color: #d8ecdf;
}

.list {
  margin: 0;
}

.list li {
  margin: 7px 0;
  color: #2c5741;
}

.ramuan-steps {
  padding-left: 18px;
}

.ramuan-steps li {
  padding-left: 2px;
}

html[data-theme="dark"] .list li {
  color: #cfe4d6;
}

.desc {
  margin: 0;
  color: #2c5741;
  line-height: 1.6;
  font-size: 14px;
}

html[data-theme="dark"] .desc {
  color: #cfe4d6;
}

.desc p {
  margin: 0 0 10px;
}

.desc p:last-child {
  margin-bottom: 0;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(45, 138, 83, 0.38);
  background: rgba(45, 138, 83, 0.14);
  color: #215a39;
}

html[data-theme="dark"] .chip {
  border-color: rgba(122, 192, 144, 0.52);
  background: linear-gradient(145deg, rgba(56, 115, 73, 0.46), rgba(96, 150, 73, 0.42));
  color: #e4f4e9;
}

.chip-soft {
  border-color: var(--line-soft);
  background: rgba(120, 184, 64, 0.12);
  color: #4e745f;
}

html[data-theme="dark"] .chip-soft {
  border-color: rgba(166, 209, 181, 0.24);
  background: rgba(120, 184, 64, 0.2);
  color: #bbd6c4;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(45, 138, 83, 0.34);
  padding: 10px 12px;
  text-decoration: none;
  color: #1f5436;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(150deg, rgba(77, 170, 95, 0.3), rgba(157, 211, 109, 0.3));
  cursor: pointer;
  transition: transform var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease), background var(--motion-base) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
}

html[data-theme="dark"] .btn {
  border-color: rgba(122, 192, 144, 0.42);
  background: linear-gradient(150deg, rgba(58, 120, 76, 0.5), rgba(108, 160, 79, 0.42));
  color: #e4f4e9;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(70, 166, 95, 0.56);
  box-shadow: 0 12px 24px rgba(94, 154, 90, 0.24);
}

html[data-theme="dark"] .btn:hover {
  border-color: rgba(147, 211, 166, 0.6);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.38);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.64);
}

html[data-theme="dark"] .btn-ghost {
  border-color: rgba(166, 209, 181, 0.24);
  background: rgba(22, 38, 29, 0.84);
  color: #d3ecd9;
}

#stateError {
  padding: 18px;
}

#stateError h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

#stateError p {
  margin: 0 0 14px;
  color: var(--muted);
}

.footer {
  padding: 14px 10px calc(96px + env(safe-area-inset-bottom));
  text-align: center;
  color: #5f7f6a;
}

html[data-theme="dark"] .footer {
  color: #8da898;
}

.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
  border-radius: 24px;
  padding: 10px 12px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(241, 250, 239, 0.8)),
    rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(101, 145, 108, 0.18);
  backdrop-filter: blur(20px);
  box-shadow: 0 14px 30px rgba(64, 107, 72, 0.16);
  transition: background var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease);
}

html[data-theme="dark"] .bottom-nav {
  background:
    linear-gradient(160deg, rgba(18, 31, 24, 0.9), rgba(13, 22, 17, 0.86)),
    rgba(18, 31, 24, 0.9);
  border-color: rgba(157, 203, 173, 0.2);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.bottom-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.bottom-nav-item {
  display: flex;
  justify-content: center;
}

.bottom-nav-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: #5c7762;
  min-width: 0;
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: color var(--motion-fast) var(--motion-ease);
}

html[data-theme="dark"] .bottom-nav-link {
  color: #9db6a7;
}

.bottom-nav-label {
  white-space: nowrap;
  line-height: 1.1;
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.bottom-nav-icon-wrap {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 145, 109, 0.24);
  background: rgba(229, 244, 226, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

html[data-theme="dark"] .bottom-nav-icon-wrap {
  border-color: rgba(157, 203, 173, 0.24);
  background: rgba(25, 43, 32, 0.85);
}

.bottom-nav-link.is-active {
  color: #2f7c4d;
}

.bottom-nav-link.is-active .bottom-nav-icon-wrap {
  border-color: rgba(61, 148, 84, 0.46);
  background: linear-gradient(140deg, rgba(77, 170, 95, 0.27), rgba(157, 211, 109, 0.25));
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 16px rgba(85, 148, 84, 0.22);
}

.ai-chat {
  position: fixed;
  right: 14px;
  bottom: calc(94px + env(safe-area-inset-bottom));
  z-index: 40;
}

.ai-chat__panel {
  width: min(380px, calc(100vw - 24px));
  margin-top: 10px;
  border-radius: 24px;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(245, 253, 243, 0.88)),
    var(--surface);
  box-shadow: 0 24px 48px rgba(28, 79, 41, 0.24);
  overflow: hidden;
}

html[data-theme="dark"] .ai-chat__panel {
  background:
    linear-gradient(165deg, rgba(22, 36, 28, 0.96), rgba(13, 24, 18, 0.9)),
    var(--surface);
}

.ai-chat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.ai-chat__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.ai-chat__title-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
  background: center / contain no-repeat url("../icons/icons8-ai-stars-100.png");
}

html[data-theme="dark"] .ai-chat__title-icon {
  background-image: url("../icons/icons8-ai-stars-100-white.png");
}

.ai-chat__subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ai-chat__messages {
  display: grid;
  gap: 10px;
  max-height: min(48vh, 420px);
  overflow: auto;
  padding: 14px 16px;
}

.ai-chat__bubble {
  display: grid;
  gap: 8px;
  max-width: 92%;
  border-radius: 18px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.ai-chat__bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.ai-chat__bubble-meta {
  font-size: 11px;
  color: rgba(36, 76, 53, 0.7);
}

.ai-chat__richtext {
  display: grid;
  gap: 10px;
}

.ai-chat__richtext > * {
  margin: 0;
}

.ai-chat__richtext p {
  white-space: normal;
}

.ai-chat__richtext h1,
.ai-chat__richtext h2,
.ai-chat__richtext h3,
.ai-chat__richtext h4 {
  margin: 0;
  line-height: 1.25;
  color: inherit;
  letter-spacing: -0.02em;
}

.ai-chat__richtext h1 {
  font-size: 20px;
}

.ai-chat__richtext h2 {
  font-size: 18px;
}

.ai-chat__richtext h3 {
  font-size: 16px;
}

.ai-chat__richtext h4 {
  font-size: 14px;
}

.ai-chat__richtext strong {
  font-weight: 800;
}

.ai-chat__richtext em {
  font-style: italic;
}

.ai-chat__richtext ul,
.ai-chat__richtext ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.ai-chat__richtext li {
  padding-left: 2px;
}

.ai-chat__richtext a {
  color: inherit;
  font-weight: 700;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.ai-chat__richtext code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
  background: rgba(25, 52, 36, 0.08);
}

.ai-chat__richtext pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  overflow: auto;
  background: rgba(22, 42, 31, 0.9);
  color: #eef8f0;
}

.ai-chat__richtext pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  line-height: 1.55;
}

.ai-chat__richtext blockquote {
  margin: 0;
  padding: 8px 0 8px 14px;
  border-left: 3px solid rgba(58, 138, 81, 0.32);
  color: rgba(36, 76, 53, 0.86);
}

.ai-chat__richtext hr {
  width: 100%;
  height: 1px;
  border: 0;
  background: rgba(58, 138, 81, 0.18);
}

.ai-chat__table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(58, 138, 81, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.ai-chat__table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.5;
}

.ai-chat__table th,
.ai-chat__table td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid rgba(58, 138, 81, 0.14);
}

.ai-chat__table thead th {
  position: sticky;
  top: 0;
  background: rgba(225, 243, 222, 0.96);
  font-weight: 800;
}

.ai-chat__table tbody tr:last-child td {
  border-bottom: 0;
}

.ai-chat__table tbody tr:nth-child(even) {
  background: rgba(86, 160, 97, 0.05);
}

.ai-chat__callout {
  display: grid;
  gap: 6px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(58, 138, 81, 0.18);
  background: rgba(255, 255, 255, 0.56);
}

.ai-chat__callout strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ai-chat__callout--warning {
  border-color: rgba(197, 140, 28, 0.28);
  background: rgba(255, 243, 214, 0.84);
}

.ai-chat__callout--warning strong {
  color: #8f5c00;
}

.ai-chat__callout--tip {
  border-color: rgba(37, 132, 95, 0.22);
  background: rgba(226, 247, 237, 0.86);
}

.ai-chat__callout--tip strong {
  color: #1e6b4d;
}

.ai-chat__callout--note {
  border-color: rgba(88, 120, 164, 0.2);
  background: rgba(236, 244, 255, 0.86);
}

.ai-chat__callout--note strong {
  color: #31588d;
}

.ai-chat__bubble--pending {
  min-width: min(320px, 100%);
}

.ai-chat__bubble--assistant {
  justify-self: start;
  background: rgba(122, 183, 77, 0.14);
  color: #244c35;
}

.ai-chat__bubble--user {
  justify-self: end;
  background: rgba(31, 122, 62, 0.9);
  color: #f7fff8;
}

.ai-chat__thinking {
  display: grid;
  gap: 10px;
}

.ai-chat__thinking-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ai-chat__thinking-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* padding: 3px 8px; */
  border-radius: 999px;
  /* background: rgba(255, 255, 255, 0.14); */
  color: inherit;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.ai-chat__thinking-text {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.ai-chat__thinking-word {
  display: inline-block;
  animation: aiChatThinkingWord 1s ease-in-out infinite;
  opacity: 0.45;
}

.ai-chat__thinking-word:nth-child(2) {
  animation-delay: 0.18s;
}

.ai-chat__thinking-word:nth-child(3) {
  animation-delay: 0.36s;
}

.ai-chat__thinking-dots {
  display: inline-flex;
  min-width: 18px;
}

.ai-chat__thinking-dots span {
  display: inline-block;
  animation: aiChatThinkingDot 1s ease-in-out infinite;
  opacity: 0.2;
}

.ai-chat__thinking-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.ai-chat__thinking-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

.ai-chat__thinking-shimmer {
  display: grid;
  gap: 8px;
}

.ai-chat__thinking-shimmer span {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.12) 100%
  );
  background-size: 220% 100%;
  animation: aiChatShimmer 1.2s linear infinite;
}

.ai-chat__thinking-shimmer span:nth-child(1) {
  width: 92%;
}

.ai-chat__thinking-shimmer span:nth-child(2) {
  width: 100%;
}

.ai-chat__thinking-shimmer span:nth-child(3) {
  width: 68%;
}

@keyframes aiChatThinkingDot {
  0%,
  80%,
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@keyframes aiChatThinkingWord {
  0%,
  80%,
  100% {
    opacity: 0.45;
  }
  40% {
    opacity: 1;
  }
}

html[data-theme="dark"] .ai-chat__bubble--assistant {
  background: rgba(122, 183, 77, 0.18);
  color: #d6eadc;
}

html[data-theme="dark"] .ai-chat__bubble-meta {
  color: rgba(214, 234, 220, 0.72);
}

html[data-theme="dark"] .ai-chat__richtext code {
  background: rgba(230, 245, 234, 0.12);
}

html[data-theme="dark"] .ai-chat__richtext pre {
  background: rgba(7, 14, 10, 0.92);
  color: #e7f6ea;
}

html[data-theme="dark"] .ai-chat__richtext blockquote {
  border-left-color: rgba(122, 183, 77, 0.34);
  color: rgba(214, 234, 220, 0.88);
}

html[data-theme="dark"] .ai-chat__richtext hr {
  background: rgba(122, 183, 77, 0.22);
}

html[data-theme="dark"] .ai-chat__table-wrap {
  border-color: rgba(122, 183, 77, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .ai-chat__table th,
html[data-theme="dark"] .ai-chat__table td {
  border-bottom-color: rgba(122, 183, 77, 0.14);
}

html[data-theme="dark"] .ai-chat__table thead th {
  background: rgba(30, 53, 38, 0.94);
}

html[data-theme="dark"] .ai-chat__table tbody tr:nth-child(even) {
  background: rgba(122, 183, 77, 0.06);
}

html[data-theme="dark"] .ai-chat__callout {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .ai-chat__callout--warning {
  background: rgba(96, 67, 14, 0.34);
  border-color: rgba(214, 175, 74, 0.26);
}

html[data-theme="dark"] .ai-chat__callout--warning strong {
  color: #f4d888;
}

html[data-theme="dark"] .ai-chat__callout--tip {
  background: rgba(22, 74, 55, 0.34);
  border-color: rgba(67, 179, 132, 0.24);
}

html[data-theme="dark"] .ai-chat__callout--tip strong {
  color: #8fe0bc;
}

html[data-theme="dark"] .ai-chat__callout--note {
  background: rgba(28, 52, 84, 0.34);
  border-color: rgba(110, 150, 218, 0.24);
}

html[data-theme="dark"] .ai-chat__callout--note strong {
  color: #a5c8ff;
}

html[data-theme="dark"] .ai-chat__thinking-shimmer span {
  background: linear-gradient(
    90deg,
    rgba(190, 225, 201, 0.08) 0%,
    rgba(190, 225, 201, 0.34) 50%,
    rgba(190, 225, 201, 0.08) 100%
  );
  background-size: 220% 100%;
}

html[data-theme="dark"] .ai-chat__thinking-time {
  /* background: rgba(190, 225, 201, 0.12); */
}

.ai-chat__composer {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.ai-chat__input {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

html[data-theme="dark"] .ai-chat__input {
  background: rgba(18, 31, 24, 0.92);
}

.ai-chat__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.ai-chat__send,
.ai-chat__ghost {
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ai-chat__send {
  border: 1px solid rgba(45, 138, 83, 0.34);
  background: linear-gradient(150deg, rgba(77, 170, 95, 0.36), rgba(157, 211, 109, 0.3));
  color: #1f5436;
}

.ai-chat__ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.ai-chat__send:disabled,
.ai-chat__ghost:disabled {
  cursor: wait;
  opacity: 0.72;
}

html[data-theme="dark"] .ai-chat__send {
  color: #e4f4e9;
}

html[data-theme="dark"] .ai-chat__ghost {
  background: rgba(22, 38, 29, 0.84);
  color: #cde3d4;
}

.ai-chat--page {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  height: 100%;
}

.ai-chat__panel--page {
  width: 100%;
  margin-top: 0;
  min-height: calc(100svh - 210px);
  border-radius: 30px;
  border-color: rgba(68, 136, 83, 0.14);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 251, 242, 0.96)),
    var(--surface);
  box-shadow: 0 24px 48px rgba(28, 79, 41, 0.14);
}

.ai-chat__panel--page .ai-chat__head {
  padding: 18px 22px 12px;
}

.ai-chat__panel--page .ai-chat__subtitle {
  max-width: 56ch;
  font-size: 13px;
}

.ai-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 22px 14px;
}

.ai-chat__suggestion {
  border: 1px solid rgba(58, 138, 81, 0.18);
  border-radius: 999px;
  background: rgba(248, 254, 246, 0.92);
  color: #2e6944;
  padding: 9px 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

html[data-theme="dark"] .ai-chat__suggestion {
  background: rgba(24, 39, 30, 0.96);
  color: #d6eadc;
  border-color: rgba(122, 183, 77, 0.24);
}

.ai-chat__panel--page .ai-chat__messages {
  max-height: none;
  min-height: 0;
  padding: 18px 22px 20px;
  align-content: end;
}

.ai-chat__panel--page .ai-chat__bubble {
  max-width: min(760px, 92%);
}

.ai-chat__panel--page .ai-chat__composer {
  padding: 14px 22px calc(118px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(76, 138, 89, 0.1);
  background: linear-gradient(180deg, rgba(247, 251, 245, 0.1), rgba(247, 251, 245, 0.95));
}

.ai-chat__panel--page .ai-chat__input {
  min-height: 84px;
  max-height: 180px;
  resize: vertical;
}

.ramuan-chat-shell {
  height: calc(100svh - 136px - env(safe-area-inset-bottom));
  display: block;
  padding-bottom: calc(132px + env(safe-area-inset-bottom));
}

.ramuan-chat-shell {
  --ramuan-doodle-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220' fill='none'%3E%3Cg stroke='%23678f52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='.22'%3E%3Cpath d='M34 26c10 1 16 7 18 17-10-1-16-7-18-17Z'/%3E%3Cpath d='M31 44c8-2 14-8 16-16'/%3E%3Cpath d='M152 24h20'/%3E%3Cpath d='M162 14v20'/%3E%3Cpath d='M98 42c0-12 10-22 22-22 0 12-10 22-22 22Z'/%3E%3Cpath d='M104 40c3-7 8-12 15-16'/%3E%3Cpath d='M170 74c10 0 18 8 18 18h-36c0-10 8-18 18-18Z'/%3E%3Cpath d='M160 92v7c0 5 4 9 10 9s10-4 10-9v-7'/%3E%3Ccircle cx='52' cy='92' r='13'/%3E%3Cpath d='M48 92h8'/%3E%3Cpath d='M52 88v8'/%3E%3Cpath d='M93 118c9-2 18 4 18 14-10 2-18-4-18-14Z'/%3E%3Cpath d='M93 132c4-5 8-8 14-10'/%3E%3Cpath d='M152 138l8-8 8 8-8 8-8-8Z'/%3E%3Cpath d='M34 160c0-10 8-18 18-18 10 0 18 8 18 18'/%3E%3Cpath d='M42 160v8a10 10 0 0 0 20 0v-8'/%3E%3Cpath d='M104 176h24'/%3E%3Cpath d='M116 164v24'/%3E%3Cpath d='M176 182c7 0 13 6 13 13s-6 13-13 13-13-6-13-13 6-13 13-13Z'/%3E%3C/g%3E%3C/svg%3E");
  --ramuan-doodle-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220' fill='none'%3E%3Cg stroke='%23d6eadc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='.12'%3E%3Cpath d='M34 26c10 1 16 7 18 17-10-1-16-7-18-17Z'/%3E%3Cpath d='M31 44c8-2 14-8 16-16'/%3E%3Cpath d='M152 24h20'/%3E%3Cpath d='M162 14v20'/%3E%3Cpath d='M98 42c0-12 10-22 22-22 0 12-10 22-22 22Z'/%3E%3Cpath d='M104 40c3-7 8-12 15-16'/%3E%3Cpath d='M170 74c10 0 18 8 18 18h-36c0-10 8-18 18-18Z'/%3E%3Cpath d='M160 92v7c0 5 4 9 10 9s10-4 10-9v-7'/%3E%3Ccircle cx='52' cy='92' r='13'/%3E%3Cpath d='M48 92h8'/%3E%3Cpath d='M52 88v8'/%3E%3Cpath d='M93 118c9-2 18 4 18 14-10 2-18-4-18-14Z'/%3E%3Cpath d='M93 132c4-5 8-8 14-10'/%3E%3Cpath d='M152 138l8-8 8 8-8 8-8-8Z'/%3E%3Cpath d='M34 160c0-10 8-18 18-18 10 0 18 8 18 18'/%3E%3Cpath d='M42 160v8a10 10 0 0 0 20 0v-8'/%3E%3Cpath d='M104 176h24'/%3E%3Cpath d='M116 164v24'/%3E%3Cpath d='M176 182c7 0 13 6 13 13s-6 13-13 13-13-6-13-13 6-13 13-13Z'/%3E%3C/g%3E%3C/svg%3E");
}

.ramuan-chat-shell #aiChatMount {
  height: 100%;
}

.ramuan-chat-shell .ai-chat__panel--page .ai-chat__messages {
  background-color: rgba(242, 248, 237, 0.9);
  background-image:
    linear-gradient(180deg, rgba(251, 254, 249, 0.82), rgba(238, 247, 233, 0.9)),
    var(--ramuan-doodle-light);
  background-repeat: no-repeat, repeat;
  background-size: auto, 220px 220px;
  background-position: 0 0, 0 0;
  border-top: 1px solid rgba(76, 138, 89, 0.08);
  border-bottom: 1px solid rgba(76, 138, 89, 0.08);
}

html[data-theme="dark"] .ai-chat__panel--page {
  border-color: rgba(109, 180, 124, 0.14);
  background:
    linear-gradient(180deg, rgba(18, 31, 24, 0.98), rgba(14, 24, 19, 0.98)),
    var(--surface);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .ai-chat__panel--page .ai-chat__composer {
  border-top-color: rgba(115, 185, 120, 0.12);
  background: linear-gradient(180deg, rgba(12, 22, 17, 0.2), rgba(12, 22, 17, 0.94));
}

html[data-theme="dark"] .ramuan-chat-shell .ai-chat__panel--page .ai-chat__messages {
  background-color: rgba(14, 24, 19, 0.94);
  background-image:
    linear-gradient(180deg, rgba(17, 29, 22, 0.78), rgba(10, 18, 14, 0.9)),
    var(--ramuan-doodle-dark);
  border-top-color: rgba(115, 185, 120, 0.08);
  border-bottom-color: rgba(115, 185, 120, 0.08);
}

@media (max-width: 760px) {
  .ramuan-chat-shell {
    height: calc(100svh - 128px - env(safe-area-inset-bottom));
  }

  .ai-chat__panel--page {
    min-height: 100%;
    border-radius: 24px;
  }

  .ai-chat__panel--page .ai-chat__messages {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ai-chat__suggestions,
  .ai-chat__panel--page .ai-chat__head,
  .ai-chat__panel--page .ai-chat__composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ai-chat__panel--page .ai-chat__composer {
    padding-bottom: calc(116px + env(safe-area-inset-bottom));
  }
}

@keyframes aiChatShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -20% 0;
  }
}

.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 40;
  border-radius: 18px;
  border: 1px solid rgba(66, 136, 73, 0.28);
  background: rgba(252, 255, 251, 0.92);
  box-shadow: 0 14px 30px rgba(64, 107, 72, 0.18);
  padding: 12px;
  animation: fadeUp 0.25s ease both;
  transition: background var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease);
}

html[data-theme="dark"] .install-banner {
  background: rgba(16, 29, 22, 0.92);
  border-color: rgba(97, 173, 119, 0.35);
}

html[data-theme="dark"] .install-text {
  color: #cae6d2;
}

.install-text {
  margin: 0 0 10px;
  font-size: 13px;
  color: #2e6a45;
}

.install-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.install-actions .btn {
  flex: unset;
}

small {
  font-size: 12px;
}

.skeleton-img {
  height: 240px;
  background: rgba(95, 139, 103, 0.1);
  animation: pulse 1.2s infinite ease-in-out;
}

.skeleton-line {
  height: 12px;
  margin: 12px 14px;
  border-radius: 999px;
  background: rgba(95, 139, 103, 0.14);
  animation: pulse 1.2s infinite ease-in-out;
}

.w60 { width: 60%; }
.w40 { width: 40%; }
.w90 { width: 90%; }
.w80 { width: 80%; }

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

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

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

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

@keyframes heroShine {
  0%, 100% {
    opacity: 0.42;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.08);
  }
}

.hidden {
  display: none;
}

@media (min-width: 700px) {
  body {
    background-attachment: fixed;
  }

  .container {
    padding-top: 22px;
  }

  .grid.gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #stateDetail .card {
    max-width: 760px;
    margin: 0 auto;
  }

  .hero {
    height: 300px;
  }

  .install-banner {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
