/* App-specific overrides for CoreUI light theme (aligned with HelpDesk). */

:root,
[data-coreui-theme=light] {
  --cui-border-color: #eeeff3;
  --cui-card-border-radius: 1.25rem;
  --cui-card-inner-border-radius: 1.25rem;
  --cui-card-border-width: 0;
  --cui-card-spacer-y: 1.65rem;
  --cui-card-spacer-x: 1.75rem;
  --cui-card-box-shadow: var(--cui-box-shadow-sm, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
  --app-topbar-height: 5.25rem;
  --app-topbar-padding-y: 0.75rem;
  --app-topbar-padding-x: 1rem;
  --app-brand-font: "Sacramento", cursive;
  /* Script for Sage UI + brand mark (same face). */
  --app-display-font: "Sacramento", cursive;
  /* Herb sage — trial as site primary. */
  --sage: #3e7b5c;
  --sage-rgb: 62, 123, 92;
  --sage-hover: #33684d;
  --sage-subtle: #e7f2eb;
  --cui-primary: #3e7b5c;
  --cui-primary-rgb: 62, 123, 92;
  --cui-primary-text-emphasis: #254a37;
  --cui-primary-bg-subtle: #e7f2eb;
  --cui-primary-border-subtle: #c5d7ce;
  --cui-link-color: #3e7b5c;
  --cui-link-color-rgb: 62, 123, 92;
  --cui-link-hover-color: #33684d;
  --cui-link-hover-color-rgb: 51, 104, 77;
  /* Opaque match for rgba(cui-light, 0.45) over white — sticky chrome must be opaque. */
  --app-page-bg: rgb(250, 250, 251);
  --app-header-gap: 1.5rem;
  /* Override CoreUI/Bootstrap smooth scrolling — page changes should jump. */
  scroll-behavior: auto;
}

html {
  scroll-behavior: auto;
}

/* Home-screen / installed app: keep chrome app-like (no Safari URL footer feel). */
html.standalone-app,
html.standalone-app body {
  overscroll-behavior-y: none;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  html,
  body {
    overscroll-behavior-y: none;
  }

  .footer-desktop-brand {
    display: none !important;
  }
}

.app-breadcrumb .breadcrumb {
  --cui-breadcrumb-divider: "›";
  flex-wrap: wrap;
  row-gap: 0.15rem;
  font-size: 0.925rem;
}

.app-breadcrumb .breadcrumb-item a {
  text-decoration: none;
  color: var(--cui-link-color, var(--sage, #3e7b5c));
}

.app-breadcrumb .breadcrumb-item a:hover {
  text-decoration: underline;
}

.app-breadcrumb .breadcrumb-item.active {
  max-width: min(36rem, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-detail-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  line-height: 1.2;
}

.recipe-go-back {
  --cui-btn-border-width: 0;
  border: 0;
  box-shadow: none;
}

.recipe-go-back:hover,
.recipe-go-back:focus,
.recipe-go-back:active {
  border: 0;
  box-shadow: none;
}

/* Circular caret-left back — recipe detail, below md only.
   Absolutely positioned so the brand never shifts (width animation +
   Sacramento text-stroke left ghost trails on iOS/WebKit). */
.header-ios-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: var(--app-topbar-padding-x, 1rem);
  top: 50%;
  z-index: 2;
  width: 2.45rem;
  height: 2.45rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cui-primary) 12%, #fff);
  color: var(--cui-primary);
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) scale(0.92);
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease;
}

.header-ios-back.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.header-ios-back > .bi {
  font-size: 1.2rem;
  line-height: 1;
  margin-left: -0.1rem; /* optical center for chevron */
}

.header-ios-back:hover,
.header-ios-back:focus-visible {
  background: color-mix(in srgb, var(--cui-primary) 18%, #fff);
  color: var(--cui-link-hover-color, var(--sage-hover));
}

.header-ios-back.is-visible:active {
  opacity: 0.7;
}

/* Indent brand only while back is present — no transition (avoids glyph trails). */
body.page-recipe-detail .header-brand {
  margin-inline-start: calc(2.45rem + 0.35rem);
}

@media (min-width: 768px) {
  .header-ios-back {
    display: none !important;
  }

  body.page-recipe-detail .header-brand {
    margin-inline-start: 0;
  }
}

.card {
  --cui-card-border-radius: 1.25rem;
  --cui-card-inner-border-radius: 1.25rem;
  --cui-card-border-width: 0;
  --cui-card-spacer-y: 1.65rem;
  --cui-card-spacer-x: 1.75rem;
  --cui-card-box-shadow: var(--cui-box-shadow-sm, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
  border: 0;
  border-radius: var(--cui-card-border-radius);
  box-shadow: var(--cui-card-box-shadow);
}

.card-body {
  padding: var(--cui-card-spacer-y) var(--cui-card-spacer-x);
}

body {
  background-color: var(--app-page-bg) !important;
}

body.page-recipe-detail {
  background-color: #fff !important;
  /* Sticky header + image load: stop reload scroll-anchoring creep. */
  overflow-anchor: none;
}

body.page-shop {
  background-color: #fff !important;
}

body.page-recipe-detail .header,
body.page-recipe-detail .footer {
  background-color: #fff;
}

body.page-recipe-detail .header {
  margin-bottom: 1.35rem !important;
  overflow-anchor: none;
}

.wrapper {
  width: 100%;
  padding-inline: var(--cui-sidebar-occupy-start, 0) var(--cui-sidebar-occupy-end, 0);
  will-change: padding;
  transition: padding 0.15s ease;
}

.sidebar-header,
.header {
  box-sizing: border-box;
  height: var(--app-topbar-height);
  min-height: var(--app-topbar-height);
  max-height: var(--app-topbar-height);
  border-bottom: var(--cui-border-width, 1px) solid var(--cui-border-color);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--app-topbar-padding-y) var(--app-topbar-padding-x);
  overflow: visible;
  position: relative;
}

.sidebar-header .btn-close {
  position: absolute;
  right: var(--app-topbar-padding-x);
  top: 50%;
  transform: translateY(-50%);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.425rem;
  color: inherit;
  line-height: 1;
  margin-top: 0;
  white-space: nowrap;
  overflow: visible;
}

.sidebar-brand.app-brand,
.header-brand.app-brand {
  font-family: var(--app-brand-font);
}

.app-brand-text {
  font-family: var(--app-brand-font) !important;
  font-size: 1.7rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.15;
  color: var(--cui-primary, #5856d6);
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  overflow: visible;
  /* Sacramento has no bold face — slight stroke for a touch more weight. */
  -webkit-text-stroke: 0.75px currentColor;
  paint-order: stroke fill;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.modal-title {
  font-family: var(--app-brand-font);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

h1, .h1 {
  font-size: clamp(2.25rem, 2rem + 1.5vw, 3rem);
  line-height: 1.2;
}

h2, .h2 {
  font-size: clamp(1.85rem, 1.7rem + 1vw, 2.35rem);
  line-height: 1.25;
}

h3, .h3 {
  font-size: 1.75rem;
  line-height: 1.3;
}

.header {
  display: flex;
  align-items: stretch;
  z-index: 1030;
}

.header > .container-fluid {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding-block: var(--app-topbar-padding-y);
  padding-inline: var(--app-topbar-padding-x) 1.25rem;
  border-bottom: 0;
}

.layout-no-sidebar {
  --cui-sidebar-occupy-start: 0;
  --cui-sidebar-occupy-end: 0;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin-inline-end: 0.75rem;
  height: 100%;
}

.header-brand .app-brand-text {
  font-size: 2.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  /* Sacramento’s em-box is descender-heavy; nudge so the ink sits on the header midline. */
  transform: translateY(0.12em);
}

.header-nav {
  gap: 0.85rem;
}

.header-nav > .nav-item {
  margin: 0;
}

.header-menu-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.header-menu-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(var(--cui-primary-rgb, 88, 86, 214), 0.12);
  border: 1px solid rgba(var(--cui-secondary-rgb, 107, 119, 133), 0.35);
  flex-shrink: 0;
}

.header-menu-ellipsis {
  display: none;
  font-size: 1.35rem;
  line-height: 1;
  vertical-align: -0.1em;
}

.header-menu-label {
  display: inline-block;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.header-profile-link {
  display: inline-flex;
  align-items: center;
  padding-block: 0.25rem;
}

.header-profile-link .header-menu-avatar {
  width: 2rem;
  height: 2rem;
}

.header-mobile-only {
  display: none;
}

@media (max-width: 767.98px) {
  .header-menu-toggle.dropdown-toggle::after {
    display: none;
  }

  .header-menu-ellipsis {
    display: none;
  }

  .header-menu-avatar {
    width: 2rem;
    height: 2rem;
  }

  .header-menu-label {
    display: none;
  }
}

.profile-avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}

.profile-avatar {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(var(--cui-primary-rgb, 88, 86, 214), 0.12);
  border: 1px solid rgba(var(--cui-secondary-rgb, 107, 119, 133), 0.35);
  flex-shrink: 0;
}

.profile-connection-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-connection-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--cui-border-color, #d8dbe0);
}

.profile-connection-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.connections-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.connection-person-card .card-body {
  padding: 1rem 1.15rem;
}

.connection-person-card .profile-connection-person {
  width: 100%;
}

.profile-connection-person {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
}

.profile-connection-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-connection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-connection-identity {
  min-width: 0;
}

.profile-connection-disconnect {
  flex-shrink: 0;
}

.profile-connection-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--cui-primary-bg-subtle, #e7e7fb);
  border: 1px solid var(--cui-secondary-border-subtle, #c8d0da);
}

.connection-user-picker {
  position: relative;
}

.connection-search-results {
  position: absolute;
  z-index: 1060;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  max-height: 16rem;
  overflow: auto;
  box-shadow: var(--cui-box-shadow-sm, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
}

.avatar-dropzone {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.15rem 1.25rem;
  border: 1.5px dashed var(--cui-border-color-translucent, #cfd4de);
  border-radius: var(--cui-border-radius-lg, 0.5rem);
  background: var(--cui-tertiary-bg, #f8f9fa);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.avatar-dropzone:hover,
.avatar-dropzone:focus-visible {
  border-color: var(--cui-primary, #5856d6);
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(var(--cui-primary-rgb, 88, 86, 214), 0.16);
}

.avatar-dropzone.is-dragover {
  border-color: var(--cui-primary, #5856d6);
  border-style: solid;
  background: rgba(var(--cui-primary-rgb, 88, 86, 214), 0.08);
}

.avatar-dropzone.is-uploading {
  pointer-events: none;
  opacity: 0.72;
}

.avatar-dropzone-preview {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(var(--cui-primary-rgb, 88, 86, 214), 0.12);
  border: 1px solid rgba(var(--cui-secondary-rgb, 107, 119, 133), 0.35);
  flex-shrink: 0;
}

.avatar-dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 12rem;
}

.avatar-dropzone-title {
  font-size: 1rem;
  font-weight: 600;
}

.avatar-dropzone-hint {
  color: var(--cui-secondary-color, #6b7785);
  font-size: 0.875rem;
}

.avatar-dropzone-status {
  margin-top: 0.15rem;
  font-size: 0.875rem;
  color: var(--cui-primary, #5856d6);
}

.avatar-dropzone-status.is-error {
  color: var(--cui-danger, #e55353);
}

.avatar-dropzone-input {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.header-bag-link {
  position: relative;
  gap: 0.4rem;
  padding-inline: 0.5rem;
  margin-inline-end: 0.25rem;
  line-height: 1;
  font-weight: 400;
}

.header-nav-link {
  position: relative;
  gap: 0.4rem;
  padding-inline: 0.5rem;
  margin-inline-end: 0.15rem;
  line-height: 1;
  font-weight: 400;
}

.header-nav-link > .bi {
  font-size: 1.2rem;
  line-height: 1;
}

.header-nav-link-label {
  display: none;
  font-size: inherit;
  font-weight: inherit;
}

.dropdown-header {
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage, #3e7b5c);
}

.header-nav-badge,
.header-bag-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.2rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--cui-body-bg, #fff);
  pointer-events: none;
}

.header-bag-link > .bi {
  font-size: 1.2rem;
  line-height: 1;
}

.header-bag-label {
  display: none;
  font-size: inherit;
  font-weight: inherit;
}

.header-notifications-toggle {
  overflow: visible;
}

/* Mobile app tab bar (xs only). */
.mobile-tabbar {
  display: none;
}

@media (max-width: 575.98px) {
  :root {
    --app-topbar-height: 3.85rem;
    --app-topbar-padding-y: 0.4rem;
    --mobile-tabbar-height: 3.65rem;
    --app-header-gap: 0.85rem;
  }

  .header.mb-4 {
    margin-bottom: var(--app-header-gap) !important;
  }

  body.page-recipe-detail .header {
    margin-bottom: 0.85rem !important;
  }

  .header > .container-fluid {
    padding-inline: 0.85rem;
  }

  .header-ios-back {
    left: 0.85rem;
  }

  /* Match content side gutters to the header→content top gap. */
  .body > .container-fluid.px-4 {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .app-brand-text {
    font-size: 1.45rem;
    /* Stroke + layout shifts leave WebKit glyph trails on Sacramento. */
    -webkit-text-stroke: 0;
  }

  .header-brand .app-brand-text {
    font-size: 1.95rem;
  }

  .header-desktop-only {
    display: none !important;
  }

  .header-mobile-only {
    display: list-item;
  }

  .footer-desktop-brand {
    display: none;
  }

  body.has-mobile-tabbar .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    box-sizing: border-box;
    min-height: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding: 0.25rem 0.25rem env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid color-mix(in srgb, var(--cui-border-color, #d8dbe0) 80%, transparent);
    box-shadow: 0 -0.45rem 1.35rem rgba(15, 23, 42, 0.08);
  }

  body.has-mobile-tabbar {
    /* Clear the tab content only — safe-area is already inside the fixed tabbar. */
    padding-bottom: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom, 0px));
  }

  body.has-mobile-tabbar .page-scroll-top {
    bottom: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom, 0px) + 0.75rem);
  }

  /* Sit above the mobile tab bar (same clearance as scroll-to-top). */
  body.has-mobile-tabbar #appToastContainer.app-toast-container {
    bottom: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom, 0px) + 0.75rem);
  }

  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    min-height: 3.15rem;
    padding: 0.25rem 0.2rem;
    border: 0;
    border-radius: 0.9rem;
    color: #6b7785;
    text-decoration: none;
    font-family: var(--cui-body-font-family, system-ui, sans-serif);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.1;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-tab .bi {
    font-size: 1.28rem;
    line-height: 1;
  }

  .mobile-tab-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
  }

  .mobile-tab-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.55rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: var(--cui-primary, #5856d6);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.05rem;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
  }

  .mobile-tab.is-active {
    color: var(--cui-primary, #5856d6);
  }

  .mobile-tab:active {
    transform: scale(0.96);
  }

  .mobile-tab:focus-visible {
    outline: 2px solid var(--cui-primary, #5856d6);
    outline-offset: 2px;
  }
}

#appToastContainer.app-toast-container {
  position: fixed;
  top: auto;
  left: 0;
  right: 0;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 2100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: none;
  padding: 0 0.75rem;
  margin: 0;
  pointer-events: none;
}

#appToastContainer.app-toast-container .toast {
  width: min(24rem, 100%);
  max-width: 100%;
  margin: 0;
  pointer-events: auto;
}

.swal2-coreui {
  border-radius: 1rem !important;
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
}

.swal2-coreui .swal2-title {
  font-family: var(--cui-body-font-family, system-ui, sans-serif) !important;
  font-size: 1.35rem;
  font-weight: 700;
}

.swal2-container {
  z-index: 2200 !important;
}

/* HTMX loading bar for recipe board filter / load-more. */
.board-loading {
  height: 0;
  margin: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cui-primary, #321fdb) 35%, transparent);
  opacity: 0;
  transform: scaleX(0.15);
  transform-origin: left center;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.board-sticky-chrome {
  position: sticky;
  top: var(--app-topbar-height);
  /* Above board cards, below header dropdowns / Popper menus (z-index ~1000). */
  z-index: 20;
  /* Pull into the header gap + pad the same amount so Ask Sage stays put,
     while opaque fill covers the strip above the button when stuck. */
  margin: calc(-1 * var(--app-header-gap)) calc(-1 * var(--board-sticky-gutter, 1.5rem)) 0.7rem;
  padding: var(--app-header-gap) var(--board-sticky-gutter, 1.5rem) 0;
  background-color: var(--app-page-bg);
  overflow: visible;
  /* Prevent reload scroll-anchoring from walking cards under the sticky edge. */
  overflow-anchor: none;
}

/* Soft fade so cards ease under the sticky edge instead of clipping hard.
   Sits under the filters (and their shadow) via z-index. */
.board-sticky-chrome::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.7rem;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--app-page-bg) 0%,
    color-mix(in srgb, var(--app-page-bg) 55%, transparent) 40%,
    transparent 100%
  );
}

@media (max-width: 575.98px) {
  .board-sticky-chrome {
    --board-sticky-gutter: 0.85rem;
  }
}

.board-sticky-chrome .board-filters {
  position: relative;
  z-index: 1;
  /* Hang over the board so cards slide under the filters edge. */
  box-shadow: 0 0.45rem 0.75rem -0.3rem rgba(15, 23, 42, 0.12);
}

#boardResults {
  overflow-anchor: none;
}

.board-page-header {
  margin-bottom: 0.65rem;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .board-page-header {
    margin-bottom: 1.25rem;
  }
}

.board-page-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  line-height: 1.25;
}

.board-page-subtitle {
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.35;
}

@media (max-width: 575.98px) {
  .board-page-header {
    margin-bottom: 0.85rem;
    flex-wrap: nowrap;
  }

  .board-page-title {
    display: none;
  }

  .board-page-subtitle {
    display: none;
  }

  .board-page-actions {
    width: 100%;
    flex-wrap: nowrap;
  }

  .board-page-actions .btn {
    flex: 1 1 0;
    white-space: nowrap;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .board-ask-ai-btn {
    width: auto;
    align-self: stretch;
  }
}

/* CoreUI hardcodes purple into button locals — rebind to --cui-primary. */
.btn-primary {
  --cui-btn-color: #fff;
  --cui-btn-bg: var(--cui-primary);
  --cui-btn-border-color: var(--cui-primary);
  --cui-btn-hover-color: #fff;
  --cui-btn-hover-bg: var(--sage-hover);
  --cui-btn-hover-border-color: var(--sage-hover);
  --cui-btn-focus-shadow-rgb: var(--cui-primary-rgb);
  --cui-btn-active-color: #fff;
  --cui-btn-active-bg: var(--sage-hover);
  --cui-btn-active-border-color: var(--sage-hover);
  --cui-btn-disabled-color: #fff;
  --cui-btn-disabled-bg: var(--cui-primary);
  --cui-btn-disabled-border-color: var(--cui-primary);
}

.btn-outline-primary {
  --cui-btn-color: var(--cui-primary);
  --cui-btn-border-color: var(--cui-primary);
  --cui-btn-hover-color: #fff;
  --cui-btn-hover-bg: var(--cui-primary);
  --cui-btn-hover-border-color: var(--cui-primary);
  --cui-btn-focus-shadow-rgb: var(--cui-primary-rgb);
  --cui-btn-active-color: #fff;
  --cui-btn-active-bg: var(--sage-hover);
  --cui-btn-active-border-color: var(--sage-hover);
  --cui-btn-disabled-color: var(--cui-primary);
  --cui-btn-disabled-bg: transparent;
}

.btn-ghost-primary {
  --cui-btn-color: var(--cui-primary);
  --cui-btn-hover-bg: var(--sage-hover);
  --cui-btn-hover-border-color: var(--sage-hover);
  --cui-btn-hover-color: #fff;
  --cui-btn-active-bg: var(--sage-hover);
  --cui-btn-active-border-color: var(--sage-hover);
  --cui-btn-active-color: #fff;
  --cui-btn-disabled-color: var(--cui-primary);
}

.callout-primary {
  --cui-callout-border-left-color: var(--cui-primary);
}

.border-top-primary { border-top-color: var(--cui-primary) !important; }
.border-end-primary { border-right-color: var(--cui-primary) !important; }
.border-bottom-primary { border-bottom-color: var(--cui-primary) !important; }
.border-start-primary { border-left-color: var(--cui-primary) !important; }

.text-bg-primary {
  color: #fff !important;
  background-color: RGBA(var(--cui-primary-rgb), var(--cui-bg-opacity, 1)) !important;
}

/* CoreUI uses near-black (#080a0c) on solid success/danger/warning/info — hard to read. */
.btn-success,
.btn-danger,
.btn-warning,
.btn-info {
  --cui-btn-color: #fff;
  --cui-btn-hover-color: #fff;
  --cui-btn-active-color: #fff;
  --cui-btn-disabled-color: #fff;
  color: #fff;
}

.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
  --cui-btn-hover-color: #fff;
  --cui-btn-active-color: #fff;
}

.text-bg-success,
.text-bg-danger,
.text-bg-warning,
.text-bg-info {
  color: #fff !important;
}

.swal2-popup .btn-primary,
.swal2-popup .btn-success,
.swal2-popup .btn-danger,
.swal2-popup .btn-warning,
.swal2-popup .btn-info {
  color: #fff !important;
}

/* Sage — kitchen-sous accent (herb green). */
.btn-sage {
  --cui-btn-color: #fff;
  --cui-btn-bg: var(--sage);
  --cui-btn-border-color: var(--sage);
  --cui-btn-hover-color: #fff;
  --cui-btn-hover-bg: var(--sage-hover);
  --cui-btn-hover-border-color: var(--sage-hover);
  --cui-btn-focus-shadow-rgb: var(--sage-rgb);
  --cui-btn-active-color: #fff;
  --cui-btn-active-bg: var(--sage-hover);
  --cui-btn-active-border-color: var(--sage-hover);
  --cui-btn-disabled-color: #fff;
  --cui-btn-disabled-bg: var(--sage);
  --cui-btn-disabled-border-color: var(--sage);
  color: #fff;
  background-color: var(--sage);
  border-color: var(--sage);
}

.btn-sage:hover,
.btn-sage:focus-visible {
  color: #fff;
  background-color: var(--sage-hover);
  border-color: var(--sage-hover);
}

.btn-sage:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(var(--sage-rgb), 0.35);
}

