html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Specs/Settings.md, "Visuals": every color below that differs between light and dark mode goes
   through one of these variables - so a new rule should use them too, rather than a literal
   color, or it'll stay light-mode-colored in dark mode. Light values are this stylesheet's
   original colors. Dark mode is switched by data-bs-theme on <html> (_Layout.cshtml), the same
   attribute Bootstrap 5.3's own components follow. Solid fills (red/green/blue/brown buttons) and
   the white text on them are the same in both, so they stay literal. */
:root,
[data-bs-theme="light"] {
  --rb-surface: #fff;                /* buttons, inputs, panels */
  --rb-surface-disabled: #f5f5f5;
  --rb-quicklist-group-bg: #e7e9ec;
  --rb-quicklist-nav: #79520f;
  --rb-quicklist-edit: #d98b24;
  --rb-text-max: #000;
  --rb-text-strong: #333;
  --rb-text-soft: #555;
  --rb-text-muted: #666;
  --rb-text-faint: #888;
  --rb-text-fainter: #999;
  --rb-text-faintest: #ccc;
  --rb-border: #ccc;
  --rb-border-soft: #ddd;
  --rb-border-faint: #eee;
  --rb-border-strong: #999;
  --rb-link: #0077cc;
  --rb-brown: #5a3e2b;               /* active bookmarks, Combine */
  --rb-selected-bg: #eaf3ff;
  --rb-changed-bg: #e1f0ff;
  --rb-highlight-bg: #fff3b0;        /* unsaved edits, active multiplier */
  --rb-save-disabled-bg: #a9c9f5;
  --rb-danger-text: #c0392b;
  --rb-danger-border: #e0b4ac;
  --rb-danger-bg: #f8d7da;           /* delete-pending rows, 🚫 errors */
  --rb-invalid-bg: #fbe4e1;
  --rb-error-text: #842029;
  --rb-error-border: #f5c2c7;
  --rb-success-text: #2e7d32;
  --rb-success-border: #a8d5ab;
  --rb-warning-text: #8a6d3b;
  --rb-warning-border: #f0c14b;
  --rb-warning-bg: #fff8e1;
  --rb-tag-bg: #f0e6da;
  --rb-tag-locked-bg: #e2d5c3;
  --rb-tag-remove-text: #8a5a34;
  --rb-detail-tag-bg: #fdf1d6;
  --rb-tag-shared-bg: #dce8f5;
  --rb-tag-shared-text: #2c5a8a;
  /* Layered checkboxes (see ".layered-checkbox" below): dark box outlines here... */
  --rb-checkbox-unchecked: url("/checkboxes/unchecked-light.png");
  --rb-checkbox-checked: url("/checkboxes/checked-light.png");
}

/* Bootstrap's own dark body is #212529 with #dee2e6 text; surfaces sit one step lighter so
   buttons and inputs still read as raised. Tints keep their hue but go deep and muted, with
   their text lightened to keep contrast. */
[data-bs-theme="dark"] {
  --rb-surface: #2b3035;
  --rb-surface-disabled: #1a1d20;
  --rb-quicklist-group-bg: #34383c;
  --rb-quicklist-nav: #c89b4b;
  --rb-quicklist-edit: #eea94b;
  --rb-text-max: #fff;
  --rb-text-strong: #dee2e6;
  --rb-text-soft: #c4c9ce;
  --rb-text-muted: #adb5bd;
  --rb-text-faint: #8f969d;
  --rb-text-fainter: #7d848a;
  --rb-text-faintest: #5c636a;
  --rb-border: #495057;
  --rb-border-soft: #3f454b;
  --rb-border-faint: #343a40;
  --rb-border-strong: #6c757d;
  --rb-link: #6cb6ff;
  --rb-brown: #8a6040;
  --rb-selected-bg: #16314f;
  --rb-changed-bg: #12304a;
  --rb-highlight-bg: #4d4416;
  --rb-save-disabled-bg: #2a4a75;
  --rb-danger-text: #ff8a7a;
  --rb-danger-border: #7d3a31;
  --rb-danger-bg: #4a1d22;
  --rb-invalid-bg: #4a2420;
  --rb-error-text: #f1aeb5;
  --rb-error-border: #7a2a33;
  --rb-success-text: #7cc77f;
  --rb-success-border: #2f6332;
  --rb-warning-text: #e5c98c;
  --rb-warning-border: #8a6d1f;
  --rb-warning-bg: #3b3115;
  --rb-tag-bg: #3d3227;
  --rb-tag-locked-bg: #4f4434;
  --rb-tag-remove-text: #d4a373;
  --rb-detail-tag-bg: #3d331d;
  --rb-tag-shared-bg: #1d3550;
  --rb-tag-shared-text: #9fc4ee;
  /* ...and light box outlines here. */
  --rb-checkbox-unchecked: url("/checkboxes/unchecked-dark.png");
  --rb-checkbox-checked: url("/checkboxes/checked-dark.png");
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--rb-surface), 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  /* GlobalFilter.md, "Differentiation": _Layout.cshtml sets both tints inline while a filter is
     active; otherwise the theme's normal background. */
  background-color: var(--rb-filter-bg, var(--bs-body-bg));
}

[data-bs-theme="dark"] body {
  background-color: var(--rb-filter-bg-dark, var(--bs-body-bg));
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Read Mode */

.recipe-list {
  list-style: none;
  padding: 0;
}

/* Recipe / quick-list icon (wwwroot/img/icons) leading a row's link or a "New ..." link -
   sized off the surrounding font so it scales with each list's own text size. */
.item-icon {
  height: 1.6em;
  width: auto;
  margin-right: 0.35em;
  vertical-align: middle;
}

/* Icon trailing the label instead of leading it ("📥 Bulk import <recipe-new.png>"). */
.item-icon-after {
  margin-right: 0;
  margin-left: 0.35em;
}

/* Home/Read page footer (_Layout.cshtml): New quick list / New recipe / Bulk import, styled as
   the same white bordered buttons as the Read page's own footer (.edit-recipe-btn). Fills the
   footer's fixed 60px band (body's margin-bottom reserves exactly that), so the row scrolls
   sideways on a very narrow phone rather than wrapping taller and covering page content. */
.footer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 60px;
  line-height: normal;
  overflow-x: auto;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
}

.footer-btn .item-icon {
  height: 1.4em;
}

/* Tightened so all three still fit on one line at a typical 360px-wide phone. */
@media (max-width: 420px) {
  .footer-actions {
    gap: 0.3rem;
  }

  .footer-btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.3rem;
  }

  .footer-btn .item-icon {
    margin-right: 0.2em;
  }

  .footer-btn .item-icon-after {
    margin-right: 0;
    margin-left: 0.2em;
  }
}

.recipe-list li {
  padding: 0.5rem 0;
  font-size: 1.25rem;
}

.breadcrumbs {
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
  color: var(--rb-text-muted);
}

.breadcrumb-sep {
  margin: 0 0.4rem;
}

.breadcrumb-current {
  font-weight: bold;
  color: inherit;
}

.pin-filter-btn {
  margin-left: 0.6rem;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  padding: 0.1rem 0.5rem;
}

/* Specs/BulkEdit.md, "Link to bulk edit" - shown at the end of search/categories/bookmarks
   results once at least 2 recipes are present. */
.bulk-edit-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid #258cfb;
  color: #258cfb;
  border-radius: 0.4rem;
  padding: 0.3rem 0.7rem;
}

.category-menu {
  list-style: none;
  padding: 0;
}

.category-menu li {
  padding: 0.4rem 0;
  font-size: 1.15rem;
}

.category-link {
  text-decoration: none;
}

.category-count {
  color: var(--rb-text-faint);
  font-size: 0.9rem;
}

/* Home page (Specs/HomePage.md): the recipe-finder's Text search / Categories / Bookmarks
   switcher. */
.recipe-finder {
  margin-top: 1rem;
}

.finder-tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--rb-border-soft);
  margin-bottom: 1rem;
}

.finder-tab {
  border: none;
  background: none;
  padding: 0.5rem 0.9rem;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--rb-text-muted);
}

.finder-tab.active {
  color: var(--rb-text-max);
  border-bottom-color: #258cfb;
  font-weight: 600;
}

.coming-soon {
  color: var(--rb-text-faint);
  font-style: italic;
}

/* Text search finder mode. */
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
  font-size: 1rem;
}

.search-find-btn {
  border: 1px solid #258cfb;
  color: #258cfb;
  background: var(--rb-surface);
  border-radius: 0.3rem;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
}

.search-results {
  list-style: none;
  padding: 0;
}

.search-result {
  padding: 0.5rem 0;
}

.search-result-title {
  display: block;
  font-size: 1.15rem;
}

.search-result-subtext {
  display: block;
  margin-left: 1rem;
  margin-top: 0.15rem;
  font-size: 0.9rem;
  color: var(--rb-text-muted);
  text-decoration: none;
}

.search-result-subtext:hover {
  text-decoration: underline;
}

/* Bookmarks finder mode. */
.bookmark-toggles {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.bookmark-refresh-btn {
  margin-left: auto;
  border: 1px solid #258cfb;
  color: #258cfb;
  background: var(--rb-surface);
  border-radius: 0.3rem;
  padding: 0.3rem 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.bookmark-results {
  list-style: none;
  padding: 0;
}

.bookmark-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0;
  font-size: 1.15rem;
}

.bookmark-row-icons {
  display: inline-flex;
  gap: 0.15rem;
}

/* Per-recipe bookmark icons, clickable to toggle that one recipe's bookmark off/on - lighter
   weight than .bookmark-btn (no box) since these sit inline in a dense list. */
.bookmark-row-icon {
  background: none;
  border: none;
  padding: 0 0.1rem;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.bookmark-row-icon-dim {
  filter: grayscale(100%);
  opacity: 0.5;
}

.shopping-links {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rb-border-faint);
}

.shopping-list-links {
  list-style: none;
  padding: 0;
}

.shopping-list-links li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 1.1rem;
}

.shopping-bookmarks-icon {
  cursor: default;
  flex: none;
}

