html {
  font-size: 14px;
}

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

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

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

body {
  margin-bottom: 60px;
}

.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-list li {
  padding: 0.5rem 0;
  font-size: 1.25rem;
}

.breadcrumbs {
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
  color: #666;
}

.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 #ccc;
  border-radius: 0.4rem;
  padding: 0.1rem 0.5rem;
}

.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: #888;
  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 #ddd;
  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: #666;
}

.finder-tab.active {
  color: #000;
  border-bottom-color: #258cfb;
  font-weight: 600;
}

.coming-soon {
  color: #888;
  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 #ccc;
  border-radius: 0.3rem;
  font-size: 1rem;
}

.search-find-btn {
  border: 1px solid #258cfb;
  color: #258cfb;
  background: #fff;
  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: #666;
  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: #fff;
  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 #eee;
}

.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;
}

.new-quick-list-link {
  display: inline-block;
  margin-top: 0.5rem;
}

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

.quicklist-combine-btn {
  display: block;
  margin: 0.5rem 0;
  border: 1px solid #5a3e2b;
  color: #fff;
  background: #5a3e2b;
  border-radius: 0.4rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

/* 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: #ccc;
}

.quicklist-regen-btn {
  border: 1px solid #ccc;
  border-radius: 0.4rem;
  background: #fff;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  line-height: 1;
}

.quicklist-save-btn {
  position: relative;
  border: 1px solid #ccc;
  border-radius: 0.4rem;
  background: #fff;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  line-height: 1;
  font-size: 1.1rem;
}

.quicklist-save-btn.saved {
  cursor: default;
  opacity: 0.85;
}

/* Small green checkmark badge, overlapping the button's corner - hidden until .saved. */
.quicklist-save-check {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.1rem;
  text-align: center;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.quicklist-save-btn.saved .quicklist-save-check {
  opacity: 1;
  transform: scale(1);
}

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

.quicklist-item, .quicklist-add-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
}

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

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

.quicklist-text-input, .quicklist-edit-input {
  flex: 1;
  font-size: 1.1rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
  padding: 0.2rem 0.4rem;
}

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

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

.quicklist-delete-btn {
  color: #c0392b;
  border-color: #e0b4ac;
}

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

.quicklist-delete-list-btn {
  border: 1px solid #e0b4ac;
  color: #c0392b;
  background: #fff;
  border-radius: 0.4rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

/* 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 {
  flex: 1;
}

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

/* Shopping-bookmarks list (Specs/ShoppingMode.md). */
.shopping-cart-subtitle {
  color: #888;
  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 #eee;
}

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

.shopping-cart-item-recipes {
  color: #888;
  font-size: 0.9rem;
  flex: none;
}

.shopping-cart-recipes {
  color: #666;
  font-size: 0.95rem;
  margin-top: 1rem;
}

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

.shopping-cart-recipes ol {
  margin: 0;
  padding-left: 1.5rem;
}

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

.shopping-cart-clear-btn {
  border: 1px solid #e0b4ac;
  color: #c0392b;
  background: #fff;
  border-radius: 0.4rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.tags {
  margin: 0.5rem 0;
}

.tag {
  display: inline-block;
  background: #f0e6da;
  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: #dce8f5;
  color: #2c5a8a;
}

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

.bookmark-btn {
  background: #fff;
  border: 1px solid #ccc;
  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: #5a3e2b;
  border-color: #5a3e2b;
}

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

.edit-recipe-btn {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0.4rem;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.recipe-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

.delete-recipe-btn {
  color: #c0392b;
  border-color: #e0b4ac;
}

/* 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: #fff;
  border: 1px solid #ccc;
  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: #999;
  cursor: default;
}

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

.share-empty {
  color: #666;
  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: #fff3b0;
}

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

.multiplier.invalid .qty-input {
  color: #c0392b;
}

.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 #ccc;
  border-radius: 0.4rem;
  position: relative;
  top: -4px;
}

.mode-toggles-label {
  font-size: 0.8rem;
  color: #666;
  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 #eee;
}

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

/* 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;
}

/* Mode-checkbox art: /checkboxes/<Mode>-no.png (unchecked) and <Mode>-yes.png (checked). */
.mode-checkbox[data-check="shopping"] {
  background-image: url("/checkboxes/Shopping-no.png");
}
input.mode-checkbox[data-check="shopping"]:checked {
  background-image: url("/checkboxes/Shopping-yes.png");
}

.mode-checkbox[data-check="ready"] {
  background-image: url("/checkboxes/Ready-no.png");
}
input.mode-checkbox[data-check="ready"]:checked {
  background-image: url("/checkboxes/Ready-yes.png");
}

.mode-checkbox[data-check="prepared"] {
  background-image: url("/checkboxes/Prepared-no.png");
}
input.mode-checkbox[data-check="prepared"]:checked {
  background-image: url("/checkboxes/Prepared-yes.png");
}

.mode-checkbox[data-check="done"] {
  background-image: url("/checkboxes/Done-no.png");
}
input.mode-checkbox[data-check="done"]:checked {
  background-image: url("/checkboxes/Done-yes.png");
}

.mode-checkbox[data-check="complete"] {
  background-image: url("/checkboxes/Complete-no.png");
}
input.mode-checkbox[data-check="complete"]:checked {
  background-image: url("/checkboxes/Complete-yes.png");
}

.section-heading {
  caption-side: top;
  text-align: left;
  font-weight: bold;
  margin-top: 1rem;
}

.ingredient-notes {
  color: #666;
  font-style: italic;
}

.detail-tag {
  background: #fdf1d6;
  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 #eee;
  padding: 0.5rem 0;
}

.note-meta {
  color: #888;
  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 #ccc;
  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;
}

/* Edit Mode */

.new-recipe-link {
  margin-bottom: 1rem;
  display: inline-block;
}

.bulk-import-link {
  margin-bottom: 1rem;
  margin-left: 1rem;
  display: inline-block;
}

.edit-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

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

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

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

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

.edit-field label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  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 {
  flex: 1;
  min-width: 0;
}

.credit-input {
  width: 100%;
  max-width: 28rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
}

/* 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: #666;
  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 #ccc;
  border-radius: 0.4rem;
}

.tag-picker-label {
  font-size: 0.8rem;
  color: #666;
}

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

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f0e6da;
  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: #8a5a34;
  line-height: 1;
  padding: 0 0.2rem;
}

.tag-chip-locked {
  background: #e2d5c3;
}

.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: #ccc;
  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. */
.field-invalid {
  background: #fbe4e1;
}

.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #ccc;
  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: #eaf3ff;
}

.tag-suggestion-add {
  color: #258cfb;
  border-top: 1px solid #eee;
}

.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 #ccc;
  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: #999;
  font-weight: normal;
}

.join-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: #ccc;
  background: #fff;
}

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

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

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

/* Specs/RecipeSections.md, "Inserting content": splitting and mid-section insertion are kept
   visually and positionally distinct - splitting is ONLY along the left margin (row-actions,
   alongside drag/move), insertion is ONLY along the right margin (remove-col / row-actions-end,
   alongside remove). */
.row-actions {
  position: relative;
}

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

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

/* Floating "insert a section break here" button (Specs/RecipeSections.md, "Splitting"). Anchored
   into the row's left action column, pulled up so it straddles the row's top border, and hidden
   until that row is hovered. */
.split-section-btn {
  display: none;
  align-items: center;
  position: absolute;
  top: -0.8rem;
  left: 1.6rem;
  z-index: 1;
  border: 1px solid #258cfb;
  background: #fff;
  color: #258cfb;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.4;
  cursor: pointer;
}

tr[data-role="ingredient-row"]:hover .split-section-btn,
li[data-role="instruction-row"]:hover .split-section-btn {
  display: inline-flex;
}

.split-section-btn .section-icon {
  width: 1em;
  height: 1em;
}

/* Subtler than the split button on purpose (Specs/RecipeSections.md: the two must not be
   confusable) - a small always-visible "+" on the opposite margin, not a floating hover badge. */
.insert-content-btn {
  border: 1px solid #ccc;
  background: #fff;
  color: #555;
  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: #999;
  font-style: italic;
  padding: 0.6rem;
  border: 1px dashed #ccc;
  border-radius: 0.3rem;
}

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

.qty-spin-btn {
  border: 1px solid #ccc;
  background: #fff;
  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;
}

.row-actions {
  display: flex;
  gap: 0.2rem;
  white-space: nowrap;
}

.row-btn {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 0.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.15rem 0.4rem;
}

.row-btn.remove-btn {
  color: #c0392b;
  border-color: #e0b4ac;
}

.row-btn.confirm-btn {
  color: #2e7d32;
  border-color: #a8d5ab;
}

/* Bulk Import */

.bulk-import-dropzone {
  border: 2px dashed #999;
  border-radius: 0.5rem;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  color: #555;
  margin-bottom: 1.5rem;
}

.bulk-import-dropzone.drag-over {
  border-color: #258cfb;
  background: #eaf3ff;
  color: #111;
}

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

.bulk-import-bucket {
  border: 1px solid #ddd;
  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: #e0b4ac;
}


.drag-handle {
  display: inline-flex;
  align-items: center;
  cursor: grab;
  color: #999;
  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: #eaf3ff;
}

/* 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 #999;
  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 #eee;
}

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

.rich-edit {
  flex: 1;
  min-height: 1.6rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
  background: #fff;
}

.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: #a9c9f5;
  cursor: default;
}

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

.validation-summary {
  color: #c0392b;
  border: 1px solid #e0b4ac;
  border-radius: 0.3rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.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;
  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: #e1f0ff;
  border-color: #4bb9f0;
}

.settings-help {
  color: #666;
  font-size: 0.9rem;
}

/* 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: #5a3e2b;
  border-color: #5a3e2b;
}

.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: #666;
  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 #ccc;
  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: #888;
  font-style: italic;
}

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

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

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

.friend-row-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.friend-status {
  color: #666;
  font-size: 0.8rem;
  margin-left: 0.4rem;
}

.friend-status.connected {
  color: #2e7d32;
}

.unit-alias-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.3rem 0.4rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
}

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

.settings-warning {
  color: #8a6d3b;
  background: #fff8e1;
  border: 1px solid #f0c14b;
  border-radius: 0.3rem;
  padding: 0.4rem 0.6rem;
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

.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 (🔙🔼🔽, 👤) 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;
}

.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: #999;
  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 puts 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 #ccc;
  border-radius: 0.3rem;
}

.tag-repair-name-input {
  width: 12rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
}

.tag-repair-usage {
  color: #666;
  font-size: 0.85rem;
  white-space: nowrap;
}

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