.board-ask-ai-btn.btn-sage {
  font-family: var(--app-brand-font);
  font-weight: 400;
  font-size: 1.75rem;
  letter-spacing: 0.01em;
  line-height: 1.15;
  padding-block: 0.45rem;
}

.board-ask-ai-btn.btn-sage .cil-leaf,
.board-ask-ai-btn.btn-sage [class^="cil-"],
.board-ask-ai-btn.btn-sage [class*=" cil-"] {
  font-family: CoreUI-Icons-Free !important;
  font-size: 1.05rem;
  -webkit-text-stroke: 0;
  vertical-align: -0.05em;
}

.text-sage {
  color: var(--sage) !important;
}

.board-loading.htmx-request {
  height: 3px;
  margin: 0 0 0.5rem;
  opacity: 1;
  animation: board-loading-pulse 0.9s ease-in-out infinite;
}

@keyframes board-loading-pulse {
  0% {
    transform: scaleX(0.15);
  }
  50% {
    transform: scaleX(0.85);
  }
  100% {
    transform: scaleX(0.35);
  }
}

/* Recipe board filters — collapsed drawer; expand via toggle. */
.board-filters {
  padding-bottom: 0.25rem;
}

.board-filters-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  margin: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.board-filters-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.board-filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--cui-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.board-filters-preview {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-filters-chevron {
  margin-left: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  opacity: 0.65;
}

.board-filters.is-open .board-filters-chevron {
  transform: rotate(225deg);
}

.board-filters-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  align-items: end;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateY(-0.25rem);
  transition:
    max-height 0.32s ease,
    opacity 0.24s ease,
    padding 0.28s ease,
    transform 0.28s ease;
}