.combine-checkbox {
  width: 20px;
  height: 20px;
  flex: none;
}

.quicklist-combine-btn {
  border: 1px solid var(--rb-brown);
  color: #fff;
  background: var(--rb-brown);
  border-radius: 0.4rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

/* Home page's Combine + Confirm 🗑️ row, right-aligned under the row-action columns. Collapses
   entirely while both buttons are hidden, so it doesn't leave a gap under the lists. */
.quicklist-bulk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.quicklist-bulk-actions:not(:has(> :not([hidden]))) {
  display: none;
}

/* 2-stage delete (Specs/HomePage.md, Specs/QuickShoppingList.md): 🗑️ only marks a row; this
   button, shown while anything is marked, is what actually deletes. */
.confirm-delete-btn {
  border: 1px solid #c0392b;
  color: #fff;
  background: #c0392b;
  border-radius: 0.4rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.delete-pending {
  background: var(--rb-danger-bg);
}

/* site.js's RowCollapse: a deleted row shrinks to nothing, its content clipped as it goes, so the
   rows below slide up. JS pins the row's height, then adds .row-collapsed and sets the height to
   0 - padding, margins and borders shrink with it, or they'd hold the row open (hence
   !important: it has to beat whatever padding the row's own rules give it). A table row's cells
   get the same classes, and their content is wrapped in a .row-collapse-clip that does the
   shrinking. No clicks on a row that's on its way out. */
.row-collapsing,
.row-collapse-clip {
  overflow: hidden;
  pointer-events: none;
  transition: height 0.25s ease, padding 0.25s ease, margin 0.25s ease, border-width 0.25s ease;
}
.row-collapsed {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-top-width: 0 !important;
  border-bottom-width: 0 !important;
}

/* Home page: the bare (borderless) 🗑️ glows red while its list is marked. */
.quicklist-row-delete-btn[aria-pressed="true"] {
  filter: drop-shadow(0 0 2px #e00000) drop-shadow(0 0 4px #e00000);
}

/* Quick-list editor page (Specs/QuickShoppingList.md). */
.quicklist-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.quicklist-title-input {
  flex: 1;
  font-size: 1.3rem;
  font-weight: bold;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  padding: 0.2rem 0.4rem;
}

.quicklist-title-input:hover, .quicklist-title-input:focus {
  border-color: var(--rb-border);
}

.quicklist-regen-btn {
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  background: var(--rb-surface);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  line-height: 1;
}

.quicklist-items {
  list-style: none;
  padding: 0;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

@keyframes quicklist-page-slide-out {
  to { transform: translateY(-100vh); }
}

@keyframes quicklist-page-slide-in {
  from { transform: translateY(100vh); }
  to { transform: translateY(0); }
}

:active-view-transition-type(quicklist-page)::view-transition-old(root),
html.quicklist-page-entering::view-transition-old(root) {
  animation: quicklist-page-slide-out 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
}

:active-view-transition-type(quicklist-page)::view-transition-new(root),
html.quicklist-page-entering::view-transition-new(root) {
  animation: quicklist-page-slide-in 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
}

:active-view-transition-type(recipe-page)::view-transition-old(root),
html.recipe-page-entering::view-transition-old(root) {
  animation: recipe-page-slide-out 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
}

:active-view-transition-type(recipe-page)::view-transition-new(root),
html.recipe-page-entering::view-transition-new(root) {
  animation: recipe-page-slide-in 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
}

@keyframes recipe-page-slide-out {
  to { transform: translateX(-100vw); }
}

@keyframes recipe-page-slide-in {
  from { transform: translateX(100vw); }
  to { transform: translateX(0); }
}

:active-view-transition-type(home-from-quicklist-page)::view-transition-old(root),
html.home-from-quicklist-page-entering::view-transition-old(root) {
  animation: home-from-quicklist-page-slide-out 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
}

:active-view-transition-type(home-from-quicklist-page)::view-transition-new(root),
html.home-from-quicklist-page-entering::view-transition-new(root) {
  animation: home-from-quicklist-page-slide-in 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
}

@keyframes home-from-quicklist-page-slide-out {
  to { transform: translateY(100vh); }
}

@keyframes home-from-quicklist-page-slide-in {
  from { transform: translateY(-100vh); }
  to { transform: translateY(0); }
}

:active-view-transition-type(home-from-recipe-page)::view-transition-old(root),
html.home-from-recipe-page-entering::view-transition-old(root) {
  animation: home-from-recipe-page-slide-out 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
}

:active-view-transition-type(home-from-recipe-page)::view-transition-new(root),
html.home-from-recipe-page-entering::view-transition-new(root) {
  animation: home-from-recipe-page-slide-in 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
}

@keyframes home-from-recipe-page-slide-out {
  to { transform: translateX(100vw); }
}

@keyframes home-from-recipe-page-slide-in {
  from { transform: translateX(-100vw); }
  to { transform: translateX(0); }
}

.page-transition-frame {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border: 0;
  z-index: 2147483647;
  visibility: hidden;
  pointer-events: none;
  background: var(--bs-body-bg);
}

.page-transition-frame-active {
  visibility: visible;
  pointer-events: auto;
}

html.page-transition-host body {
  overflow: hidden;
}

html.page-transition-host body > :not(.page-transition-frame) {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .page-transition-frame-entering,
  .page-transition-frame-exiting {
    visibility: visible;
    animation-duration: 0.425s;
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
    animation-fill-mode: both;
    pointer-events: none;
  }

  .page-transition-frame-entering[data-transition="quicklist"] {
    animation-name: quicklist-page-slide-in;
  }

  .page-transition-frame-entering[data-transition="recipe"] {
    animation-name: recipe-page-slide-in;
  }

  .page-transition-frame-entering[data-transition="home-from-quicklist"] {
    animation-name: home-from-quicklist-page-slide-in;
  }

  .page-transition-frame-entering[data-transition="home-from-recipe"] {
    animation-name: home-from-recipe-page-slide-in;
  }

  .page-transition-frame-exiting[data-transition="quicklist"] {
    animation-name: quicklist-page-slide-out;
  }

  .page-transition-frame-exiting[data-transition="recipe"] {
    animation-name: recipe-page-slide-out;
  }

  .page-transition-frame-exiting[data-transition="home-from-quicklist"] {
    animation-name: home-from-quicklist-page-slide-out;
  }

  .page-transition-frame-exiting[data-transition="home-from-recipe"] {
    animation-name: home-from-recipe-page-slide-out;
  }

  html.quicklist-page-exiting body,
  html.quicklist-page-entering body,
  html.recipe-page-exiting body,
  html.recipe-page-entering body,
  html.home-from-quicklist-page-exiting body,
  html.home-from-quicklist-page-entering body,
  html.home-from-recipe-page-exiting body,
  html.home-from-recipe-page-entering body {
    overflow-x: hidden;
  }

  html.quicklist-page-exiting header,
  html.quicklist-page-exiting body > .container,
  html.quicklist-page-exiting footer {
    animation: quicklist-page-slide-out 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
  }

  html.quicklist-page-entering header,
  html.quicklist-page-entering body > .container,
  html.quicklist-page-entering footer {
    animation: quicklist-page-slide-in 0.35s cubic-bezier(0.65, 0, 0.35, 1) both;
  }

  html.recipe-page-exiting header,
  html.recipe-page-exiting body > .container,
  html.recipe-page-exiting footer {
    animation: recipe-page-slide-out 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
  }

  html.recipe-page-entering header,
  html.recipe-page-entering body > .container,
  html.recipe-page-entering footer {
    animation: recipe-page-slide-in 0.35s cubic-bezier(0.65, 0, 0.35, 1) both;
  }

  html.home-from-quicklist-page-exiting header,
  html.home-from-quicklist-page-exiting body > .container,
  html.home-from-quicklist-page-exiting footer {
    animation: home-from-quicklist-page-slide-out 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
  }

  html.home-from-quicklist-page-entering header,
  html.home-from-quicklist-page-entering body > .container,
  html.home-from-quicklist-page-entering footer {
    animation: home-from-quicklist-page-slide-in 0.35s cubic-bezier(0.65, 0, 0.35, 1) both;
  }

  html.home-from-recipe-page-exiting header,
  html.home-from-recipe-page-exiting body > .container,
  html.home-from-recipe-page-exiting footer {
    animation: home-from-recipe-page-slide-out 0.425s cubic-bezier(0.65, 0, 0.35, 1) both;
  }

  html.home-from-recipe-page-entering header,
  html.home-from-recipe-page-entering body > .container,
  html.home-from-recipe-page-entering footer {
    animation: home-from-recipe-page-slide-in 0.35s cubic-bezier(0.65, 0, 0.35, 1) both;
  }
}

.quicklist-item, .quicklist-add-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rb-border-faint);
}

.quicklist-item, .quicklist-add-row {
  align-items: flex-start;
}

.quicklist-checkbox {
  width: 20px;
  height: 20px;
  flex: none;
}

.quicklist-checkmark-cells {
  display: flex;
  gap: 0.15rem;
  flex: none;
  margin-top: 0.35rem;
}

.quicklist-add-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 0.35rem;
  line-height: 1;
}

.quicklist-axis-section {
  list-style: none;
  margin: 0.35rem 0;
  border: 1px solid var(--rb-border-faint);
  border-radius: 0.35rem;
}

.quicklist-axis-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.45rem;
  font-weight: 600;
  color: var(--rb-text-strong);
  background: var(--rb-quicklist-group-bg);
  outline: none;
}

.quicklist-item:focus,
.quicklist-item:focus-visible,
.quicklist-axis-group-header:focus,
.quicklist-axis-group-header:focus-visible {
  outline: none;
}

.quicklist-item:focus .quicklist-item-text,
.quicklist-axis-group-header:focus .quicklist-axis-group-title,
.quicklist-axis-column-cell:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--rb-quicklist-nav);
  border-radius: 0.2rem;
}

.quicklist-axis-group-header > .quicklist-axis-group-title {
  flex: 1;
  padding: 0.1rem 0.3rem;
}

.quicklist-axis-group-title-input {
  flex: 1;
  min-width: 0;
}

.quicklist-drag-handle {
  display: grid;
  place-items: center;
  flex: none;
  width: 1rem;
  margin: 0.2rem 0 0;
  padding: 0;
  color: var(--rb-text-fainter);
  background: transparent;
  border: 0;
  border-radius: 0.2rem;
  cursor: grab;
  line-height: 1.6;
}

.quicklist-drag-handle:hover {
  color: var(--rb-text);
  background: var(--rb-surface-disabled);
}

.quicklist-group-drag-handle {
  width: 1.35rem;
  margin: 0;
}

.quicklist-drag-handle[hidden] {
  display: none;
}

.quicklist-axis-group-actions {
  display: flex;
  gap: 0.2rem;
}

.quicklist-axis-group-items {
  margin: 0;
  padding: 0 0.5rem;
  list-style: none;
  min-height: 0.75rem;
}

.quicklist-axis-group-items > .quicklist-item,
.quicklist-axis-group-items > .quicklist-group-add-row {
  padding: 0.15rem 0;
}

.quicklist-axis-column-header {
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  background: var(--rb-surface);
}

.quicklist-axis-column-spacer {
  width: 1rem;
  flex: none;
}

.quicklist-axis-column-header > span:last-child {
  flex: 0 0 4.7rem;
  width: 4.7rem;
}

.quicklist-axis-column-cell,
.quicklist-axis-column-input,
.quicklist-axis-column-sort {
  flex: 0 0 10rem;
  width: 10rem;
  margin-left: 0.5rem;
  padding: 0.2rem 0.35rem;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  color: inherit;
  background: transparent;
}

.quicklist-axis-column-cell {
  min-width: 10rem;
  min-height: 1.75rem;
}

.quicklist-axis-column-checkmark-headers {
  display: flex;
  flex: none;
  gap: 0.15rem;
}

.quicklist-axis-checkmark-sort {
  position: relative;
  width: 1.25rem;
  padding: 0.1rem 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.quicklist-column-sort-indicator {
  display: inline-block;
  margin-left: 0.08rem;
  font-size: 0.55em;
  line-height: 1;
  transform: translateY(-0.08rem);
}

.quicklist-axis-checkmark-sort .quicklist-column-sort-indicator {
  position: absolute;
  top: 0;
  right: -0.12rem;
  margin: 0;
  font-size: 0.5em;
  transform: none;
}

.quicklist-axis-column-cell:hover {
  border-color: var(--rb-border);
  background: var(--rb-surface-disabled);
}

.quicklist-axis-column-input {
  border-color: var(--rb-border);
  background: var(--rb-surface);
}

.quicklist-axis-column-sort {
  cursor: pointer;
  border-color: var(--rb-border);
  font-weight: 600;
  background: var(--rb-surface-disabled);
}

.quicklist-item-column-sort {
  flex: 1 1 auto;
  width: auto;
  margin-left: 0;
}

.quicklist-item.quicklist-axis-column-row .quicklist-axis-column-cell {
  margin-right: 0;
}

.quicklist-axis-group-items .quicklist-item-actions {
  flex-basis: 7rem;
  width: 7rem;
}

.quicklist-edit-input:focus,
.quicklist-axis-column-input:focus,
.quicklist-axis-group-title-input:focus,
.quicklist-group-add-row textarea.is-editing:focus {
  outline: none;
  border: 1px solid var(--rb-quicklist-edit);
  box-shadow: 0 0 0 1px var(--rb-quicklist-edit);
  border-radius: 0.4rem;
}

.quicklist-item-text,
.quicklist-axis-column-cell,
.quicklist-axis-group-title,
.quicklist-group-add-row textarea,
.quicklist-checkbox,
.quicklist-icon-btn,
.quicklist-axis-group-actions .quicklist-icon-btn {
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.quicklist-item-text:hover,
.quicklist-axis-column-cell:hover,
.quicklist-axis-group-title:hover,
.quicklist-group-add-row textarea:hover {
  background: var(--rb-surface-disabled);
  border-color: var(--rb-border);
  border-radius: 0.4rem;
}

input.quicklist-checkbox:not(:disabled):hover,
.quicklist-icon-btn:hover {
  background-color: var(--rb-surface-disabled);
  box-shadow: 0 0 0 1px var(--rb-border);
  border-radius: 0.4rem;
}

.quicklist-axis-group-items .quicklist-checkmark-cells,
.quicklist-axis-group-items .quicklist-add-marker {
  margin-top: 0.18rem;
}

.quicklist-axis-unnamed {
  border-color: transparent;
}

.quicklist-axis-drop-target {
  box-shadow: inset 0 0 0 2px var(--rb-link);
}

.quicklist-item-drop-target {
  box-shadow: inset 0 2px 0 var(--rb-link);
}

.quicklist-group-add-drop-target {
  box-shadow: inset 0 2px 0 var(--rb-link);
}

.quicklist-axis-group-row,
.quicklist-axis-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quicklist-axes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quicklist-axis-create-actions,
.quicklist-axis-import-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quicklist-grouping-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.quicklist-axis-selection-section {
  display: grid;
  gap: 0.55rem;
}

.quicklist-axis-editor {
  margin-top: 0.35rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rb-border);
}

.quicklist-axis-import-wrap {
  position: relative;
}

.quicklist-axis-import-popup {
  position: fixed;
  inset: auto;
  display: grid;
  min-width: 18rem;
  max-height: min(24rem, 65vh);
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.35rem;
  background: var(--rb-surface);
  box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.2);
  overflow: auto;
}

.quicklist-axis-import-popup:not(:popover-open) {
  display: none;
}

.quicklist-axis-import-choice {
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 0.25rem;
  text-align: left;
  color: inherit;
  background: transparent;
}

.quicklist-axis-import-choice:hover {
  background: var(--rb-surface-disabled);
}

.quicklist-axes-list .selected {
  color: var(--rb-surface);
  background: var(--rb-text-max);
}

.quicklist-axis-heading-fields {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.quicklist-axis-heading-fields .quicklist-axis-title {
  min-width: 16rem;
}

.quicklist-axis-group-row {
  position: relative;
  padding: 0.2rem 0.35rem;
  border-bottom: 1px solid var(--rb-border-faint);
}

.quicklist-axis-group-row.quicklist-item-drop-target {
  box-shadow: none;
}

.quicklist-axis-group-row.quicklist-item-drop-target::before,
.quicklist-axis-add-group-row.quicklist-item-drop-target::before {
  content: "";
  position: absolute;
  top: -0.2rem;
  right: 0;
  left: 0;
  height: 2px;
  transform: translateY(-50%);
  background: var(--rb-link);
  pointer-events: none;
}

.quicklist-axis-group-row .quicklist-drag-handle {
  margin: 0;
}

.quicklist-axis-add-group-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.2rem 0.35rem;
}

.quicklist-axis-add-marker {
  display: grid;
  place-items: center;
  width: 1rem;
  flex: none;
}

.quicklist-axis-add-group-row.quicklist-item-drop-target {
  box-shadow: none;
}

.quicklist-axis-group-row input {
  flex: 1;
}

.quicklist-group-add-row {
  margin-left: 0;
}

.quicklist-group-add-row textarea {
  min-height: 2rem;
  border-color: transparent;
  box-shadow: none;
}

.quicklist-group-add-row textarea:focus {
  outline: none;
  border-color: var(--rb-quicklist-edit);
  box-shadow: 0 0 0 1px var(--rb-quicklist-edit);
  border-radius: 0.4rem;
}

.quicklist-group-add-row textarea:hover {
  border-color: var(--rb-border);
  box-shadow: 0 0 0 1px var(--rb-border);
}

.quicklist-axis-groups {
  display: grid;
  gap: 0.4rem;
}

.quicklist-add-row select {
  max-width: 9rem;
  margin-top: 0.2rem;
}

.quicklist-item-text {
  flex: 1;
  min-width: 0;
  font-size: 1.1rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}

.quicklist-text-input, .quicklist-edit-input {
  flex: 1;
  min-width: 0;
  font-size: 1.1rem;
  line-height: 1.4;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
  padding: 0.2rem 0.4rem;
}

.quicklist-auto-size-input {
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
}

.quicklist-auto-size-input.quicklist-edit-unsaved {
  background: var(--rb-highlight-bg);
}

.quicklist-item-actions {
  display: flex;
  gap: 0.2rem;
  flex: 0 0 4.7rem;
  width: 4.7rem;
  margin-top: 0.18rem;
}

.quicklist-item-actions .quicklist-icon-btn {
  box-sizing: border-box;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  text-align: center;
}

.quicklist-icon-btn {
  background: none;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  line-height: 1;
}

.quicklist-delete-btn {
  color: var(--rb-danger-text);
  border-color: var(--rb-danger-border);
}

/* Quick-list page and Friends page: the 🗑️ button reads as pressed - solid bold red - while its
   item is marked. */
.quicklist-delete-btn[aria-pressed="true"],
.friend-row-actions .remove-btn[aria-pressed="true"] {
  background: #c0392b;
  border-color: #8e1f14;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.35);
}

/* Checkmark/group controls stay left; Confirm 🗑️ remains under the item actions. */
.quicklist-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.quicklist-list-actions .confirm-delete-btn {
  margin-left: auto;
}

.quicklist-marked-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  background: var(--rb-surface-disabled);
}

.quicklist-marked-actions[hidden] {
  display: none;
}

.quicklist-bulk-menu,
.quicklist-bulk-axis {
  position: relative;
}

.quicklist-bulk-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.quicklist-bulk-menu summary::after {
  content: "\25be";
}

.quicklist-marked-actions .quicklist-checkbox {
  display: inline-grid;
  vertical-align: middle;
  margin: 0 0.15rem;
}

.quicklist-bulk-options,
.quicklist-bulk-groups {
  position: absolute;
  z-index: 20;
  min-width: 100%;
  width: max-content;
  max-width: min(25rem, calc(100vw - 2rem));
  padding: 0.25rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  background: var(--rb-surface);
  box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.15);
}