.board-filters.is-open .board-filters-panel {
  max-height: 36rem;
  opacity: 1;
  pointer-events: auto;
  padding-top: 0.25rem;
  padding-bottom: 0.35rem;
  transform: translateY(0);
}

.board-filter-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.board-filter-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cui-secondary-color, #6b7785);
}

.board-filter-select {
  width: 100%;
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--cui-border-color, #dbdfe6);
  border-radius: 0;
  background:
    linear-gradient(45deg, transparent 50%, currentColor 50%) no-repeat right 0.35rem center / 0.35rem 0.35rem,
    linear-gradient(135deg, currentColor 50%, transparent 50%) no-repeat right 0.05rem center / 0.35rem 0.35rem,
    transparent;
  color: inherit;
  padding: 0.35rem 1.25rem 0.45rem 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.board-filter-select:focus {
  outline: none;
  border-bottom-color: var(--cui-primary);
  box-shadow: none;
}

.board-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.15rem;
}

@media (min-width: 768px) {
  .board-filters-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.15rem;
  }

  .board-filter-actions {
    grid-column: 1 / -1;
    padding-top: 0.35rem;
  }
}

@media (min-width: 1200px) {
  .board-filters-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem 1.5rem;
  }

  .board-filter-actions {
    grid-column: 1 / -1;
    padding-top: 0.35rem;
  }
}

.page-scroll-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--cui-primary, #5856d6);
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, filter 0.15s ease;
  cursor: pointer;
}

.page-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.page-scroll-top:hover {
  filter: brightness(1.08);
}

.page-scroll-top:focus-visible {
  outline: 2px solid var(--cui-primary, #5856d6);
  outline-offset: 3px;
}

.page-scroll-top .bi {
  font-size: 1.2rem;
  line-height: 1;
}

/* Stable board grid (CSS columns reflow/jump when appending "Load more"). */
.recipe-masonry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .recipe-masonry {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.recipe-pin {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  position: relative;
}

.recipe-pin-card-link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  color: inherit;
}

.recipe-pin-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--cui-card-border-radius, 1.25rem);
  height: 100%;
  flex: 1 1 auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recipe-pin-card-link:hover .recipe-pin-card {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

.recipe-pin-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background-color: #eef1f4;
  background-image: url('/images/recipe-placeholder.png');
  background-size: cover;
  background-position: center;
}

.recipe-thumb {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #eef1f4;
  background-image: url('/images/recipe-placeholder.png');
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.recipe-detail-title {
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  /* Prefer wrapping at spaces — never shred short titles beside the heart. */
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}

.recipe-detail-meta-box {
  margin: 0;
  padding: 0.75rem 0.85rem;
}

.recipe-detail-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  font-size: 0.92rem;
  line-height: 1.3;
}

.recipe-detail-meta li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
  white-space: nowrap;
}

.recipe-detail-meta-key {
  flex: 0 0 5.25rem;
  color: var(--cui-secondary-color, #6c757d);
  font-size: 0.85rem;
  font-weight: 500;
}

.recipe-detail-meta-value {
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-detail-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem 1rem;
}

.recipe-detail-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem 0.65rem;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  order: 1;
}

.recipe-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  float: none;
  order: 2;
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.recipe-detail-actions .recipe-detail-bag {
  float: none;
  width: auto;
  margin: 0;
  flex: 0 1 auto;
}

.recipe-detail-favorite {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(192, 57, 43, 0.22);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.08);
  color: #c0392b;
}

.recipe-detail-favorite .favorite-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: inherit;
  /* Heart glyph sits high in its em-box — nudge for even padding. */
  transform: translateY(0.08em);
}

.recipe-detail-favorite .favorite-toggle-icon .bi {
  color: inherit;
}

.recipe-detail-favorite:hover {
  transform: scale(1.06);
  background: #fff;
  color: #c0392b;
}

.recipe-detail-favorite.is-favorite,
.recipe-detail-favorite.is-out {
  color: #c0392b;
  background: #fff;
}

.recipe-detail-options-btn {
  font-weight: 600;
  font-size: 0.92rem;
  min-height: 2.35rem;
  white-space: nowrap;
}

.recipe-detail-options .dropdown-item {
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
}

@media (max-width: 767.98px) {
  /* Flatten so title row / actions can sit relative to description. */
  .recipe-detail-heading {
    display: contents;
  }

  .recipe-detail-title-row {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }

  .recipe-detail-actions {
    flex: 0 0 auto;
    width: 100%;
    margin: 0 0 1rem;
  }

  .recipe-detail-actions .recipe-detail-bag {
    flex: 1 1 auto;
  }
}

/* Larger type for cooking — easier to read while preparing. */
.recipe-detail-body {
  font-size: 1.125rem;
  line-height: 1.55;
}

.recipe-detail-body .text-body-secondary {
  font-size: 1.05rem;
}

.recipe-detail-ingredients li,
.recipe-detail-instructions li {
  font-size: 1.125rem;
  line-height: 1.55;
}

.recipe-detail-body::after {
  content: "";
  display: table;
  clear: both;
}

.recipe-detail-media {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
  width: 100%;
  overflow-anchor: none;
}

/* Mobile: image → title+heart → description → actions → meta → body */
@media (max-width: 767.98px) {
  .recipe-detail-body {
    display: flex;
    flex-direction: column;
  }

  .recipe-detail-body::after {
    display: none;
  }

  .recipe-detail-media {
    display: contents;
  }

  .recipe-detail-image {
    order: 1;
    margin: 0 0 1.25rem;
    flex: 0 0 auto;
  }

  .recipe-detail-title-row {
    order: 2;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    margin: 0 0 0.5rem;
  }

  .recipe-detail-title {
    margin: 0;
  }

  .recipe-detail-description {
    order: 3;
    flex: 0 0 auto;
  }

  .recipe-detail-actions {
    order: 4;
    flex: 0 0 auto;
  }

  .recipe-detail-meta-box {
    order: 5;
    flex: 0 0 auto;
    margin-bottom: 1.25rem;
  }

  .recipe-detail-ingredients {
    order: 6;
    flex: 0 0 auto;
  }

  .recipe-detail-instructions {
    order: 7;
    flex: 0 0 auto;
  }
}

@media (min-width: 768px) {
  .recipe-detail-media {
    float: right;
    align-items: stretch;
    width: 18rem;
    margin: 0 0 1.25rem 1.75rem;
  }
}

@media (min-width: 992px) {
  .recipe-detail-nav,
  .recipe-detail,
  .recipe-related,
  .recipe-related-slot {
    max-width: 48rem;
    margin-inline: auto;
  }
}

@media (min-width: 1400px) {
  .recipe-detail-nav,
  .recipe-detail,
  .recipe-related,
  .recipe-related-slot {
    max-width: 52rem;
  }
}

.recipe-detail-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--cui-border-radius, 0.375rem);
  overflow: hidden;
  background-color: #eef1f4;
  background-image: url('/images/recipe-placeholder.png');
  background-size: cover;
  background-position: center;
  color: inherit;
  text-decoration: none;
}