.quicklist-bulk-options {
  top: 100%;
  left: 0;
}

.quicklist-bulk-groups {
  top: 0;
  left: 100%;
}

.quicklist-bulk-options button,
.quicklist-bulk-axis > summary {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: inherit;
  text-align: left;
}

.quicklist-bulk-options button:hover,
.quicklist-bulk-axis > summary:hover {
  background: var(--rb-surface-disabled);
}

@media (max-width: 760px) {
  .quicklist-bulk-groups {
    position: static;
    width: 100%;
  }
}

.quicklist-checkmark-manager {
  margin: 0.75rem 0;
}

.quicklist-checkmark-manager-provisional {
  display: none !important;
}

.quicklist-custom-checkbox {
  --checkmark-color: #64b464;
  appearance: none;
  display: grid;
  place-items: center;
  border: 2px solid var(--checkmark-color);
  border-radius: 0.15rem;
  background: transparent;
  color: var(--checkmark-color);
}

.quicklist-custom-checkbox::after {
  content: attr(data-fill-text);
  line-height: 1;
  font-size: 0.8rem;
  opacity: 0.28;
}

.quicklist-custom-checkbox:checked {
  background: var(--checkmark-color);
  color: var(--checkmark-ink, #000);
}

.quicklist-custom-checkbox:checked::after {
  opacity: 1;
}

.quicklist-custom-checkbox.is-checked::after {
  opacity: 1;
}

.checkmark-dialog {
  width: min(46rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border: 1px solid var(--rb-border);
  border-radius: 0.5rem;
  padding: 0;
  color: var(--rb-text-max);
  background: var(--rb-surface);
}

.checkmark-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.checkmark-dialog:not([open]) {
  display: none;
}

.checkmark-dialog-shell {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.checkmark-dialog-list {
  display: grid;
  gap: 0.35rem;
  max-height: 15rem;
  overflow: auto;
}

.checkmark-modal-row {
  display: grid;
  grid-template-columns: 2rem minmax(8rem, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem;
  border: 1px solid var(--rb-border-faint);
  border-radius: 0.3rem;
}

.checkmark-modal-row.reordering {
  box-shadow: inset 0 0 0 2px var(--rb-link);
}

.checkmark-modal-row.editing {
  color: var(--rb-surface);
  background: var(--rb-text-max);
  border-color: var(--rb-text-max);
}

.checkmark-modal-row.editing .quicklist-custom-checkbox {
  outline-color: var(--rb-surface);
}

.checkmark-modal-row.removed {
  color: #fff;
  background: #c0392b;
  border-color: #8e1f14;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.35);
}

.checkmark-modal-row.removed .checkmark-modal-title {
  text-decoration: line-through;
}

.checkmark-row-handle {
  display: grid;
  place-items: center;
  width: 1.8rem;
  min-height: 1.8rem;
  padding: 0;
  color: var(--rb-text-fainter);
  background: transparent;
  border: 0;
  border-radius: 0.25rem;
  cursor: grab;
}

.checkmark-row-handle:hover,
.checkmark-row-handle:focus-visible {
  color: var(--rb-text-max);
  background: var(--rb-surface-disabled);
}

.checkmark-row-remove-pending {
  color: #fff;
  font-weight: 700;
  cursor: default;
}

.checkmark-demos {
  display: flex;
  gap: 0.35rem;
}

.checkmark-dialog-editor {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto 5.5rem;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--rb-border);
}

.checkmark-dialog-editor[hidden] {
  display: none;
}

.checkmark-dialog-editor label {
  display: grid;
  gap: 0.2rem;
}

.checkmark-editor-fields {
  display: grid;
  gap: 0.55rem;
}

.checkmark-editor-fields label {
  grid-template-columns: 5.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.checkmark-color-presets {
  display: grid;
  grid-template-columns: repeat(6, 1.5rem);
  gap: 0.25rem;
}

.checkmark-color-preset {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.2rem;
}

.checkmark-editor-actions,
.checkmark-dialog-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.checkmark-editor-actions {
  flex-direction: column;
  align-items: stretch;
}

.checkmark-editor-actions .edit-recipe-btn {
  width: 100%;
}

.checkmark-dialog-spacer {
  flex: 1;
}

.checkmark-import-wrap {
  position: relative;
}

.checkmark-import-popup {
  position: absolute;
  z-index: 5;
  bottom: 2.5rem;
  left: 0;
  min-width: 15rem;
  padding: 0.5rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
  background: var(--rb-surface);
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.25);
}

.checkmark-import-choice {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem;
  border: 0;
  background: transparent;
  color: inherit;
}

.master-checkmark-row {
  grid-template-columns: minmax(8rem, 1fr) auto 3rem;
}

.master-checkmark-row.removed {
  grid-template-columns: 1.8rem minmax(8rem, 1fr) auto 3rem;
}
.quicklist-checkmark-panel {
  position: relative;
}

.quicklist-checkmark-panel > summary {
  list-style: none;
  width: fit-content;
  cursor: pointer;
}

.quicklist-checkmark-panel-body {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  background: var(--rb-surface);
}

.quicklist-checkmark-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quicklist-checkmark-row-title {
  flex: 1;
  min-width: 0;
}

.quicklist-checkmark-color {
  width: 10rem;
}

.quicklist-checkmark-add {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rb-border-faint);
}

.quicklist-checkmark-add label {
  display: grid;
  gap: 0.2rem;
}

/* Same layout as .recipe-footer (left-aligned, spaced-out buttons) - Specs/QuickShoppingList.md
   asked for this page's footer to match a recipe's. */
.quicklist-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rb-border-soft);
}

/* Quick-list links on the home page's Shopping section. */
.quicklist-links {
  list-style: none;
  padding: 0;
}

.quicklist-links li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 1.1rem;
}

.quicklist-links li a {
  min-width: 0;
}

.quicklist-prefix {
  flex: none;
}

.quicklist-row-actions {
  display: grid;
  grid-template-columns: 20px 1.4rem;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  margin-left: auto;
}

.quicklist-row-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  width: 1.4rem;
}

/* Shopping-bookmarks list (Specs/ShoppingMode.md). */
.shopping-cart-subtitle {
  color: var(--rb-text-faint);
  margin-top: -0.5rem;
}

.shopping-cart-items {
  list-style: none;
  padding: 0;
}

.shopping-cart-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rb-border-faint);
}

.shopping-cart-item-text {
  flex: 1;
  font-size: 1.1rem;
}

.shopping-cart-item-recipes {
  color: var(--rb-text-faint);
  font-size: 0.9rem;
  flex: none;
}

.shopping-cart-recipes {
  color: var(--rb-text-muted);
  font-size: 0.95rem;
  margin-top: 1rem;
}

.shopping-cart-recipes p {
  margin: 0 0 0.3rem;
}

.shopping-cart-recipes ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shopping-cart-recipes li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}

.shopping-cart-recipe-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
}

.shopping-cart-recipe-number {
  min-width: 1.5rem;
  text-align: right;
  flex: none;
}

.shopping-cart-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 1.5rem;
}

.shopping-cart-clear-btn {
  border: 1px solid var(--rb-danger-border);
  color: var(--rb-danger-text);
  background: var(--rb-surface);
  border-radius: 0.4rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.tags {
  margin: 0.5rem 0;
}

.tag {
  display: inline-block;
  background: var(--rb-tag-bg);
  border-radius: 1rem;
  padding: 0.15rem 0.6rem;
  margin-right: 0.35rem;
  font-size: 0.9rem;
}

/* Specs/Sharing.md, "Author category": the implicit per-owner category a wrapper gets at Accept
   time - styled apart from a hand-made category so it reads as "who shared this", not a topic. */
.tag-shared {
  background: var(--rb-tag-shared-bg);
  color: var(--rb-tag-shared-text);
}

.recipe-actions {
  margin: 0.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bookmark-btn {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}

/* The container (padding/border-box) never changes size - only the icon inside visually grows,
   via transform (which doesn't affect layout), so selecting a bookmark doesn't shift anything
   around it. */
.bookmark-icon {
  display: inline-block;
  transition: transform 0.15s ease;
}

.bookmark-btn.active {
  opacity: 1;
  background: var(--rb-brown);
  border-color: var(--rb-brown);
}

.bookmark-btn.active .bookmark-icon {
  transform: scale(1.2);
}

/* Specs/HomePage.md: an enabled bookmark with no matching recipes yet - grayed out and
   unclickable, same grayscale+opacity treatment as .bookmark-row-icon-dim/.nav-link-disabled. */
.bookmark-btn-empty {
  cursor: not-allowed;
  filter: grayscale(60%);
  opacity: 0.8;
}

/* Trailing "(N)" recipe count, e.g. ⭐(5) - shown only once a bookmark has matching recipes.
   A sibling of its .bookmark-btn (not nested inside), immediately following it in the DOM.
   .bookmark-toggles' flex `gap` puts 0.75rem before every child including this one - pull that
   back down to a tight 0.15rem so it visually hugs the button instead of floating in its own slot. */
.bookmark-count {
  margin-left: -0.6rem;
  font-size: 0.85em;
  opacity: 0.8;
}

.edit-recipe-btn {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.edit-recipe-btn:disabled {
  color: var(--rb-text-fainter);
  background: var(--rb-surface-disabled);
  cursor: default;
}

.recipe-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rb-border-soft);
}

.delete-recipe-btn {
  color: var(--rb-danger-text);
  border-color: var(--rb-danger-border);
}

/* Read.cshtml, Specs/Sharing.md "Share tracking": a native <details> disclosure so the
   per-friend checkbox list overlays the footer instead of pushing it taller when open. */
.share-panel {
  position: relative;
  display: inline-block;
}

.share-panel > summary {
  list-style: none;
}

.share-panel > summary::-webkit-details-marker {
  display: none;
}

.share-panel-body {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  margin-top: 0.3rem;
  padding: 0.6rem;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-width: 12rem;
}

.share-friend-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0;
  white-space: nowrap;
  cursor: pointer;
  /* The row is a <label> around the checkbox, so a click already toggles it natively - without
     this, that same click also drags a text selection across the friend's name. */
  -webkit-user-select: none;
  user-select: none;
}

/* PendingShares.cshtml: same label-around-checkbox pattern as .share-friend-row above, so the
   checkbox sits inline with the recipe title instead of claiming its own full-width column. */
.pending-share-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* Specs/Sharing.md, "Reshare": the original owner's row in a wrapper's re-share panel - grayed
   out and non-interactive, with a 💟 standing in for the checkbox. */
.share-friend-row.share-friend-original {
  color: var(--rb-text-fainter);
  cursor: default;
}

.share-friend-indicator {
  display: inline-block;
  width: 1em;
  text-align: center;
}

/* quicklist-sharing.js: dims a pending row while its cancel-invite request is in flight, so a
   second click can't fire before the first one's refresh() rebuilds the panel. */
.share-friend-row.share-friend-busy {
  pointer-events: none;
  opacity: 0.5;
}

.share-empty {
  color: var(--rb-text-muted);
  font-size: 0.85rem;
  margin: 0;
  max-width: 14rem;
  white-space: normal;
}

.multiplier {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 1rem;
  font-weight: normal;
  position: relative;
  top: -2px;
}

.multiplier.active {
  font-weight: bold;
  background: var(--rb-highlight-bg);
}

.multiplier .qty-input {
  width: 2rem;
  text-align: center;
}

.multiplier.invalid .qty-input {
  color: var(--rb-danger-text);
}

.ingredients-header, .instructions-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.mode-toggles {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  position: relative;
  top: -4px;
}

.mode-toggles-label {
  font-size: 0.8rem;
  color: var(--rb-text-muted);
  white-space: nowrap;
}

.mode-toggles-icons {
  display: flex;
  gap: 0.3rem;
}

.ingredients-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.ingredients-table th, .ingredients-table td {
  text-align: left;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--rb-border-faint);
}

/* Shrink Qty/Unit/AlternateUnits to fit their content; Name takes the remaining space. */
.ingredients-table .qty-col, .ingredients-table .unit-col, .ingredients-table .altunits-col {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.ingredients-table .altunits-col {
  color: var(--rb-text-muted);
}

/* Checkmark-mode columns sit to the left, narrow, icon-only (no header text). */
.ingredients-table .mode-col {
  width: 1%;
  padding: 0.2rem 0.3rem;
  text-align: center;
  border-bottom: none;
}

.mode-checkbox {
  display: inline-block;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

input.mode-checkbox {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

input.mode-checkbox:focus-visible {
  outline: 2px solid #258cfb;
  outline-offset: 1px;
}

/* Layered checkboxes: add .layered-checkbox to a .mode-checkbox and set --rb-checkbox-icon to any
   image, and it becomes a checkbox personalized by that icon. The box itself is shared by every
   layered checkbox - /checkboxes/unchecked-*.png or checked-*.png - and the icon is drawn over it.
   The icon image should be the same size as the box art so they stack exactly.
   Light or dark follows the nearest data-bs-theme, so the page theme picks it - or put
   data-bs-theme="light"/"dark" on the checkbox (or a container) to force one.

   The icon is set off from the box by a gap: a hole cut out of the box, so whatever is behind
   the checkbox (page, tinted row, filter tint) shows through. The box (::before) is masked by a
   solid layer minus 17 copies of the icon - one in place, 16 shifted --rb-checkbox-halo-width
   out in a circle - which together are the icon grown by that width. Any icon works; no
   per-icon art. 2.2px is about 1/8 of the art's height in the default 22px checkbox; scale it
   with the checkbox (the Friends page's 26px ones use 2.6px). */
.layered-checkbox {
  --rb-checkbox-box: var(--rb-checkbox-unchecked);
  --rb-checkbox-halo-width: 2.2px;
  position: relative;
}
input.layered-checkbox:checked {
  --rb-checkbox-box: var(--rb-checkbox-checked);
}
.layered-checkbox::before,
.layered-checkbox::after {
  content: "";
  position: absolute;
  inset: 0;
  background: no-repeat center / contain;
  pointer-events: none;
}
.layered-checkbox::before {
  background-image: var(--rb-checkbox-box);
  /* Top layer (solid) "subtract"s everything under it: the 17 icon copies, unioned by "add".
     mask-composite needs one value per layer - a shorter list repeats (subtract, add, subtract,
     ...), which cancels the hole out - so all 18 are spelled out. */
  mask:
    linear-gradient(#000 0 0),
    var(--rb-checkbox-icon) 50% 50% / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% + var(--rb-checkbox-halo-width)) 50% / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% + 0.924 * var(--rb-checkbox-halo-width)) calc(50% + 0.383 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% + 0.707 * var(--rb-checkbox-halo-width)) calc(50% + 0.707 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% + 0.383 * var(--rb-checkbox-halo-width)) calc(50% + 0.924 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) 50% calc(50% + var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% - 0.383 * var(--rb-checkbox-halo-width)) calc(50% + 0.924 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% - 0.707 * var(--rb-checkbox-halo-width)) calc(50% + 0.707 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% - 0.924 * var(--rb-checkbox-halo-width)) calc(50% + 0.383 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% - var(--rb-checkbox-halo-width)) 50% / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% - 0.924 * var(--rb-checkbox-halo-width)) calc(50% - 0.383 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% - 0.707 * var(--rb-checkbox-halo-width)) calc(50% - 0.707 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% - 0.383 * var(--rb-checkbox-halo-width)) calc(50% - 0.924 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) 50% calc(50% - var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% + 0.383 * var(--rb-checkbox-halo-width)) calc(50% - 0.924 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% + 0.707 * var(--rb-checkbox-halo-width)) calc(50% - 0.707 * var(--rb-checkbox-halo-width)) / contain no-repeat,
    var(--rb-checkbox-icon) calc(50% + 0.924 * var(--rb-checkbox-halo-width)) calc(50% - 0.383 * var(--rb-checkbox-halo-width)) / contain no-repeat;
  mask-composite: subtract,
    add, add, add, add, add, add, add, add, add,
    add, add, add, add, add, add, add, add;
}
.layered-checkbox::after {
  background-image: var(--rb-checkbox-icon);
}

/* Read.cshtml's ingredient and instruction checkmarks (and their Settings toggles). */
.layered-checkbox[data-check="shopping"] { --rb-checkbox-icon: url("/checkboxes/shopping.png"); }
.layered-checkbox[data-check="ready"] { --rb-checkbox-icon: url("/checkboxes/ready.png"); }
.layered-checkbox[data-check="prepared"] { --rb-checkbox-icon: url("/checkboxes/prepared.png"); }
.layered-checkbox[data-check="done"] { --rb-checkbox-icon: url("/checkboxes/done.png"); }
.layered-checkbox[data-check="complete"] { --rb-checkbox-icon: url("/checkboxes/complete.png"); }

/* Friends.cshtml's per-friend sharing flags (Specs/Sharing.md, "Friends page layout"). */
.layered-checkbox[data-check="share"] { --rb-checkbox-icon: url("/checkboxes/share.png"); }
.layered-checkbox[data-check="accept"] { --rb-checkbox-icon: url("/checkboxes/accept.png"); }
.layered-checkbox[data-check="pending"] { --rb-checkbox-icon: url("/checkboxes/pending.png"); }

.section-heading {
  /* An ingredients-table section heading is a <caption> (no built-in font-size scaling); an
     instructions-list one is an <h3> (Bootstrap's _rfs.scss scales it up to ~1.75rem+). Pin every
     size-related property explicitly so the two render identically regardless of which tag it is. */
  caption-side: top;
  text-align: left;
  font-weight: bold;
  font-size: 1.1rem;
  line-height: 1.2;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.ingredient-notes {
  color: var(--rb-text-muted);
  font-style: italic;
}

.ingredient-optional-tag {
  color: var(--rb-text-fainter);
  vertical-align: super;
  font-size: 0.7em;
}

.detail-tag {
  background: var(--rb-detail-tag-bg);
  border-radius: 0.3rem;
  padding: 0 0.3rem;
}

.instructions-list li {
  margin-bottom: 0.5rem;
}

.step-checkbox {
  margin-right: 0.4rem;
}

.notes .note {
  border-top: 1px solid var(--rb-border-faint);
  padding: 0.5rem 0;
}

.note-meta {
  color: var(--rb-text-faint);
  font-size: 0.5rem;
}

.new-note-form {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.new-note-form textarea {
  flex: 1;
  width: 100%;
  min-height: 4rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
  font: inherit;
  resize: vertical;
}

.new-note-form .row-btn {
  flex: none;
  font-size: 1.1rem;
}

.clear-checks-btn {
  margin-top: 1rem;
}

/* Specs/IframeMedia.md: .recipe-iframe-panel sits alongside .recipe (row in landscape, column in
   portrait) and sticks to the near edge of the viewport as the page scrolls, so it stays in view
   within its own half while .recipe scrolls past it in the other half - a plain sticky sidebar,
   just anchored to top (landscape, right half) or bottom (portrait, bottom half) depending on
   which edge that half sits against. Hidden by default (both the `hidden` attribute in markup and
   this rule, so JS only ever has to toggle the one attribute) until a qualifying rich-text link
   (MarkupRenderer's targetIframe param) reveals it; the close button (read-mode.js) blanks the
   iframe's src and re-hides it, i.e. "sets its size to zero". */
.recipe-split-view {
  display: flex;
  flex-direction: column;
}

.recipe-split-view > .recipe {
  min-width: 0;
}

.recipe-iframe-panel {
  position: sticky;
  background: #000;
  border-radius: 0.4rem;
  overflow: hidden;
}

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

.recipe-iframe-panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.recipe-iframe-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
}

@media (orientation: portrait) {
  .recipe-iframe-panel {
    bottom: 0;
    height: 50vh;
  }
}

@media (orientation: landscape) {
  .recipe-split-view {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
  }

  .recipe-split-view > .recipe {
    flex: 1 1 50%;
  }

  .recipe-iframe-panel {
    flex: 1 1 50%;
    top: 1rem;
    height: calc(100vh - 2rem);
  }
}

/* Edit Mode */

.edit-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rb-border-soft);
}