.recipe-detail-image-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.recipe-detail-image-link:hover {
  opacity: 0.94;
}

.recipe-detail-image .recipe-thumb-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-detail-instructions-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* —— Cook mode (shopping-trip style full screen) —— */
html.cook-mode-open,
body.cook-mode-open {
  overflow: hidden;
  background-color: #fff !important;
}

.cook-mode {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: #fff;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.cook-mode.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cook-mode-page {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 1rem max(3rem, env(safe-area-inset-bottom, 0px));
  min-height: 100%;
  background: #fff;
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.cook-mode.is-open .cook-mode-page {
  opacity: 1;
  transform: translateY(0);
}

.cook-mode-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 0.85rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0.1rem 0.35rem rgba(15, 23, 42, 0.06);
}

.cook-mode-step {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.cook-mode-step:last-child {
  border-bottom: 0;
}

.cook-mode-step-label {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0;
  padding: 1.15rem 1.05rem;
  min-height: 4rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.cook-mode-check {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  margin-top: 0.3rem;
  accent-color: var(--cui-success, #2eb85c);
  cursor: pointer;
}

.cook-mode-step-num {
  flex: 0 0 auto;
  min-width: 1.85rem;
  margin-top: 0.15rem;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--cui-primary, #5856d6);
}

.cook-mode-step-text {
  flex: 1 1 auto;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--cui-body-color, #212529);
  transition: color 0.15s ease, opacity 0.15s ease;
}

.cook-mode-step.is-done .cook-mode-step-text {
  text-decoration: line-through;
  color: var(--cui-secondary-color, #6c757d);
  opacity: 0.72;
}

.cook-mode-step.is-done .cook-mode-step-num {
  opacity: 0.55;
}

.cook-mode-ingredients {
  margin-top: 1.75rem;
}

.cook-mode-ingredient-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 0.85rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0.1rem 0.35rem rgba(15, 23, 42, 0.06);
}

.cook-mode-ingredient {
  padding: 1rem 1.05rem;
  font-size: 1.25rem;
  line-height: 1.45;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--cui-body-color, #212529);
}

.cook-mode-ingredient:last-child {
  border-bottom: 0;
}

.recipe-detail-source {
  position: absolute;
  left: 50%;
  bottom: 0.65rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: max-content;
  max-width: calc(100% - 1.3rem);
  padding: 0.4rem 0.75rem;
  border-radius: var(--cui-border-radius, 0.375rem);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  color: var(--cui-primary, var(--sage, #3e7b5c));
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.18);
  transform: translateX(-50%);
}

.recipe-detail-source:hover {
  background: #fff;
  color: var(--sage-hover, #33684d);
}

.recipe-related-title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.recipe-related-loading {
  min-height: 1.25rem;
}

.recipe-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Show 6 related recipes by default; 8 from XL up. */
.recipe-related-grid > :nth-child(n + 7) {
  display: none;
}

@media (min-width: 768px) {
  .recipe-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .recipe-related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .recipe-related-grid > :nth-child(n + 7) {
    display: flex;
  }
}

.recipe-pin-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #eef1f4;
}

.recipe-pin-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.recipe-pin-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.35rem;
}

.recipe-pin-desc {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.875rem;
  line-height: 1.35;
  min-height: 1.35em;
  color: var(--cui-secondary-color, #6c757d);
}

.recipe-pin-meta {
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-thumb-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #eef1f4;
  background-image: url('/images/recipe-placeholder.png');
  background-size: cover;
  background-position: center;
}

@media (min-width: 768px) {
  .recipe-thumb {
    width: 12rem;
    height: 12rem;
  }
}

.chat-bubble-text + .chat-recipe-list {
  margin-top: 0.65rem;
}

/* Ask AI chat overlay — only lock scroll while open. */
body:has(.chat-overlay.is-open) {
  overflow: hidden;
}

.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(33, 37, 41, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.chat-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.chat-panel {
  width: min(28rem, 100%);
  height: min(42rem, calc(100vh - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--cui-body-bg, #fff);
  color: var(--cui-body-color, inherit);
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.chat-overlay.is-open .chat-panel {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 767.98px) {
  .chat-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: var(--cui-body-bg, #fff);
  }

  .chat-panel {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    min-height: 100%;
    min-height: 100dvh;
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.chat-panel-header,
.chat-panel-footer {
  flex: 0 0 auto;
  padding: 1rem 1rem 0.75rem;
}

.chat-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.chat-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 0 0 auto;
}

.chat-sage-title {
  display: flex;
  align-items: center;
  font-family: var(--app-brand-font);
  font-size: 1.85rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--sage);
}

.chat-sage-title .cil-leaf {
  font-size: 1.35rem;
  line-height: 1;
}

.chat-reset-btn {
  white-space: nowrap;
}

.chat-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 1rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.chat-panel-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}

.chat-panel-footer .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-panel-footer .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chat-thread {
  padding: 0.75rem 0.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  max-width: 100%;
  min-width: 0;
}

.chat-row-user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 92%;
}

.chat-row-ai {
  align-self: stretch;
  width: 100%;
  min-width: 0;
}

.chat-avatar {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.chat-avatar-user {
  background: var(--sage-subtle);
  color: var(--sage);
  padding: 0;
  overflow: hidden;
}

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

.chat-avatar-ai {
  background: var(--sage-subtle);
  color: var(--sage);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
}

.chat-bubble {
  border-radius: 1rem;
  padding: 0.7rem 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.chat-bubble-text {
  white-space: pre-wrap;
}

.chat-bubble-user {
  background: var(--sage);
  color: #fff;
  border-bottom-right-radius: 0.35rem;
}

.chat-bubble-ai {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  background: var(--cui-tertiary-bg, #eef1f4);
  color: var(--cui-body-color);
  border-bottom-left-radius: 0.35rem;
}

.chat-modal-footer {
  display: block;
}

.chat-composer .btn {
  min-width: 3rem;
}

.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.25rem;
  padding-block: 0.85rem;
}

.chat-typing span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--cui-secondary-color, #6c757d);
  opacity: 0.35;
  animation: chat-typing-bounce 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chat-typing-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-0.25rem);
    opacity: 1;
  }
}

.chat-recipe-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.chat-recipe-card-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}

.chat-recipe-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: left;
  border: 1px solid var(--cui-border-color, #d8dde6);
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.45rem 2.6rem 0.45rem 0.45rem;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-recipe-card:hover {
  border-color: var(--cui-primary);
  box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.06);
}

.chat-bubble-user .chat-recipe-card {
  background: rgba(255, 255, 255, 0.95);
  color: var(--cui-body-color);
}

.chat-recipe-thumb {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.55rem;
  object-fit: cover;
  flex: 0 0 auto;
  background: #eef1f4;
}

.chat-recipe-meta {
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding-top: 0.1rem;
}

.chat-recipe-title,
.chat-recipe-desc,
.chat-recipe-sub {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-recipe-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
}

.chat-recipe-desc {
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--cui-body-color, #333);
  opacity: 0.78;
}

.chat-recipe-sub {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--cui-secondary-color, #6c757d);
}

.recipe-pin-bag {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
}

.recipe-pin-favorite {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
}

.favorite-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  cursor: pointer;
  line-height: 1;
  color: inherit;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.favorite-toggle-btn:focus-visible {
  outline: 2px solid var(--cui-primary);
  outline-offset: 2px;
}

.favorite-toggle-fab {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  color: #c0392b;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0.35rem 0.85rem rgba(0, 0, 0, 0.18);
}

.favorite-toggle-fab .favorite-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  /* Heart glyph sits high in its em-box — nudge for even padding. */
  transform: translateY(0.08em);
}

.favorite-toggle-fab:hover {
  transform: scale(1.06);
}

.favorite-toggle-fab.is-favorite {
  color: #c0392b;
  background: #fff;
}

.favorite-toggle-labeled {
  min-height: 2.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--cui-btn-border-radius, var(--cui-border-radius, 0.375rem));
  font-weight: 600;
  font-size: 0.92rem;
  background: #fff;
  color: #5c4a1f;
  border: 1px solid rgba(192, 57, 43, 0.35);
  box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.06);
}

.favorite-toggle-labeled.is-favorite {
  color: #c0392b;
  border-color: #c0392b;
}

.favorite-toggle-labeled .favorite-toggle-icon {
  display: inline-flex;
  font-size: 1rem;
  color: #c0392b;
}

.board-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

.board-filter-check input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
}

.chat-recipe-bag {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  z-index: 2;
}

.bag-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  cursor: pointer;
  line-height: 1;
  color: inherit;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bag-toggle-btn:focus-visible {
  outline: 2px solid var(--cui-primary);
  outline-offset: 2px;
}

.bag-toggle-fab {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  color: #fff;
  background: var(--cui-primary);
  box-shadow: 0 0.35rem 0.85rem rgba(0, 0, 0, 0.22);
}

.bag-toggle-fab .bag-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.bag-toggle-fab:hover {
  transform: scale(1.06);
  background: var(--cui-primary);
  color: #fff;
  filter: brightness(1.08);
}