.edit-header {
  margin-bottom: 1rem;
}

.title-input {
  font-size: 2rem;
  font-weight: 500;
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--rb-border);
  padding: 0.25rem 0;
}

.title-input:focus {
  outline: none;
  border-bottom-color: #258cfb;
}

/* Same convention as any other empty contenteditable placeholder in this app - shown only while
   the field truly has no content (a lone <br> from an empty rich-edit doesn't count). */
.title-input:empty::before {
  content: attr(data-placeholder);
  color: var(--rb-text-fainter);
}

.edit-field {
  margin-bottom: 1rem;
}

.edit-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--rb-text-muted);
  margin-bottom: 0.2rem;
}

/* Edit.cshtml's Credit field: label and input share one row instead of stacking - a modifier
   rather than changing .edit-field itself, since Login.cshtml's "Your name" field also uses
   .edit-field and should keep its stacked layout. */
.edit-field-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-field-inline label {
  margin-bottom: 0;
  white-space: nowrap;
}

.edit-field-inline input, .edit-field-inline .rich-edit {
  flex: 1;
  min-width: 0;
}

.credit-input {
  width: 100%;
  max-width: 28rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
}

.credit-input:empty::before {
  content: attr(data-placeholder);
  color: var(--rb-text-fainter);
}

/* Edit.cshtml, Specs/Sharing.md "Wrapper recipes": everything but Notes is read-only for a
   still-linked wrapper - reuses Read.cshtml's own title/tags/ingredients/instructions markup and
   styling, plus this one extra explanatory line. */
.wrapper-readonly-title {
  margin: 0;
}

.wrapper-readonly-hint {
  color: var(--rb-text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 1.5rem;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
}

.tag-picker-label {
  font-size: 0.8rem;
  color: var(--rb-text-muted);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--rb-tag-bg);
  border-radius: 1rem;
  padding: 0.2rem 0.4rem 0.2rem 0.7rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.tag-chip-remove {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--rb-tag-remove-text);
  line-height: 1;
  padding: 0 0.2rem;
}

.tag-chip-locked {
  background: var(--rb-tag-locked-bg);
}

.tag-chip-lock-icon {
  font-size: 0.75rem;
  opacity: 0.8;
}

.tag-add {
  position: relative;
}

.tag-add-input {
  border: 1px solid transparent;
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  min-width: 10rem;
}

.tag-add-input:hover, .tag-add-input:focus {
  border-color: var(--rb-border);
  outline: none;
}

/* Edit.cshtml: shared "this field is in a bad/incomplete state" treatment - the title while
   empty (after trimming) and the category add-field's raw text, typed but never turned into a
   chip. The tag field only ever gets it while blurred (see category-picker.js's focus handler),
   so it reads as "you left this unfinished," not as validation-while-typing; the title gets it
   live, since an empty title is unambiguously incomplete regardless of focus. */
/* Overrides .rich-edit's own `background: #fff` below - equal specificity, so without this the
   later .rich-edit rule would silently win by source order and the title would never actually
   look red despite the class being applied. */
.field-invalid,
.rich-edit.field-invalid {
  background: var(--rb-invalid-bg);
}

/* Existing recipe fields whose current value differs from the value loaded from the server. */
.edit-field-changed:not(.field-invalid) {
  background: var(--rb-highlight-bg);
  border-radius: 0.3rem;
}

.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
  margin: 0.2rem 0 0;
  padding: 0.2rem 0;
  min-width: 12rem;
  max-height: 14rem;
  overflow-y: auto;
  list-style: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tag-suggestion {
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.tag-suggestion.highlighted {
  background: var(--rb-selected-bg);
}

.tag-suggestion-add {
  color: #258cfb;
  border-top: 1px solid var(--rb-border-faint);
}

.edit-ingredients .ingredient-section, .edit-instructions .instruction-section {
  margin-bottom: 1rem;
}

.section-edit-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.section-title-rich-edit {
  font-weight: bold;
  border: none;
  border-bottom: 1px solid var(--rb-border);
  border-radius: 0;
  padding: 0.1rem 0.2rem;
  background: none;
}

.section-title-rich-edit:focus {
  border-bottom-color: #258cfb;
}

/* Same convention as any other empty contenteditable placeholder in this app - shown only while
   the field truly has no content (a lone <br> from an empty rich-edit doesn't count). */
.section-title-rich-edit:empty::before {
  content: attr(data-placeholder);
  color: var(--rb-text-fainter);
  font-weight: normal;
}

.join-section-btn, .demote-section-btn {
  font-size: 0.9rem;
}

.edit-table input {
  border: 1px solid transparent;
  background: transparent;
  padding: 0.2rem 0.3rem;
  border-radius: 0.2rem;
  width: 100%;
}

.edit-table input:hover, .edit-table input:focus {
  border-color: var(--rb-border);
  background: var(--rb-surface);
}

.edit-table .unit-input {
  width: 5rem;
}

/* .edit-table input's own width:100% (above) stretches a bare checkbox to fill the whole
   optional-col cell, same as any text input - leaving a wide dead-click gap before the visible
   check square. Needs .edit-table in the selector too so its specificity actually wins over that
   rule instead of losing to source order. */
.edit-table .optional-checkbox {
  width: 35%;
}

/* Lighter/smaller than typed text, so a placeholder like "alt. units" or "notes" doesn't
   visually compete with columns that actually have data - the :empty selector this rides on
   already drops out the moment the user types anything, so typed text always renders at the
   field's normal size/color regardless of this rule. */
.notes-input:empty::before, .altunits-input:empty::before {
  content: attr(data-placeholder);
  color: var(--rb-text-faintest);
  font-size: 0.8em;
}

.optional-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--rb-text-muted);
  font-size: 1.2rem;
  white-space: nowrap;
  cursor: pointer;
}

/* Unchecked shows the "!" emoji, checked shows "?" hue-rotated green - only one of the two is
   ever displayed, switched purely by the checkbox's own :checked state (no JS). */
.optional-icon-checked {
  display: none;
  filter: hue-rotate(165deg) brightness(1.2);
}

.optional-checkbox:checked ~ .optional-icon-unchecked {
  display: none;
}

.optional-checkbox:checked ~ .optional-icon-checked {
  display: inline;
}

.qty-stepper {
  display: flex;
  align-items: stretch;
}

.edit-table .qty-input {
  width: 3rem;
  text-align: right;
}

/* Edit.cshtml renders one <table> per section, and table-layout:auto (the default) sizes each
   table's columns independently from its own content - so the same logical column (e.g. Unit)
   ends up a different width in every section, purely depending on what's typed there. Fixed
   layout plus explicit widths for the icon/quantity columns makes every section's table agree on
   the same column boundaries; Name and Notes (no explicit width, below) split whatever's left
   between them, so any stretch on a wide screen happens there instead of drifting per section. */
.edit-table {
  table-layout: fixed;
}

.edit-table .row-actions {
  width: 8rem;
}

.edit-table .qty-col {
  width: 5rem;
}

.edit-table .unit-col {
  width: 6rem;
}

.edit-table .name-col {
  width: 1.5in;
}

.edit-table .name-rich-edit {
  min-width: 1.5in;
}

.edit-table .notes-col {
  width: 1in;
}

.edit-table .notes-input {
  min-width: 1in;
}

.edit-table .altunits-col {
  width: 6.5rem;
}

.edit-table .optional-col {
  width: 5rem;
}

.edit-table .remove-col {
  width: 5rem;
}

.row-actions {
  position: relative;
}

.remove-col {
  position: relative;
  white-space: nowrap;
}

.row-actions-end {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: none;
}

.insert-content-btn {
  border: 1px solid var(--rb-border);
  background: var(--rb-surface);
  color: var(--rb-text-soft);
  border-radius: 0.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.15rem 0.4rem;
}

/* Placeholder shown in place of rows when a section has none yet (a brand-new section, or one
   just dragged/removed empty) - gives the row-less container real height to drag onto, and
   signals that it's a valid drop target. */
.empty-section-hint td, li.empty-section-hint {
  text-align: center;
  color: var(--rb-text-fainter);
  font-style: italic;
  padding: 0.6rem;
  border: 1px dashed var(--rb-border);
  border-radius: 0.3rem;
}

.qty-spin {
  display: flex;
  flex-direction: column;
  margin-left: 0.1rem;
}

.qty-spin-btn {
  border: 1px solid var(--rb-border);
  background: var(--rb-surface);
  cursor: pointer;
  line-height: 1;
  padding: 0 0.2rem;
  font-size: 0.5rem;
  color: inherit;
  flex: 1;
}

.qty-spin-btn:first-child {
  border-radius: 0.2rem 0.2rem 0 0;
  border-bottom: none;
}

.qty-spin-btn:last-child {
  border-radius: 0 0 0.2rem 0.2rem;
}

/* Only the instruction-row version of .row-actions is a <div> - the ingredient-row version is a
   real <td> (Edit.cshtml), and giving a table cell `display: flex` takes it out of the table's
   row-height sync, so its border-bottom no longer lines up with its sibling cells'. Scoping this
   to the div keeps the ingredient <td> a normal table cell. */
div.row-actions {
  display: flex;
  gap: 0.2rem;
  white-space: nowrap;
}

.row-btn {
  border: 1px solid var(--rb-border);
  background: var(--rb-surface);
  border-radius: 0.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.15rem 0.4rem;
}

.row-btn.remove-btn {
  color: var(--rb-danger-text);
  border-color: var(--rb-danger-border);
}

.row-btn.confirm-btn {
  color: var(--rb-success-text);
  border-color: var(--rb-success-border);
}

/* Bulk Import */

.bulk-import-dropzone {
  border: 2px dashed var(--rb-border-strong);
  border-radius: 0.5rem;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--rb-text-soft);
  margin-bottom: 1.5rem;
}

.bulk-import-dropzone.drag-over {
  border-color: #258cfb;
  background: var(--rb-selected-bg);
  color: var(--rb-text-max);
}

.bulk-import-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.bulk-import-bucket {
  border: 1px solid var(--rb-border-soft);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.bulk-import-bucket h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.bulk-import-bucket ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bulk-import-bucket li {
  padding: 0.25rem 0;
  overflow-wrap: anywhere;
}

.bulk-import-bucket[data-bucket="issue"] {
  border-color: var(--rb-danger-border);
}


.drag-handle {
  display: inline-flex;
  align-items: center;
  cursor: grab;
  color: var(--rb-text-fainter);
  padding: 0.15rem 0.2rem;
  line-height: 1;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

[data-role$="-row"].dragging {
  opacity: 0.85;
  outline: 2px dashed #258cfb;
  outline-offset: -2px;
  background: var(--rb-selected-bg);
}

/* Reordered rows slide in from wherever they used to be (set per-row by edit-mode.js) rather
   than snapping into their new slot. */
@keyframes row-slide-in {
  from {
    transform: translateY(var(--row-slide-offset, 0));
  }
  to {
    transform: translateY(0);
  }
}

[data-role$="-row"].row-sliding {
  animation: row-slide-in 150ms ease-out;
}

.add-row-btn, .add-section-btn {
  margin-top: 0.4rem;
  border: 1px dashed var(--rb-border-strong);
  background: none;
  border-radius: 0.3rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.add-section-btn {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.paste-row-btn {
  margin-left: 0.4rem;
}

/* The § badge used on both the "Add Section" button and each row's split-section button. */
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  flex: none;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.85em;
  line-height: 1;
}

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

.edit-list li, .edit-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rb-border-faint);
}

.edit-note {
  border-top: none;
}

.rich-edit {
  flex: 1;
  min-height: 1.6rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
  background: var(--rb-surface);
}

.rich-edit:focus {
  outline: none;
  border-color: #258cfb;
}

.edit-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.save-btn {
  background: #258cfb;
  color: #fff;
  border: none;
  border-radius: 0.3rem;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
}

.save-btn:disabled {
  background: var(--rb-save-disabled-bg);
  cursor: default;
}

.cancel-btn {
  padding: 0.5rem 1rem;
}

/* Light mode keeps the browser's native button look; its dark-mode equivalent (a flat gray box
   with a bright border) clashes with every other button here, so match .row-btn instead. */
[data-bs-theme="dark"] button.cancel-btn {
  background: var(--rb-surface);
  color: var(--bs-body-color);
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
}

.validation-summary {
  color: var(--rb-danger-text);
  border: 1px solid var(--rb-danger-border);
  border-radius: 0.3rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.save-validation-hint {
  color: var(--rb-danger-text);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

/* "fields" gets the same light-red-background treatment as an actual invalid field (title,
   unconfirmed category text) instead of just being red text, so it visually points at what to
   look for rather than only saying it. */
.save-validation-hint .field-invalid {
  color: var(--rb-text-max);
  padding: 0 0.25rem;
  border-radius: 0.2rem;
}

.unsaved-dialog {
  border: none;
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  max-width: 24rem;
}

.unsaved-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.unsaved-dialog p {
  margin: 0 0 1rem;
}

.paste-fallback-textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
  font: inherit;
}

.unsaved-dialog-actions {
  display: flex;
  flex-wrap: wrap; /* Settings' dialog has a 4th choice (Revert) - wrap rather than overflow. */
  justify-content: flex-end;
  gap: 0.75rem;
}

.settings-section {
  margin-bottom: 1.5rem;
}

/* Specs/Settings.md: each section collapses behind its <h2> (native <details>/<summary>,
   collapsed by default) so the page reads as a list of topics rather than one long form. */
.settings-section > summary {
  cursor: pointer;
}

.settings-section > summary > h2 {
  display: inline;
}

/* The known-units subheadings (Volumes/Weights/Lengths) render close to h2's size by default
   (Bootstrap's h2/h3 are only ~0.25rem apart) - shrunk so they read as subheadings, not a
   second tier of section headers. */
.settings-section h3 {
  font-size: 1.15rem;
}

.settings-field {
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 0.3rem;
}

/* Specs/Settings.md, "Save or Cancel": "any changed regions [styled] in a way to indicate
   unsaved changes" - applied to a field's wrapper (not the field itself) so it stays visible
   whether the field is a checkbox, table, or textarea. */
.settings-field.field-changed {
  background: var(--rb-changed-bg);
  border-color: #4bb9f0;
}

.settings-help {
  color: var(--rb-text-muted);
  font-size: 0.9rem;
}

/* Settings.cshtml, "Visuals" and "Quick List": visually-hidden radios (the "checkbox hack",
   same as .bookmark-toggle-input below) inside an inline sentence, each choice rendered as a
   pressable button rather than a radio dot - same "active" look as .bulkedit-action-btn. Fixed
   DOM/visual order - no reordering on selection. */
.settings-choice-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.settings-choices {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
}

.settings-choice {
  display: inline-block;
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  background: var(--rb-surface);
  padding: 0.15rem 0.5rem;
  cursor: pointer;
}

.settings-choice-input:checked + .settings-choice {
  border-color: #258cfb;
  background: var(--rb-selected-bg);
  color: #258cfb;
}

.settings-choice-input:focus-visible + .settings-choice {
  outline: 2px solid #258cfb;
  outline-offset: 1px;
}

/* Specs/Settings.md, "Bookmarks": a visually-hidden checkbox paired with a .bookmark-btn label
   right after it in the DOM (the "checkbox hack") - lets the Settings page reuse the Read page's
   own bookmark-button art/states while still posting as a normal form checkbox. */
.bookmark-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bookmark-toggle-input:checked + .bookmark-btn {
  opacity: 1;
  background: var(--rb-brown);
  border-color: var(--rb-brown);
}

.bookmark-toggle-input:checked + .bookmark-btn .bookmark-icon {
  transform: scale(1.2);
}

.bookmark-toggle-input:focus-visible + .bookmark-btn {
  outline: 2px solid #258cfb;
  outline-offset: 1px;
}

.units-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 0.5rem;
}

.units-table .unit-number-col {
  width: 5rem;
}

.units-table .unit-remove-col {
  width: 2.5rem;
}

.units-table th {
  text-align: left;
  font-weight: normal;
  color: var(--rb-text-muted);
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
}

.units-table td {
  padding: 0.2rem 0.4rem;
}

.units-table .unit-name-input,
.units-table .unit-multiplier-input,
.units-table .unit-base-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
}

/* Specs/Settings.md: a base unit (no unit of its own to be a multiple of) shows "basis" here
   instead of being left blank. */
.units-table .unit-base-input.is-basis,
.units-table .unit-base-input option[value=""] {
  color: var(--rb-text-faint);
  font-style: italic;
}

.unit-alias-name-col {
  width: 8rem;
}

.unit-alias-name-cell {
  font-weight: 600;
}

/* Friends.cshtml (Specs/Sharing.md, "Friends page layout"): one line per friend on a portrait
   phone. Every column but Email has a fixed width, so the email gets whatever is left (~8rem at
   390px wide) and ellipsizes past that. Capped on wide screens, where the email column would
   otherwise stretch absurdly far. */
.friends-table {
  max-width: 40rem;
}

.friends-table th,
.friends-table td {
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  vertical-align: middle;
}

.friends-table .friend-drag-col {
  width: 1.4rem;
}

/* Nicknames are short - "Bob (uncle)" fits. */
.friends-table .friend-name-col {
  width: 5.5rem;
}

.friends-table .friend-sharing-col {
  width: 5.6rem;
}

/* Wide enough for one button: Save takes 🗑️'s place while the row has unsaved changes. */
.friends-table .friend-actions-col {
  width: 3rem;
}

.friend-email {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 0.9rem;
}

.friend-email-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.friends-table .friend-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
}

.friend-sharing {
  display: flex;
  gap: 0.1rem;
}

.friend-sharing .mode-checkbox {
  width: 26px;
  height: 26px;
  --rb-checkbox-halo-width: 2.6px;
}

.friend-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}

.friend-row-actions:has([data-role="friend-save-btn"]:not([hidden])) .remove-btn {
  display: none;
}

/* Friends table footer: "+ Add friend" on the left, Confirm 🗑️ in the actions column. Confirm is
   wider than that column - .friend-row-actions' flex-end lets it overflow leftward, keeping its
   right edge lined up with the 🗑️ buttons above. Both buttons drop their own top margin so they
   sit level with each other. */
.friends-list-actions td {
  padding-top: 0.4rem;
}

.friends-list-actions .add-row-btn {
  margin-top: 0;
}

.friend-row-actions .save-row-btn {
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  font-size: 0.85rem;
}

.friend-status {
  flex: none;
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

/* friends.js's custom tooltip for [data-tip] - shown on hover, and on long-press for touch
   screens, which never show a native title tooltip. */
.friend-tip {
  position: absolute;
  z-index: 1000;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: 0.3rem 0.5rem;
  border-radius: 0.3rem;
  background: #333;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.3;
  pointer-events: none;
  overflow-wrap: anywhere;
}

.friends-table [data-tip] {
  -webkit-touch-callout: none;
  user-select: none;
}

.friend-status.connected {
  filter: drop-shadow(0 0 0.25rem rgba(46, 125, 50, 0.9));
}

.friends-help {
  margin-top: 2rem;
  color: var(--rb-text-soft);
}

.friends-help h3 {
  margin-top: 1rem;
}

.friends-help-list {
  list-style: none;
  padding-left: 0;
}

.friends-help-list li {
  margin-bottom: 0.4rem;
}

.friends-help-list .mode-checkbox {
  width: 26px;
  height: 26px;
  --rb-checkbox-halo-width: 2.6px;
  margin-right: 0.3rem;
}

.unit-alias-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
}

.settings-warnings {
  margin-top: 0.5rem;
}