.bag-toggle-fab.is-in-bag {
  background: var(--cui-success, #2eb85c);
  box-shadow: 0 0.35rem 0.9rem rgba(46, 184, 92, 0.35);
}

.bag-toggle-fab.is-in-bag:hover {
  background: var(--cui-success, #2eb85c);
  filter: brightness(1.06);
}

.bag-toggle-labeled {
  min-height: 2.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--cui-btn-border-radius, var(--cui-border-radius, 0.375rem));
  font-weight: 600;
  font-size: 0.92rem;
  background: #fff;
  color: var(--cui-primary, var(--sage, #3e7b5c));
  border: 1px solid var(--cui-primary, #5856d6);
  box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.06);
}

.bag-toggle-labeled .bag-toggle-icon {
  display: inline-flex;
  font-size: 1rem;
  color: var(--cui-primary);
}

.bag-toggle-labeled.is-in-bag {
  background: var(--cui-success, #2eb85c);
  color: #fff;
  border-color: var(--cui-success, #2eb85c);
}

.bag-toggle-labeled.is-in-bag .bag-toggle-icon {
  color: #fff;
}

.bag-toggle-labeled:hover {
  border-color: var(--cui-primary, #5856d6);
  filter: brightness(0.98);
}

.bag-toggle-labeled.is-in-bag:hover,
.bag-toggle-labeled.is-in-bag:focus-visible,
.bag-toggle-labeled.is-in-bag:active {
  background: var(--cui-success, #2eb85c);
  border-color: var(--cui-success, #2eb85c);
  filter: brightness(1.04);
}

.chat-recipe-bag .bag-toggle-fab {
  width: 2rem;
  height: 2rem;
}

.chat-recipe-bag .bag-toggle-fab .bag-toggle-icon {
  font-size: 0.95rem;
}

.bag-meal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mealplan-page-header {
  position: relative;
  padding-right: 8.5rem;
}

.mealplan-saved-plans-link {
  position: absolute;
  top: 0;
  right: 0;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .mealplan-page-header {
    padding-right: 0;
  }

  .mealplan-saved-plans-link {
    display: none;
  }
}

.bag-meal-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.bag-meal-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.bag-meal-link > .min-w-0 {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.bag-meal-thumb {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.65rem;
  object-fit: cover;
  flex: 0 0 auto;
  background: #eef1f4;
}

.bag-meal-item > .btn {
  flex: 0 0 auto;
  align-self: center;
}

.bag-shopping-list {
  padding-left: 1.15rem;
  margin-bottom: 1.15rem;
}

.bag-shopping-list:last-child {
  margin-bottom: 0;
}

.bag-shopping-list li {
  margin-bottom: 0.4rem;
}

.shopping-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.5rem;
}

.shopping-needs-review-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: baseline;
}

.shopping-line-text {
  min-width: 0;
}

.bag-aisle-heading {
  margin: 0.35rem 0 0.55rem;
  font-family: var(--cui-body-font-family, system-ui, sans-serif) !important;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cui-secondary-color, #6c757d);
}

.bag-save-overlay {
  position: fixed;
  inset: 0;
  z-index: 1310;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.bag-save-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bag-save-dialog {
  width: min(24rem, 100%);
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.bag-save-overlay.is-open .bag-save-dialog {
  opacity: 1;
  transform: translateY(0);
}

/* Shopping list create/recreate busy modal — full-screen takeover */
body:has(.shop-busy-overlay.is-open),
body:has(.bag-save-overlay.is-open) {
  overflow: hidden;
}

.shop-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 1320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.shop-busy-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.shop-busy-dialog {
  width: min(32rem, 100%);
  border: 0;
  box-shadow: none !important;
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.shop-busy-overlay.is-open .shop-busy-dialog {
  opacity: 1;
  transform: translateY(0);
}

.shop-busy-message {
  min-height: 1.5rem;
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--cui-body-color, inherit);
  transition: opacity 0.25s ease;
}

.shop-busy-track {
  height: 0.55rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--cui-tertiary-bg, #e9ecef);
}

.shop-busy-bar {
  height: 100%;
  width: 4%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cui-primary, #5856d6), #2eb85c);
  animation: shop-busy-progress var(--shop-busy-duration, 1.5s) cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes shop-busy-progress {
  0% {
    width: 4%;
  }

  15% {
    width: 18%;
  }

  40% {
    width: 42%;
  }

  70% {
    width: 68%;
  }

  100% {
    width: 92%;
  }
}

.bag-history-list .list-group-item {
  border-radius: var(--cui-card-border-radius, 1.25rem) !important;
  margin-bottom: 0.55rem;
  border: 0;
  box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.06);
  padding: 1.15rem 1.25rem;
}

.bag-history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  overflow: hidden;
}

.bag-history-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.bag-history-copy {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.bag-history-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bag-history-meta {
  font-size: 0.875rem;
  color: var(--cui-secondary-color, #6c757d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bag-thumb-stack {
  --bag-thumb-size: 2.35rem;
  --bag-thumb-overlap: 0.7rem;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding-right: var(--bag-thumb-overlap);
}

.bag-thumb-stack-item,
.bag-thumb-stack-more {
  width: var(--bag-thumb-size);
  height: var(--bag-thumb-size);
  border-radius: 50%;
  border: 2px solid var(--cui-body-bg, #fff);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
  flex: 0 0 auto;
  margin-right: calc(var(--bag-thumb-overlap) * -1);
  position: relative;
}

.bag-thumb-stack-item {
  object-fit: cover;
  background: #eef1f4;
}

.bag-thumb-stack-item:nth-child(1) { z-index: 5; }
.bag-thumb-stack-item:nth-child(2) { z-index: 4; }
.bag-thumb-stack-item:nth-child(3) { z-index: 3; }
.bag-thumb-stack-item:nth-child(4) { z-index: 2; }
.bag-thumb-stack-item:nth-child(5) { z-index: 1; }

.bag-thumb-stack-more {
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  color: var(--cui-body-color, #323a49);
  background: color-mix(in srgb, var(--cui-secondary-bg, #e7eaee) 88%, #fff);
}

.bag-history-arrow {
  flex: 0 0 auto;
  color: var(--cui-secondary-color, #6c757d);
  font-size: 1.05rem;
}

@media (max-width: 575.98px) {
  .bag-history-meta-time {
    display: none;
  }

  .bag-thumb-stack {
    --bag-thumb-size: 2rem;
    --bag-thumb-overlap: 0.6rem;
  }

  .bag-meal-thumb {
    width: 3rem;
    height: 3rem;
  }

  .recipe-pin-bag .bag-toggle-fab {
    width: 2.15rem;
    height: 2.15rem;
  }
}

/* —— Go Shopping trip page —— */
.shop-page {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  min-height: 100vh;
  background: #fff;
}

.shop-header {
  position: relative;
  padding-right: 3rem;
}

.shop-print-btn {
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  background: transparent;
  color: var(--cui-body-color, inherit);
  box-shadow: none;
}

.shop-print-btn:hover,
.shop-print-btn:focus-visible {
  border: 0;
  background: transparent;
  color: var(--cui-primary, #3e7b5c);
  box-shadow: none;
}

.shop-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cui-secondary-color, #6c757d);
}

.shop-title {
  font-size: clamp(1.85rem, 6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.35rem;
}

.shop-meta {
  font-size: 1.05rem;
}

#checkedCount {
  display: inline-block;
  min-width: 1ch;
  font-weight: 700;
  color: var(--cui-primary, #3e7b5c);
  transform-origin: center bottom;
}

#checkedCount.is-count-bump,
#toggleCheckedCount.is-count-bump {
  animation: shop-count-bump 0.55s ease;
}

.shop-meta.is-count-bump {
  animation: shop-meta-flash 0.55s ease;
}

@keyframes shop-count-bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.35);
    color: #2eb85c;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shop-meta-flash {
  0%,
  100% {
    filter: none;
  }
  40% {
    filter: brightness(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  #checkedCount.is-count-bump,
  #toggleCheckedCount.is-count-bump,
  .shop-meta.is-count-bump {
    animation: none;
  }
}

.shop-presence {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--cui-primary, #3e7b5c);
}

.shop-presence.is-active {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.shop-presence.is-active::before {
  content: "";
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #2eb85c;
  box-shadow: 0 0 0 0.15rem rgba(46, 184, 92, 0.2);
  flex: 0 0 auto;
}

.shop-presence.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: -0.275rem;
  border-radius: 999px;
  background: #2eb85c;
  pointer-events: none;
  animation: shop-presence-ping 1.8s ease-out infinite;
}

@keyframes shop-presence-ping {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(2.6);
    opacity: 0;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-presence.is-active::after {
    animation: none;
    opacity: 0;
  }
}

.shop-name-form {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: #fff;
  box-shadow: 0 0.1rem 0.35rem rgba(15, 23, 42, 0.06);
}

.shop-name-panel {
  margin: 0 0 1rem;
}

.shop-name-saved {
  margin: 0;
  font-size: 0.92rem;
  color: var(--cui-secondary-color, #6c757d);
}

.shop-name-change {
  margin-left: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cui-primary, #3e7b5c);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.shop-name-change:hover {
  color: var(--cui-primary, #3e7b5c);
  filter: brightness(0.9);
}

.shop-name-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cui-secondary-color, #6c757d);
}

.shop-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.shop-name-row .form-control {
  flex: 1 1 12rem;
  min-width: 0;
}

.shop-name-hint {
  margin-top: 0.45rem;
}

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.15rem 0 1.5rem;
}

.shop-toolbar .shop-finish-trip {
  margin-left: auto;
}

.shop-toolbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.shop-checked-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: -0.35rem 0 1.25rem;
  padding: 0;
  padding-left: 0;
  min-height: 0;
  border: 0;
  background: transparent;
}

.shop-checked-toggle .form-check-input {
  position: static;
  float: none;
  flex: 0 0 auto;
  width: 2.5rem;
  margin: 0;
  margin-left: 0;
  cursor: pointer;
}

.shop-checked-toggle .form-check-label {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cui-body-color, #212529);
  cursor: pointer;
  user-select: none;
}

.shop-extra-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.shop-extra-form .form-control {
  flex: 1 1 12rem;
  min-width: 0;
}

.shop-share-hint {
  margin: 0 0 1rem;
}

.shop-extra-badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cui-primary, #3e7b5c);
  background: rgba(62, 123, 92, 0.12);
  vertical-align: 0.1em;
}

.shop-aisle {
  margin-bottom: 1.35rem;
}

.shop-aisle-heading {
  margin: 0 0 0.55rem;
  font-family: var(--cui-body-font-family, system-ui, sans-serif) !important;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cui-secondary-color, #6c757d);
}

.shop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 0.85rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0.1rem 0.35rem rgba(15, 23, 42, 0.06);
}

.shop-item {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
  opacity: 1;
  max-height: 12rem;
  transition:
    opacity 0.35s ease,
    max-height 0.35s ease,
    border-color 0.35s ease;
}

.shop-item:last-child {
  border-bottom: 0;
}

.shop-item-label {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  margin: 0;
  padding: 1.1rem 1.05rem;
  min-height: 3.6rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: pan-y;
  transition: padding 0.35s ease, min-height 0.35s ease;
}

.shop-check {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  margin-top: 0.1rem;
  accent-color: var(--cui-success, #2eb85c);
  cursor: pointer;
}

.shop-item-text {
  flex: 1 1 auto;
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--cui-body-color, #212529);
  transition: color 0.15s ease, opacity 0.15s ease;
}

.shop-item.is-checked .shop-item-text,
.shop-item.is-checked .shopping-line-text {
  text-decoration: line-through;
  color: var(--cui-secondary-color, #6c757d);
  opacity: 0.72;
}

.shop-item.is-checked .shopping-needs-review-badge {
  opacity: 0.65;
  text-decoration: none;
}

/* Brief hold, then fade/collapse before leaving the list. */
.shop-page:not(.show-checked) .shop-item.is-checking-off {
  opacity: 0;
  max-height: 0;
  border-color: transparent;
  pointer-events: none;
  transition-delay: 0.45s;
}

.shop-page:not(.show-checked) .shop-item.is-checking-off .shop-item-label {
  padding-top: 0;
  padding-bottom: 0;
  min-height: 0;
  transition-delay: 0.45s;
}

/* Fully removed after the fade (also used for already-checked on load). */
.shop-page:not(.show-checked) .shop-item.is-settled {
  display: none;
}

.shop-page:not(.show-checked) .shop-aisle:not(:has(.shop-item:not(.is-settled))) {
  display: none;
}

@media print {
  body {
    background: #fff !important;
  }

  .shop-page {
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 0;
    background: #fff !important;
  }

  .no-print,
  .shop-toolbar,
  .toast-container {
    display: none !important;
  }

  .shop-list {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .shop-item {
    break-inside: avoid;
  }

  .shop-item-label {
    padding: 0.45rem 0.55rem;
    min-height: 0;
  }

  .shop-item-text {
    font-size: 11pt;
  }

  .shop-page:not(.show-checked) .shop-item.is-checked,
  .shop-page:not(.show-checked) .shop-item.is-settled,
  .shop-page:not(.show-checked) .shop-aisle:not(:has(.shop-item:not(.is-settled))) {
    display: revert;
  }

  .shop-aisle {
    display: block !important;
  }

  .shop-item.is-checked,
  .shop-item.is-settled {
    display: list-item !important;
    opacity: 1 !important;
    max-height: none !important;
  }
}

/* —— Anonymous splash / marketing landing —— */
.splash-shell {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(var(--cui-primary-rgb, 88, 86, 214), 0.14), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(var(--cui-primary-rgb, 88, 86, 214), 0.08), transparent 50%),
    rgba(var(--cui-light-rgb), 0.55);
}

.splash-header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  margin-bottom: 0 !important;
}

.splash-body {
  padding: 0;
  overflow-x: clip;
}

.splash-footer.footer {
  border-top: none;
  min-height: 0;
  flex: 0 0 auto;
  padding: 0.5rem 1rem 1rem;
  text-align: center;
  color: var(--cui-secondary-color, #8a93a2);
  font-size: 0.75rem;
  opacity: 0.75;
}

.splash-section {
  --splash-section-x: clamp(2.75rem, 14vw, 10rem);
  padding-inline: var(--splash-section-x);
  width: 100%;
}

.splash-section-inner {
  width: 100%;
  max-width: 54rem;
  margin-inline: auto;
}

.splash-section .row {
  --bs-gutter-x: 2rem;
  --bs-gutter-y: 2.25rem;
  margin-inline: 0;
}

@media (min-width: 992px) {
  .splash-section .row {
    --bs-gutter-x: 2.75rem;
    --bs-gutter-y: 2.75rem;
  }
}

.splash-hero {
  position: relative;
  /* One full screen below the header — content below starts on scroll */
  min-height: calc(100vh - var(--app-topbar-height));
  min-height: calc(100svh - var(--app-topbar-height));
  min-height: calc(100dvh - var(--app-topbar-height));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2rem 0;
  text-align: center;
  box-sizing: border-box;
}

.splash-hero-glow {
  position: absolute;
  inset: 8% auto auto 50%;
  width: min(48vw, 32rem);
  height: min(48vw, 32rem);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--cui-primary-rgb, 88, 86, 214), 0.2), transparent 70%);
  pointer-events: none;
  transform: translateX(-50%);
  animation: splash-float 9s ease-in-out infinite;
}

.splash-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin-inline: auto;
  animation: splash-rise 0.7s ease-out both;
}

.splash-hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
}

.splash-brand {
  font-size: clamp(3.75rem, 2.6rem + 6vw, 6.25rem) !important;
  line-height: 1.15 !important;
  display: block;
  color: var(--cui-body-color);
}

.splash-pronunciation {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  font-style: italic;
  max-width: 28rem;
  margin-inline: auto;
  opacity: 0.88;
}

.splash-headline {
  font-family: var(--cui-body-font-family, system-ui, sans-serif) !important;
  font-weight: 600;
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2rem);
  line-height: 1.25;
  max-width: none;
  margin-inline: auto;
}

.splash-lede {
  font-size: 1.1rem;
  line-height: 1.65;
  max-width: 36rem;
  margin-inline: auto;
}

.splash-cta {
  justify-content: center;
}

.splash-cta .btn {
  animation: splash-rise 0.7s ease-out 0.12s both;
}

.splash-how,
.splash-audience,
.splash-features,
.splash-closing {
  text-align: center;
}

.splash-section-lede {
  max-width: 36rem;
  margin-inline: auto;
  line-height: 1.65;
  margin-bottom: clamp(2rem, 4vh, 3rem) !important;
}

.splash-how {
  padding-top: clamp(5rem, 14vh, 10rem);
  padding-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

.splash-steps,
.splash-feature-row {
  text-align: left;
}

.splash-step,
.splash-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  text-align: left;
  animation: splash-rise 0.65s ease-out both;
}

.splash-step:nth-child(2),
.splash-feature:nth-child(2) {
  animation-delay: 0.08s;
}

.splash-step:nth-child(3),
.splash-feature:nth-child(3) {
  animation-delay: 0.16s;
}

.splash-step-copy,
.splash-feature-copy {
  min-width: 0;
}

.splash-step h3,
.splash-feature h3 {
  font-family: var(--cui-body-font-family, system-ui, sans-serif) !important;
  font-weight: 600;
  line-height: 1.25;
}

.splash-step-num,
.splash-feature-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
  font-weight: 600;
  line-height: 1;
  color: var(--cui-primary);
  background: rgba(var(--cui-primary-rgb), 0.12);
}

.splash-step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-size: 0.9rem;
}

.splash-feature-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  font-size: 1.1rem;
}

.splash-audience {
  padding-top: clamp(4rem, 10vh, 7.5rem);
  padding-bottom: clamp(3rem, 7vh, 5rem);
}

.splash-audience-card {
  text-align: left;
  padding: 2.15rem 2.35rem;
  border-radius: var(--cui-card-border-radius, 1.25rem);
  background: #fff;
  box-shadow: var(--cui-box-shadow-sm, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
  animation: splash-rise 0.65s ease-out both;
}

.splash-audience .col-lg-6:nth-child(2) .splash-audience-card {
  animation-delay: 0.1s;
}

.splash-audience-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cui-primary);
  margin-bottom: 0;
}

.splash-audience-list {
  padding-left: 1.15rem;
  margin-bottom: 0;
}

.splash-step p,
.splash-feature p,
.splash-audience-card p {
  line-height: 1.65;
}

.splash-audience-list li + li {
  margin-top: 0.65rem;
}

.splash-features {
  padding-top: clamp(4rem, 10vh, 7.5rem);
  padding-bottom: clamp(3.5rem, 8vh, 6rem);
}

.splash-section-title {
  font-family: var(--cui-body-font-family, system-ui, sans-serif) !important;
  font-weight: 600;
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.75rem);
  margin-bottom: 0.75rem;
}

.splash-closing {
  padding-top: clamp(4rem, 10vh, 7.5rem);
  padding-bottom: clamp(3rem, 8vh, 5.5rem);
}

.splash-closing-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  padding: 2.35rem 2.5rem;
  border-radius: var(--cui-card-border-radius, 1.25rem);
  background: #fff;
  box-shadow: var(--cui-box-shadow-sm, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
  animation: splash-rise 0.65s ease-out 0.1s both;
}

.splash-closing-copy {
  flex: 1 1 16rem;
  text-align: left;
}

.splash-closing-copy .splash-section-title {
  margin-bottom: 0.35rem;
}

@keyframes splash-rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes app-main-enter {
  from {
    opacity: 0;
    transform: translateY(0.4rem);
  }
  to {
    opacity: 1;
    /* `none` — not translateY(0) — so we don't leave a stacking context that
       traps page modals under the body-level .modal-backdrop. */
    transform: none;
  }
}

/* Hide during HTMX swap / enter restart so soft-nav never flashes opaque. */
#app-main.app-main-enter-pending {
  opacity: 0;
}

#app-main.app-main-enter-pending:has(.board-sticky-chrome) {
  opacity: 1;
}

#app-main.app-main-enter-pending:has(.board-sticky-chrome) #boardResults {
  opacity: 0;
}