.settings-warning {
  color: var(--rb-warning-text);
  background: var(--rb-warning-bg);
  border: 1px solid var(--rb-warning-border);
  border-radius: 0.3rem;
  padding: 0.4rem 0.6rem;
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

/* 🚫 conflicts (the same spelling on two units) are errors, not just notes - light red, same
   background as a .delete-pending row. */
.settings-warning.settings-error {
  color: var(--rb-error-text);
  background: var(--rb-danger-bg);
  border-color: var(--rb-error-border);
}

.about-logo {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  margin: 1rem 0;
}

/* _Layout.cshtml: the login dropdown now sits directly in the top navbar row instead of behind a
   hamburger (Specs/Overview.md, "Hamburger menu leads to username dropdown"). Without a
   .navbar-expand-* wrapper, Bootstrap's own .navbar-nav .dropdown-menu is position:static below
   the sm breakpoint - meant for growing inline inside an opened collapse panel - which here would
   instead grow the header bar itself. Force it to float over the page at every width. Bootstrap
   also skips Popper.js positioning for any dropdown inside a .navbar (its top/left/right offsets
   only apply via the [data-bs-popper] attribute Popper adds), so those offsets are reproduced
   here by hand instead. */
.navbar .navbar-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: var(--bs-dropdown-spacer);
}

.navbar .navbar-nav .dropdown-menu-end {
  right: 0;
  left: auto;
}

/* Same missing-.navbar-expand-* wrapper as above: Bootstrap only gives .navbar-nav .nav-link
   horizontal padding (--bs-navbar-nav-link-padding-x) inside that wrapper, so the header's icon
   buttons (🔙🔼🔽, account avatar) otherwise butt right up against each other with no horizontal
   tap target. */
.navbar .navbar-nav .nav-link {
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

/* Wider Read-page navigation targets with a button outline that does not affect their height. */
.navbar .navbar-nav .read-nav-btn {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
  background: var(--rb-surface);
  border-radius: 0.4rem;
  box-shadow: inset 0 0 0 1px var(--rb-border);
  margin: 0 0.1rem;
}

/* Identity.md: the account-menu icon, either a Graph photo or AccountAvatar's generated SVG
   fallback - both come back as arbitrary-sized images, so this is what actually makes it read as
   a small round avatar rather than a photo strip. */
.avatar-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  vertical-align: middle;
  object-fit: cover;
}

/* The About link's icon, sized to sit inline with the emoji glyphs used by the other logout
   dropdown items (Settings, Friends, ...) instead of the app-icon's native (much larger) size. */
.dropdown-item-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

.logout-form {
  margin: 0;
}

.logout-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

/* Read.cshtml (Specs/Overview.md, "Next/Previous"): the grayed-out 🔼/🔽 shown at either end of
   the list - a <span>, not a disabled <a>, since there's nowhere for it to link to. `color` has
   no effect on 🔼/🔽 themselves - they're color emoji, drawn as pre-rendered glyphs by the font,
   not text painted with currentColor - so grayscale() is what actually dims them (same fix as
   .bookmark-row-icon-dim below). */
.nav-link-disabled {
  color: var(--rb-text-fainter);
  filter: grayscale(100%);
  opacity: 0.5;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

/* TagRepair.cshtml (Specs/CategoryRepair.md): .units-table's own table-layout:fixed divides the
   row into equal-width columns regardless of content, since none of the shared .units-table
   column-width classes (.unit-number-col etc.) apply here - far too narrow for this table's
   heterogeneous columns (name, two inputs + two buttons, a select + button, plain text). Auto-
   sizing based on actual content is simpler than hand-tuning per-column widths. */
.units-table.tag-repair-table {
  table-layout: auto;
}

/* Friends.cshtml's .friend-row-actions used to put display:flex directly on a <td> - fine for its
   own simple table, but flex containers and the table column-sizing algorithm disagree across
   browsers once a row's content gets this wide, which is what was actually breaking the layout
   here (not the table-layout:fixed above, though that was worth fixing anyway). Flexing an inner
   <div> instead keeps the <td> a plain block the table can size normally, and the flex layout
   happens safely inside that already-sized box. */
.tag-repair-row-flex {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.tag-repair-visual-input {
  width: 3rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
}

/* A <textarea> rather than an <input> (Specs/CategoryRepair.md) - textareas keep their native
   spellcheck squiggles even when not focused, unlike inputs, but need resetting back to looking
   and behaving like a single-line field (no wrap/resize; tag-repair.js also blocks Enter and
   strips newlines on paste). */
.tag-repair-name-input {
  width: 12rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--rb-border);
  border-radius: 0.3rem;
  font: inherit;
  resize: none;
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
}

.tag-repair-usage {
  color: var(--rb-text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.not-found-image {
  display: block;
  max-width: 280px;
  width: 100%;
  height: auto;
  margin: 1rem 0;
}

/* Bulk Edit (Specs/BulkEdit.md, "Action area layout"): landscape puts the action area on the
   right, portrait puts it across the bottom third - either way it stays put while the recipe list
   scrolls independently beside/above it. The height budget (view height minus the navbar/heading
   above) is an approximation, not pixel-exact - fine for a scrollable region. */
.bulkedit-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bulkedit-list-area {
  overflow-y: auto;
  min-height: 0;
}

.bulkedit-table {
  width: 100%;
  border-collapse: collapse;
}

.bulkedit-table th, .bulkedit-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rb-border-faint);
}

.bulkedit-table thead th {
  position: sticky;
  top: 0;
  background: var(--rb-surface);
  border-bottom: 1px solid var(--rb-border);
}

.bulkedit-check-col {
  width: 1%;
  white-space: nowrap;
}

.bulkedit-categories-col .tag, .bulkedit-bookmarks-col {
  font-size: 0.9rem;
}

.bulkedit-action-area {
  border: 1px solid var(--rb-border-soft);
  border-radius: 0.5rem;
  padding: 0.75rem;
  overflow-y: auto;
}

.bulkedit-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bulkedit-select-hint {
  margin-top: 0.5rem;
  color: var(--rb-text-faint);
  font-style: italic;
  font-size: 0.9rem;
}

.bulkedit-action-btn {
  border: 1px solid var(--rb-border);
  border-radius: 0.4rem;
  background: var(--rb-surface);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.bulkedit-action-btn.active {
  border-color: #258cfb;
  background: var(--rb-selected-bg);
  color: #258cfb;
}

.bulkedit-action-btn:disabled {
  color: var(--rb-text-fainter);
  background: var(--rb-surface-disabled);
  cursor: default;
}

.bulkedit-action-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rb-border-faint);
}

.bulkedit-action-panel-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.bulkedit-action-status {
  margin-top: 0.5rem;
  color: var(--rb-text-muted);
}

/* Specs/BulkEdit.md, "Bookmarks": a tri-state pill per bookmark type - "off" is outlined/empty,
   "on" is filled, "intermediate" ("Perhaps the oval is transparent on the left half, and filled
   on the right half") splits the two down the middle via a gradient. */
.bulkedit-bookmark-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bulkedit-bookmark-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--rb-border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: var(--rb-surface);
  cursor: pointer;
}

.bulkedit-bookmark-count {
  font-size: 0.85rem;
  color: var(--rb-text-muted);
}

.bulkedit-bookmark-on {
  border-color: var(--rb-brown);
  background: var(--rb-brown);
  color: #fff;
}

.bulkedit-bookmark-on .bulkedit-bookmark-count {
  color: #f0e6de;
}

.bulkedit-bookmark-off {
  border-color: var(--rb-border);
  background: var(--rb-surface);
}

.bulkedit-bookmark-intermediate {
  border-color: var(--rb-brown);
  background: linear-gradient(135deg, var(--rb-brown) 50%, var(--rb-surface) 50%);
}

.bulkedit-share-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bulkedit-share-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid var(--rb-border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  text-align: left;
  /* No background here - one of .bulkedit-bookmark-on/off/intermediate (declared above) always
     applies alongside this class and must control it; a "background: #fff" here would win the
     cascade (equal specificity, declared later) and silently wipe out the intermediate gradient. */
}

/* The intermediate diagonal puts the friend's name over the brown (upper-left) half and the
   count over the white (lower-right) half (Specs/BulkEdit.md, "Share") - so unlike Bookmarks'
   intermediate (icon glyphs render their own color regardless of CSS), the name here needs the
   same white text as the fully-selected state for contrast, while the count stays on its
   already-legible default gray/black. */
.bulkedit-share-toggle.bulkedit-bookmark-intermediate {
  color: #fff;
}

.bulkedit-share-toggle.bulkedit-bookmark-intermediate .bulkedit-bookmark-count {
  color: var(--rb-text-muted);
}

.bulkedit-share-empty {
  margin: 0;
  color: var(--rb-text-muted);
  font-size: 0.9rem;
}

.bulkedit-share-summary {
  margin: 0.5rem 0 0;
  color: var(--rb-text-strong);
  font-size: 0.9rem;
}

.bulkedit-export-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.bulkedit-export-overwrite-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

@media (orientation: portrait) {
  .bulkedit-layout {
    height: calc(100vh - 13rem);
  }

  .bulkedit-list-area {
    flex: 2;
  }

  .bulkedit-action-area {
    flex: 1;
  }
}

@media (orientation: portrait) and (max-width: 767.98px) {
  .bulkedit-list-area,
  .bulkedit-action-area {
    flex: 1;
  }
}

@media (orientation: landscape) {
  .bulkedit-layout {
    flex-direction: row;
    height: calc(100vh - 9rem);
  }

  .bulkedit-list-area {
    flex: 1;
  }

  .bulkedit-action-area {
    width: 320px;
    flex: none;
  }
}

/* Specs/BulkEdit.md, "Actions": "Animate all *changed* recipes with a 500ms keyframe animation to
   pulse each recipe's title (grow, then shrink back to normal)". inline-block so the scale
   transform has a predictable center - a plain inline <a> can transform unpredictably depending
   on how it wraps. */
@keyframes bulkedit-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.bulkedit-pulse {
  display: inline-block;
  animation: bulkedit-pulse 500ms ease;
}