#app-main.app-main-enter {
  animation: app-main-enter 0.38s ease-out both;
}

/* Board: keep sticky filters opaque during enter — parent opacity would
   briefly reveal recipe cards sitting under the chrome. */
#app-main.app-main-enter:has(.board-sticky-chrome) {
  animation: none;
}

#app-main.app-main-enter:has(.board-sticky-chrome) #boardResults {
  animation: app-main-enter 0.38s ease-out both;
}

/* Global HTMX page-nav spinner (boosted #app-main swaps only). */
.global-nav-loading {
  position: fixed;
  inset: 0;
  z-index: 1095;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.global-nav-loading.is-visible {
  opacity: 1;
}

.global-nav-loading-spinner {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--cui-primary, #3e7b5c) 22%, transparent);
  border-top-color: var(--cui-primary, #3e7b5c);
  background: color-mix(in srgb, #fff 88%, transparent);
  box-shadow:
    0 0 0 0.65rem color-mix(in srgb, #fff 75%, transparent),
    0 0.4rem 1.1rem rgba(37, 74, 55, 0.12);
  animation: global-nav-spin 0.7s linear infinite;
}

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

@keyframes splash-float {
  0%,
  100% {
    transform: translateX(-50%) translate(0, 0) scale(1);
  }
  50% {
    transform: translateX(-50%) translate(-0.5rem, 0.75rem) scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-ios-back,
  .chat-overlay,
  .chat-panel,
  .cook-mode,
  .cook-mode-page,
  .bag-save-overlay,
  .bag-save-dialog,
  .shop-busy-overlay,
  .shop-busy-dialog,
  .board-filters-panel,
  .board-filters-chevron {
    transition: none;
  }

  .chat-panel,
  .cook-mode-page,
  .bag-save-dialog,
  .shop-busy-dialog,
  .board-filters-panel {
    transform: none;
  }

  .global-nav-loading {
    transition: none;
  }

  .global-nav-loading-spinner {
    animation: none;
    border-top-color: color-mix(in srgb, var(--cui-primary, #3e7b5c) 22%, transparent);
    border-color: var(--cui-primary, #3e7b5c);
  }

  .splash-hero-glow,
  .splash-hero-inner,
  .splash-cta .btn,
  .splash-step,
  .splash-audience-card,
  .splash-feature,
  .splash-closing-panel {
    animation: none !important;
  }

  #app-main.app-main-enter,
  #app-main.app-main-enter:has(.board-sticky-chrome) #boardResults,
  #app-main.app-main-enter-pending,
  #app-main.app-main-enter-pending:has(.board-sticky-chrome) #boardResults {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.admin-page {
  width: 100%;
}

.admin-shell-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0;
  border-bottom: 1px solid var(--cui-border-color, #eeeff3);
}

.admin-shell-tabs {
  --cui-nav-underline-gap: 1.25rem;
  --cui-nav-underline-border-width: 2px;
  --cui-nav-underline-border-link-active-color: var(--sage, #3e7b5c);
  --cui-nav-link-color: var(--cui-secondary-color, #6c757d);
  --cui-nav-link-hover-color: var(--sage, #3e7b5c);
  gap: var(--cui-nav-underline-gap, 1.25rem);
  margin-bottom: -1px;
}

.admin-shell-tabs .nav-link {
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.55rem 0.1rem;
  border-bottom-width: 2px;
  text-decoration: none;
}

.admin-shell-tabs .nav-link.active {
  color: var(--sage, #3e7b5c);
  border-bottom-color: var(--sage, #3e7b5c);
}

.admin-shell-aux,
.admin-shell-count {
  font-size: 0.875rem;
  color: var(--cui-secondary-color, #6c757d);
  text-decoration: none;
  padding-bottom: 0.55rem;
}

.admin-shell-aux:hover {
  color: var(--sage, #3e7b5c);
  text-decoration: underline;
}

.admin-tools-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.admin-tools-lede {
  font-size: 0.95rem;
  color: var(--cui-secondary-color, #6c757d);
  margin: 0 0 1.25rem;
}

.admin-tools-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--cui-border-color, #eeeff3);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--cui-body-bg, #fff);
}

.admin-tools-list > li + li {
  border-top: 1px solid var(--cui-border-color, #eeeff3);
}

.admin-tools-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.95rem 1.1rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.12s ease;
}

.admin-tools-link:hover {
  color: inherit;
  background: color-mix(in srgb, var(--sage-subtle, #e7f2eb) 55%, #fff);
}

.admin-tools-link-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--sage, #3e7b5c);
}

.admin-tools-link-desc {
  font-size: 0.86rem;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-inbox-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-inbox-filters .form-select {
  width: auto;
  min-width: 8.5rem;
}

.admin-inbox-clear {
  font-size: 0.875rem;
  text-decoration: none;
}

.admin-inbox-clear:hover {
  text-decoration: underline;
}

.admin-inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.35rem;
}

.admin-inbox-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.admin-inbox-select-all input {
  margin: 0;
}

.admin-inbox-selected {
  font-size: 0.8rem;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-list-card {
  overflow: hidden;
}

.admin-list-card .admin-inbox-list,
.admin-list-card .admin-roadmap-list {
  margin: 0;
}

.admin-list-card .admin-inbox-row,
.admin-list-card .admin-roadmap-item {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.admin-list-card .admin-inbox-row:first-child,
.admin-list-card .admin-roadmap-item:first-child {
  border-top: 0;
}

.admin-list-card .admin-inbox-row:last-child,
.admin-list-card .admin-roadmap-item:last-child,
.admin-roadmap-group .admin-list-card .admin-roadmap-item:last-child {
  border-bottom: 0;
}

.admin-inbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-inbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--cui-border-color, #eeeff3);
}

.admin-inbox-row:last-child {
  border-bottom: 1px solid var(--cui-border-color, #eeeff3);
}

.admin-inbox-row.is-new .admin-inbox-title {
  font-weight: 700;
}

.admin-inbox-row.is-closed {
  opacity: 0.62;
}

.admin-inbox-check {
  padding-top: 0.2rem;
}

.admin-inbox-check .form-check-input {
  margin: 0;
}

.admin-inbox-link {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.admin-inbox-link:hover {
  color: inherit;
}

.admin-inbox-link:hover .admin-inbox-title {
  color: var(--sage, #3e7b5c);
}

.admin-inbox-link-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.admin-inbox-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.admin-inbox-when {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-inbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-inbox-meta-accent {
  color: var(--sage, #3e7b5c);
  font-weight: 600;
}

.admin-inbox-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #5c6570;
}

.admin-detail-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-detail-nav a {
  color: var(--cui-link-color, var(--sage));
  text-decoration: none;
}

.admin-detail-nav a:hover {
  text-decoration: underline;
}

.admin-detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.35rem;
}

.admin-detail-title {
  margin: 0 0 0.35rem;
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.admin-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-detail-meta-accent {
  color: var(--sage, #3e7b5c);
  font-weight: 600;
}

.admin-detail-content {
  margin-bottom: 0.75rem;
}

.admin-detail-body {
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-detail-summary {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--cui-border-color, #eeeff3);
}

.admin-detail-summary > p {
  margin: 0;
  font-size: 0.975rem;
  line-height: 1.55;
  color: #4a5560;
}

.admin-detail-summary-label {
  margin-bottom: 0.35rem !important;
  font-size: 0.8rem !important;
  font-weight: 600;
  color: var(--cui-secondary-color, #6c757d) !important;
}

.admin-detail-tags {
  margin-top: 0.5rem !important;
  font-size: 0.8rem !important;
  color: var(--cui-secondary-color, #6c757d) !important;
}

.admin-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0 0 2rem;
}

.admin-detail-actions .btn-link {
  color: var(--cui-secondary-color, #6c757d);
  text-decoration: none;
}

.admin-detail-actions .btn-link:hover {
  color: var(--sage, #3e7b5c);
  text-decoration: underline;
}

.admin-detail-decisions {
  scroll-margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cui-border-color, #eeeff3);
  margin-bottom: 1.75rem;
}

.admin-detail-decisions > h2 {
  margin: 0 0 1rem;
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.admin-detail-card .admin-detail-foot {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.admin-detail-note {
  margin-bottom: 1.15rem;
}

.admin-detail-note .form-control {
  font-size: 0.95rem;
  line-height: 1.45;
  border-radius: 0.65rem;
}

.admin-detail-note-new {
  padding-top: 0.85rem;
  border-top: 1px dashed var(--cui-border-color, #eeeff3);
}

.admin-detail-note-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.admin-detail-note-row .form-select {
  width: auto;
  min-width: 6.5rem;
}

.admin-detail-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.admin-detail-check input {
  margin: 0;
}

.admin-detail-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.admin-detail-status .form-select {
  width: auto;
  min-width: 6.5rem;
}

.admin-detail-foot {
  margin: 0;
  font-size: 0.8rem;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-roadmap-empty {
  margin: 0.5rem 0 0;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-roadmap-empty a {
  text-decoration: none;
}

.admin-roadmap-empty a:hover {
  text-decoration: underline;
}

.admin-roadmap-group {
  margin-bottom: 1.75rem;
}

.admin-roadmap-group-title {
  margin: 0 0 0.35rem;
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cui-secondary-color, #6c757d);
}

.admin-roadmap-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-roadmap-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--cui-border-color, #eeeff3);
}

.admin-roadmap-group .admin-roadmap-item:last-child {
  border-bottom: 1px solid var(--cui-border-color, #eeeff3);
}

.admin-roadmap-item-body {
  flex: 1 1 16rem;
  min-width: 0;
}

.admin-roadmap-note {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-roadmap-source {
  display: inline-block;
  font-size: 0.875rem;
  text-decoration: none;
}

.admin-roadmap-source:hover {
  text-decoration: underline;
}

.admin-roadmap-source span {
  color: var(--cui-secondary-color, #6c757d);
}

.admin-roadmap-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  flex: 0 0 auto;
}

.admin-roadmap-priority-form .form-select {
  width: auto;
  min-width: 4.5rem;
}

.admin-roadmap-item-actions .btn-link {
  color: var(--cui-secondary-color, #6c757d);
  text-decoration: none;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.admin-roadmap-item-actions .btn-link:hover {
  color: var(--cui-danger, #e55353);
  text-decoration: underline;
}

/* —— Digest intake (paste URLs & go) —— */
.digest-page {
  width: 100%;
}

.digest-page-intake {
  max-width: 40rem;
  margin-inline: auto;
}

.digest-intake {
  position: relative;
  padding: 1.25rem 0 0.5rem;
}

.digest-intake-kicker,
.digest-repair-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage, #3e7b5c);
  margin: 0;
}

.digest-intake-title {
  font-family: var(--app-display-font, "Sacramento", cursive);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  line-height: 1.05;
  font-weight: 400;
  color: var(--cui-body-color, #212631);
  margin: 0 0 0.65rem;
}

.digest-intake-lede {
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--cui-secondary-color, #5c636a);
  max-width: 32rem;
  margin: 0 0 1.5rem;
}

.digest-intake-alert {
  margin-bottom: 1.25rem;
}

.digest-dropzone-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.digest-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  padding: 1.25rem 1.2rem 1.1rem;
  border: 2px dashed color-mix(in srgb, var(--sage, #3e7b5c) 45%, #cfd8d2);
  border-radius: 1.1rem;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--sage-subtle, #e7f2eb) 80%, transparent), transparent 55%),
    linear-gradient(180deg, #fff 0%, color-mix(in srgb, var(--sage-subtle, #e7f2eb) 35%, #fff) 100%);
  cursor: text;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.digest-dropzone.is-focused,
.digest-dropzone.has-links {
  border-color: var(--sage, #3e7b5c);
  box-shadow: 0 0.55rem 1.4rem rgba(var(--sage-rgb, 62, 123, 92), 0.12);
}

.digest-dropzone.is-dragging {
  border-style: solid;
  border-color: var(--sage, #3e7b5c);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 0.75rem 1.75rem rgba(var(--sage-rgb, 62, 123, 92), 0.16);
}

.digest-dropzone-art {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--sage, #3e7b5c);
  color: #fff;
  font-size: 1.35rem;
}

.digest-dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.digest-dropzone-headline {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cui-body-color, #212631);
}

.digest-dropzone-hint {
  font-size: 0.88rem;
  color: var(--cui-secondary-color, #5c636a);
}

.digest-dropzone-input {
  width: 100%;
  min-height: 8.5rem;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--sage, #3e7b5c) 18%, #dce3df);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  /* iOS Safari zooms the viewport when focused inputs are < 16px. */
  font-size: max(1rem, 16px);
  line-height: 1.45;
  resize: vertical;
  color: inherit;
  /* Keep the focused field from scrolling oddly inside the modal on iPhone. */
  touch-action: manipulation;
}

.digest-dropzone-input:focus {
  outline: 2px solid color-mix(in srgb, var(--sage, #3e7b5c) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--sage, #3e7b5c);
}

.digest-dropzone-input::placeholder {
  color: #9aa7a0;
}

.digest-dropzone-count {
  align-self: flex-start;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--sage, #3e7b5c);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.digest-dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.digest-dropzone-go {
  min-width: 10.5rem;
}

.digest-dropzone-cancel {
  color: var(--cui-secondary-color, #5c636a);
  text-decoration: none;
}

.digest-dropzone-cancel:hover {
  color: var(--sage, #3e7b5c);
}

.digest-intake-modal {
  padding-top: 0;
}

.digest-intake-modal .digest-intake-title {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
}

.digest-modal-content {
  border: 0;
  border-radius: 1.15rem;
  overflow: hidden;
}

.digest-needs-review {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--cui-border-color, #eeeff3);
}

.digest-needs-review-head {
  margin-bottom: 1rem;
}

.digest-needs-review-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.digest-needs-review-sub {
  font-size: 0.92rem;
}

.digest-needs-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.digest-needs-review-card {
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.digest-needs-review-card:hover {
  color: inherit;
  box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.1);
}

.digest-needs-review-body {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
}

.digest-needs-review-main {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
}

.digest-needs-review-main:hover {
  color: inherit;
}

.digest-needs-review-discard {
  flex: 0 0 auto;
  margin-top: 0.15rem;
}

.digest-needs-review-thumb {
  flex: 0 0 4.75rem;
  width: 4.75rem;
  height: 4.75rem;
  border-radius: var(--cui-border-radius, 0.375rem);
  overflow: hidden;
  background: #eef1f4 url('/images/recipe-placeholder.png') center / cover no-repeat;
}

.digest-needs-review-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.digest-needs-review-thumb.is-empty img {
  display: none;
}

.digest-needs-review-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
}

.digest-needs-review-title {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
}

.digest-needs-review-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.digest-quality-badge {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.digest-quality-badge-lg {
  font-size: 1rem;
  padding: 0.45em 0.7em;
}

.digest-needs-review-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.digest-needs-review-reasons .badge {
  font-weight: 500;
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

.btn-outline-sage {
  --cui-btn-color: var(--sage, #3e7b5c);
  --cui-btn-border-color: var(--sage, #3e7b5c);
  --cui-btn-hover-color: #fff;
  --cui-btn-hover-bg: var(--sage, #3e7b5c);
  --cui-btn-hover-border-color: var(--sage, #3e7b5c);
  --cui-btn-active-color: #fff;
  --cui-btn-active-bg: var(--sage, #3e7b5c);
  --cui-btn-active-border-color: var(--sage, #3e7b5c);
  color: var(--cui-btn-color);
  border-color: var(--cui-btn-border-color);
  background: transparent;
}

.btn-outline-sage:hover,
.btn-outline-sage:focus {
  color: var(--cui-btn-hover-color);
  background: var(--cui-btn-hover-bg);
  border-color: var(--cui-btn-hover-border-color);
}

.digest-needs-review-main:hover .digest-needs-review-title {
  color: var(--cui-primary, var(--sage, #3e7b5c));
}

.digest-needs-review-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.4;
}

.digest-needs-review-meta {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.digest-preview {
  width: 100%;
}

.digest-preview-layout {
  display: grid;
  gap: 1.5rem;
}

.digest-preview-fields {
  order: 1;
  min-width: 0;
}

.digest-preview-media {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.digest-preview-card {
  height: 100%;
}

@media (min-width: 768px) {
  .digest-preview-layout {
    grid-template-columns: minmax(0, 1fr) 15rem;
    gap: 1.75rem 2rem;
    align-items: start;
  }

  .digest-preview-media {
    position: sticky;
    top: calc(var(--app-topbar-height) + 1rem);
  }
}

.digest-preview-image {
  aspect-ratio: 1 / 1;
  border-radius: var(--cui-border-radius, 0.375rem);
  overflow: hidden;
  background: #eef1f4 url('/images/recipe-placeholder.png') center / cover no-repeat;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.14);
}

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

.digest-preview-image.is-empty img {
  display: none;
}

.digest-preview-source {
  text-align: center;
}

.digest-preview-source a {
  color: var(--cui-primary, var(--sage, #3e7b5c));
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.digest-preview-source a:hover {
  text-decoration: underline;
}

.digest-preview-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cui-border-color, #eeeff3);
}

.digest-preview-section:last-of-type,
.digest-preview-section-last {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.digest-preview-section-title {
  margin: 0 0 0.85rem;
  font-family: var(--cui-body-font-family, system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cui-secondary-color, #6c757d);
}

.digest-dietary-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.digest-dietary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--cui-border-color, #dbdfe6);
  border-radius: var(--cui-border-radius, 0.375rem);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.digest-dietary-chip input {
  margin: 0;
  accent-color: var(--cui-primary, var(--sage, #3e7b5c));
}

.digest-dietary-chip.is-selected {
  border-color: var(--cui-primary, var(--sage, #3e7b5c));
  background: var(--sage-subtle, #e7f2eb);
  color: var(--cui-primary-text-emphasis, #254a37);
}

.digest-preview-lines {
  font-family: var(--cui-font-monospace, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 0.92rem;
  line-height: 1.5;
}

.digest-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cui-border-color, #eeeff3);
}

.header-notifications-toggle.dropdown-toggle::after {
  display: none;
}

.notifications-dropdown {
  width: min(23.5rem, calc(100vw - 1.25rem));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cui-border-color, #e5e8ef);
  border-radius: 0.85rem;
  box-shadow:
    0 0.5rem 1.25rem rgba(33, 38, 49, 0.12),
    0 0.125rem 0.35rem rgba(33, 38, 49, 0.06);
}

.notifications-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem 0.7rem;
  background: var(--cui-body-bg, #fff);
  border-bottom: 1px solid var(--cui-border-color, #eeeff3);
}

.notifications-dropdown-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.notifications-dropdown-title {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.notifications-dropdown-unread-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--sage-subtle, #e7f2eb);
  color: var(--sage, #3e7b5c);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.notifications-dropdown-action {
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}

.notifications-dropdown-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.75rem 1.25rem;
  color: var(--cui-secondary-color, #5c636a);
}

.notifications-dropdown-empty > .bi {
  font-size: 1.6rem;
  color: var(--sage, #3e7b5c);
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.notifications-dropdown-empty-title {
  font-weight: 600;
  color: var(--cui-body-color, #212631);
  font-size: 0.95rem;
}

.notifications-dropdown-empty-text {
  font-size: 0.82rem;
  max-width: 16rem;
  line-height: 1.4;
}

.notifications-dropdown-list {
  max-height: min(26rem, 58vh);
  overflow-y: auto;
  background: var(--cui-tertiary-bg, #f6f7f9);
}

.notifications-dropdown-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--cui-border-color, #eeeff3);
  background: var(--cui-body-bg, #fff);
}

.notifications-dropdown-row:last-child {
  border-bottom: 0;
}

.notifications-dropdown-row.is-unread {
  background: color-mix(in srgb, var(--sage-subtle, #e7f2eb) 55%, #fff);
}

.notifications-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0.85rem 0.35rem 0.85rem 0.9rem;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.notifications-dropdown-item:hover,
.notifications-dropdown-item:focus-visible {
  background: color-mix(in srgb, var(--cui-tertiary-bg, #f3f4f7) 80%, transparent);
  outline: none;
}

.notifications-dropdown-item.is-informational {
  cursor: default;
}

.notifications-dropdown-row.is-unread .notifications-dropdown-item:hover,
.notifications-dropdown-row.is-unread .notifications-dropdown-item:focus-visible {
  background: color-mix(in srgb, var(--sage-subtle, #e7f2eb) 35%, transparent);
}

.notifications-dropdown-item-icon {
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--sage-subtle, #e7f2eb);
  color: var(--sage, #3e7b5c);
  font-size: 1.05rem;
  margin-top: 0.05rem;
}

.notifications-dropdown-row.is-unread .notifications-dropdown-item-icon {
  background: color-mix(in srgb, var(--sage, #3e7b5c) 18%, #fff);
}

.notifications-dropdown-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.notifications-dropdown-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
}

.notifications-dropdown-item-title {
  font-weight: 650;
  font-size: 0.9rem;
  line-height: 1.3;
  min-width: 0;
}

.notifications-dropdown-row.is-unread .notifications-dropdown-item-title {
  font-weight: 700;
}

.notifications-dropdown-item-text {
  font-size: 0.8rem;
  color: var(--cui-secondary-color, #5c636a);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notifications-dropdown-item-meta {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--cui-secondary-color, #5c636a);
  white-space: nowrap;
}

.notifications-dropdown-unread-dot {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.45rem;
  margin-right: 0.15rem;
  border-radius: 999px;
  background: var(--sage, #3e7b5c);
}

.notifications-dropdown-clear-form {
  display: flex;
  align-items: flex-start;
  padding: 0.45rem 0.45rem 0 0;
}

.notifications-dropdown-clear {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--cui-secondary-color, #6d7d9c);
  opacity: 0.55;
  cursor: pointer;
}

.notifications-dropdown-row:hover .notifications-dropdown-clear,
.notifications-dropdown-clear:focus-visible {
  opacity: 1;
}

.notifications-dropdown-clear:hover,
.notifications-dropdown-clear:focus-visible {
  background: var(--cui-tertiary-bg, #f3f4f7);
  color: var(--cui-danger, #e55353);
  outline: none;
}

.notifications-dropdown-footer {
  display: flex;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--cui-border-color, #eeeff3);
  background: var(--cui-body-bg, #fff);
}


