/* foodtracker.uk — shared auth styles (production) */
:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --border: #E4E2DC;
  --text: #1C1B1A;
  --text-secondary: #5C5A55;
  --text-muted: #8A8780;
  --primary: #3D6B5A;
  --primary-soft: #E4EFE9;
  --radius: 10px;
  --focus-ring: rgba(61, 107, 90, 0.35);
  --touch: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow-y: auto;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* flex-start + auto margins on .page: centres short pages, scrolls from top when tall */
  justify-content: flex-start;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  padding: 24px 20px 56px;
  overflow-x: hidden;
  overflow-y: auto;
}

.page {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  margin-top: auto;
  margin-bottom: auto;
  padding-bottom: 8px;
}

/* Wizard / long forms: pin to top so fields + actions stay in normal document scroll */
.page.page-wizard {
  margin-top: 0;
  margin-bottom: 0;
  max-width: 440px;
}

.page.page-wizard .brand {
  margin-bottom: 20px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  padding-bottom: 4px;
}

.card {
  width: 100%;
}

.brand {
  margin-bottom: 40px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-lockup img.mark,
.brand-lockup .mark-img {
  width: 44px;
  height: 44px;
  display: block;
  flex-shrink: 0;
  border-radius: 10px;
}

.wordmark {
  font-size: 22px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tagline {
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-secondary);
}

.sr-only, h1.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: var(--touch);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: var(--text-muted);
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.field input:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

button.primary {
  margin-top: 8px;
  height: var(--touch);
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

button.primary:hover {
  background: #355c4d;
}

button.primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}

button.primary:active {
  opacity: 0.92;
}

button.primary:disabled,
.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-note {
  margin-top: 4px;
  min-height: 1.4em;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.form-note.is-visible {
  color: var(--text-secondary);
}

.form-note.is-info {
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: left;
}

.footer {
  margin-top: 40px;
  text-align: center;
  padding-top: 8px;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

.footer a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.footer span {
  color: var(--text-secondary);
  font-size: 15px;
}

.site-footer {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

@media (min-width: 480px) {
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px 32px;
    box-shadow: 0 8px 24px rgba(28, 27, 26, 0.04);
  }

  .footer {
    margin-top: 28px;
  }
}

.form-note.is-error {
  color: #8B3A3A;
  background: #F8EAEA;
  border: 1px solid #E2BDBD;
  border-radius: 10px;
  padding: 10px 12px;
}

/* Post-login home */
.home-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-greeting,
.home-kitchen {
  font-size: 15px;
  color: var(--text-secondary);
}

.home-greeting strong,
.home-kitchen strong {
  color: var(--text);
  font-weight: 600;
}

button.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary, #3D6B5A);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
button.linkish:hover,
button.linkish:focus-visible {
  text-decoration: underline;
}

/* —— Inventory add / shared CTA —— */
a.primary,
a.primary.btn-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--touch);
  min-height: var(--touch);
  padding: 0 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

a.primary:hover {
  background: #355c4d;
  text-decoration: none;
}

a.primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.home-cta {
  margin-top: 16px;
}

.page-inventory {
  max-width: 440px;
  justify-content: flex-start;
  /* Override .page vertical auto-margins so tall wizards start at top and scroll fully */
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 8px;
  padding-bottom: 24px;
}

.brand-compact {
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 1.2em;
}

.catalog-field {
  position: relative;
}

.catalog-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(28, 27, 26, 0.08);
  z-index: 5;
  position: absolute;
  left: 0;
  right: 0;
}

.catalog-results li {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
}

.catalog-results li:hover,
.catalog-results li:focus {
  background: var(--primary-soft);
  outline: none;
}

.picked-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.picked-label strong {
  color: var(--primary);
  font-weight: 600;
}
.description-match-note {
  color: var(--primary);
  font-weight: 500;
}

.description-match-note[hidden] {
  display: none;
}


.location-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.location-fieldset legend {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

.location-chips .chip {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 96px;
  position: relative;
  cursor: pointer;
}

.location-chips .chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.location-chips .chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--touch);
  min-height: var(--touch);
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.location-chips .chip input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.location-chips .chip input:focus-visible + span {
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  min-height: var(--touch);
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.use-by-field input[type="date"]:disabled {
  opacity: 0.5;
  background: var(--bg);
}

.banner-success {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 14px 16px;
  background: var(--primary-soft);
  border: 1px solid #C5D9CF;
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 15px;
}

.banner-success .primary {
  margin-top: 4px;
}

.inventory-form .primary {
  margin-top: 12px;
}

/* —— Barcode wizard —— */
button.btn-secondary,
.btn-secondary {
  margin-top: 8px;
  height: var(--touch);
  min-height: var(--touch);
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

button.btn-secondary:hover,
.btn-secondary:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

button.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

#start-scan[hidden] {
  display: none !important;
}

.barcode-video-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.barcode-video {
  width: 100%;
  max-height: min(50vh, 360px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: #1C1B1A;
  border: 1px solid var(--border);
}

.scan-status {
  min-height: 1.2em;
  color: var(--primary);
}

/* Centre-screen barcode scanner modal */
.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.scan-modal[hidden] {
  display: none !important;
}

.scan-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 27, 26, 0.55);
}

.scan-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(420px, 92vw);
  padding: 20px 18px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(28, 27, 26, 0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scan-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
}

.hit-summary {
  padding: 12px 14px;
  background: var(--primary-soft);
  border: 1px solid #C5D9CF;
  border-radius: var(--radius);
  margin-bottom: 4px;
}

.hit-summary.hit-miss {
  background: #F7F6F3;
  border-color: var(--border);
}

.hit-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 4px;
}

.hit-miss .hit-label {
  color: var(--text-secondary);
}

.hit-name {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 4px;
}

.hit-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.wizard-hint {
  margin-bottom: 4px;
}

.fill-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.fill-fieldset legend {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.fill-chips .chip {
  flex: 1 1 calc(50% - 8px);
  min-width: 88px;
}

.catalog-results li.is-active {
  background: var(--primary-soft);
}

.field input[readonly] {
  background: var(--bg);
  color: var(--text-secondary);
}

.wizard-step .btn-secondary {
  margin-top: 4px;
}

/* Force [hidden] to win over author display rules */
[hidden] {
  display: none !important;
}

.scan-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 8px;
  margin: 0 0 4px;
  background: linear-gradient(to top, var(--bg) 70%, rgba(247, 246, 243, 0));
}

.scan-actions-sticky .primary {
  width: 100%;
  box-shadow: 0 -4px 16px rgba(247, 246, 243, 0.9);
}

.page-inventory .card {
  overflow: visible;
}

/* —— Barcode HIT confirm (focused expiry screen) —— */
.inventory-form[data-step="confirm_hit"] .btn-back-quiet {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  color: #5C5A55;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 0;
  margin: 0 0 16px;
  min-height: 44px;
  cursor: pointer;
  text-align: left;
}

.inventory-form[data-step="confirm_hit"] .btn-back-quiet:hover {
  color: #3D6B5A;
}

.inventory-form[data-step="confirm_hit"] .btn-back-quiet:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
  border-radius: 4px;
}

.hit-friendly-name {
  font-size: 22px;
  font-weight: 500;
  color: #1C1B1A;
  line-height: 1.25;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hit-ingredient-line {
  font-size: 15px;
  color: #5C5A55;
  margin: 0 0 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hit-confirm-form {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 640px);
}

.hit-expiry-block {
  margin-top: 28px;
  margin-bottom: 24px;
  text-align: center;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hit-expiry-block .hit-date-question {
  text-align: center;
}

.hit-expiry-block .use-by-soon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}

.use-by-soon button {
  min-height: 48px;
  min-width: 72px;
  padding: 10px 16px;
  border: 1px solid #E4E2DC;
  border-radius: 999px;
  background: #fff;
  color: #1C1B1A;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.use-by-soon button:hover {
  border-color: #3D6B5A;
  background: #E4EFE9;
  color: #3D6B5A;
}

.use-by-soon button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.use-by-soon button.is-selected {
  background: #E4EFE9;
  border-color: #3D6B5A;
  color: #3D6B5A;
}

.use-by-calendar {
  position: relative;
  margin: 4px 0 8px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #E4E2DC;
  padding: 12px 12px 16px;
  box-shadow: 0 1px 2px rgba(28, 27, 26, 0.04);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
}

.cal-nav {
  flex-shrink: 0;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #1C1B1A;
  font-size: 24px;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
}

.cal-nav:hover:not(:disabled) {
  background: #E4EFE9;
  color: #3D6B5A;
}

.cal-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.cal-nav:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.cal-title {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  font-size: 17px;
  font-weight: 500;
  color: #1C1B1A;
  line-height: 1.2;
}

.cal-month-name {
  font-size: 17px;
  font-weight: 500;
  color: #1C1B1A;
}

.cal-year-trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 4px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #1C1B1A;
  font-size: 17px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
}

.cal-year-trigger:hover,
.cal-year-trigger[aria-expanded="true"] {
  background: #E4EFE9;
  color: #3D6B5A;
}

.cal-year-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.cal-year {
  font-size: inherit;
  font-weight: inherit;
}

.cal-year-caret {
  font-size: 11px;
  color: #8A8780;
  margin-left: 1px;
}

.cal-year-panel {
  position: absolute;
  z-index: 5;
  left: 12px;
  right: 12px;
  top: 60px;
  bottom: 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E4E2DC;
  box-shadow: 0 4px 16px rgba(28, 27, 26, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cal-year-panel[hidden] {
  display: none !important;
}

.cal-year-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  flex: 1 1 auto;
}

.cal-year-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #1C1B1A;
  font-size: 17px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.cal-year-option:hover {
  background: #E4EFE9;
  color: #3D6B5A;
}

.cal-year-option.is-current {
  color: #3D6B5A;
  font-weight: 600;
}

.cal-year-option.is-selected {
  background: #3D6B5A;
  color: #fff;
}

.cal-year-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.cal-body {
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cal-body.is-fading {
  opacity: 0;
  transform: translateY(4px);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #8A8780;
  padding: 4px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  min-height: 44px;
  min-width: 40px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #1C1B1A;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day-empty {
  min-height: 44px;
  border: none;
  background: transparent;
  pointer-events: none;
  visibility: hidden;
}

.cal-day:hover:not(:disabled):not(.is-selected) {
  background: #E4EFE9;
  color: #3D6B5A;
}

.cal-day:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.cal-day.is-selected {
  background: #3D6B5A;
  color: #fff;
}

.cal-day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1.5px #3D6B5A;
  color: #1C1B1A;
}

.cal-day:disabled,
.cal-day.is-past {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.use-by-chosen-label {
  font-size: 14px;
  font-weight: 400;
  color: #8A8780;
  margin: 8px 0 4px;
}

.inventory-form[data-step="confirm_hit"] #hit-add-btn {
  margin-top: 8px;
}

.inventory-form[data-step="confirm_hit"] .form-note.is-error {
  color: #9B3B2F;
  background: #F8EAEA;
  border-color: #E2BDBD;
}

/* —— Inventory browse (list + location tabs) —— */
.home-cta-secondary {
  margin-top: 8px;
}

a.btn-secondary,
a.btn-secondary.btn-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* —— Your food inventory list (11.zip / Branding v1.1) —— */
.inv-page {
  padding: 0;
  font-family: inherit;
}

.inv-search-label {
  display: block;
  margin: 0 0 12px;
}

.inv-search {
  height: 48px;
  width: 100%;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--border, #E4E2DC);
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  font-family: inherit;
  color: #1C1B1A;
  box-sizing: border-box;
}

.inv-search:focus {
  border-color: #3D6B5A;
  box-shadow: 0 0 0 2px rgba(61, 107, 90, 0.35);
  outline: none;
}

.inv-search::placeholder {
  color: #8A8780;
}

.inv-empty {
  text-align: center;
  padding: 48px 16px;
  color: #5C5A55;
  font: 400 16px/1.4 inherit;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.inv-empty-text {
  font-size: 16px;
  color: #5C5A55;
  margin: 0;
}

.inv-empty a {
  color: #3D6B5A;
  font-weight: 500;
  text-decoration: none;
}

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

.inv-empty-tab {
  margin: 16px 0 8px;
  padding: 20px 12px;
  text-align: center;
  font-size: 15px;
  color: #8A8780;
}

.inv-tabs {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  gap: 6px;
  margin: 4px 0 16px;
  padding: 6px 0 8px;
  background: #F7F6F3;
  border: none;
  border-bottom: 1px solid #E4E2DC;
  border-radius: 0;
  box-shadow: none;
  position: sticky;
  top: 0;
  z-index: 2;
  /* Many kitchen locations: wrap first; allow horizontal scroll if still tight */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.inv-tab {
  flex: 1 1 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  min-width: min(100%, 4.5rem);
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid #E4E2DC;
  background: #FFFFFF;
  color: #5C5A55;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.inv-tab:hover {
  background: #E4EFE9;
  color: #3D6B5A;
  border-color: #3D6B5A;
  text-decoration: none;
}

.inv-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring, rgba(61, 107, 90, 0.35));
}

.inv-tab--active,
.inv-tab.is-active {
  color: #3D6B5A;
  background: #E4EFE9;
  border-color: #3D6B5A;
  box-shadow: inset 0 -3px 0 #3D6B5A;
  font-weight: 600;
}

.inv-tab-label {
  font-size: 16px;
  font-weight: inherit;
}

.inv-tab__count,
.inv-tab-count {
  color: #5C5A55;
  font-weight: 500;
  font-size: 14px;
  margin-left: 0;
  opacity: 1;
}

.inv-tab--active .inv-tab__count,
.inv-tab.is-active .inv-tab__count,
.inv-tab.is-active .inv-tab-count {
  color: #3D6B5A;
  opacity: 1;
}

.inv-section {
  margin: 16px 0 8px;
  font: 600 13px/1.2 inherit;
  color: #9B3B2F;
  letter-spacing: 0.02em;
  text-transform: none;
}

.inv-section--ok {
  color: #5C5A55;
}

.inv-group[hidden],
.inv-section[hidden],
.inv-card[hidden],
.inv-row[hidden],
.inv-no-matches[hidden] {
  display: none !important;
}

.inv-no-matches {
  margin: 16px 0;
  padding: 24px 12px;
  text-align: center;
  font-size: 15px;
  color: #8A8780;
}

.inv-list-wrap {
  margin: 0 0 12px;
}

.inv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.inv-card,
.inv-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  background: #fff;
  border: 1px solid #E4E2DC;
  border-radius: 16px;
  padding: 14px 12px;
  min-height: 88px;
  box-shadow: 0 1px 2px rgba(28, 27, 26, 0.04);
  border-bottom: 1px solid #E4E2DC;
}

.inv-card:last-child,
.inv-row:last-child {
  border-bottom: 1px solid #E4E2DC;
}

.inv-card--late {
  border-left: 3px solid #9B3B2F;
}

.inv-card--soon {
  border-left: 3px solid #A67C2D;
}

.inv-card__main,
.inv-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inv-card__name,
.inv-name {
  margin: 0;
  font: 500 16px/1.3 inherit;
  color: #1C1B1A;
  letter-spacing: -0.01em;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inv-card__meta,
.inv-desc {
  margin: 0;
  font: 400 13px/1.3 inherit;
  color: #5C5A55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-card__qty {
  margin: 0;
  font: 400 13px/1.3 inherit;
  color: #8A8780;
}

.inv-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font: 500 12px/1.2 inherit;
  border: 1px solid transparent;
}

.inv-chip--ok {
  color: #5C5A55;
  background: #F7F6F3;
  border-color: #E4E2DC;
}

.inv-chip--soon {
  color: #A67C2D;
  background: #FBF5E9;
  border-color: #E8D4A8;
}

.inv-chip--late {
  color: #9B3B2F;
  background: #F8EEEE;
  border-color: #E0B8B2;
}

.inv-chip--none {
  color: #8A8780;
  background: transparent;
  border-color: #E4E2DC;
}

/* legacy text colors kept for safety */
.inv-useby { font-weight: 500; }
.inv-useby-soon { color: #A67C2D; }
.inv-useby-late { color: #9B3B2F; font-weight: 600; }

.inv-card__actions,
.inv-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: auto;
}

.inv-action-form {
  flex: 0 0 auto;
  margin: 0;
}

.inv-open-form {
  flex: 1 1 0;
  margin: 0;
  min-width: 0;
}


.inv-btn,
.inv-btn-eaten,
.inv-btn-bin,
.inv-btn-open {
  width: 100%;
  min-height: 48px;
  min-width: 88px;
  height: auto;
  padding: 0 14px;
  border-radius: 10px;
  font: 500 15px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.inv-btn--eaten,
.inv-btn-eaten {
  border: none;
  background: #E4EFE9;
  color: #3D6B5A;
}

.inv-btn--eaten:hover,
.inv-btn-eaten:hover {
  background: #D5E8DF;
}

.inv-btn--eaten:focus-visible,
.inv-btn-eaten:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(61, 107, 90, 0.35);
}

.inv-btn--open,
.inv-btn-open {
  width: 100%;
  min-height: 48px;
  border: 1px solid #3D6B5A;
  background: #3D6B5A;
  color: #fff;
}

.inv-btn--open:hover,
.inv-btn-open:hover {
  background: #355D4E;
  border-color: #355D4E;
}

.inv-btn--open:focus-visible,
.inv-btn-open:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(61, 107, 90, 0.35);
}

.inv-btn--bin,
.inv-btn-bin {
  border: 1px solid #E4E2DC;
  background: #fff;
  color: #5C5A55;
}

.inv-btn--bin:hover,
.inv-btn-bin:hover {
  border-color: #C8C5BC;
  background: #F7F6F3;
}

.inv-btn--bin:active,
.inv-btn-bin:active {
  border-color: #9B3B2F;
  color: #9B3B2F;
}

.inv-btn--bin:focus-visible,
.inv-btn-bin:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(92, 90, 85, 0.35);
}

.inv-footer {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inv-footer .primary.btn-block {
  margin-top: 0;
}

@media (max-width: 360px) {
  .inv-card,
  .inv-row {
    flex-direction: column;
  }

  .inv-card__actions,
  .inv-actions {
    flex-direction: row;
    width: 100%;
  }

  .inv-action-form {
    flex: 1 1 0;
  }
}


/* 16 — amount remaining, opened date, Gone, today urgency */
.inv-card__name,
.inv-name {
  color: #1C1B1A;
}

.inv-chip--ok {
  color: #5C5A55;
}

.inv-chip--soon,
.inv-chip--today {
  color: #A67C2D;
  background: #FBF5E9;
  border-color: #E8D4A8;
}

.inv-chip--today {
  font-weight: 700;
}

.inv-chip--late {
  color: #9B3B2F;
}

.inv-chip--none {
  color: #8A8780;
}

.inv-card--today {
  border-left: 3px solid #A67C2D;
}

.inv-card--gone .inv-card__name,
.inv-card--gone .inv-name,
.inv-card--gone .inv-card__meta,
.inv-card--gone .inv-card__opened,
.inv-card--gone .inv-chip {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.inv-card--gone {
  opacity: 0.78;
}

.inv-card__opened {
  margin: 0;
  font: 500 13px/1.3 inherit;
  color: #5C5A55;
}

.inv-amount-form,
.inv-opened-form {
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.inv-amount-label,
.inv-opened-label {
  font: 500 12px/1.2 inherit;
  color: #5C5A55;
}

.inv-amount-select,
.inv-opened-input {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #E4E2DC;
  border-radius: 10px;
  background: #FFFFFF;
  color: #1C1B1A;
  font: 500 16px/1.2 inherit;
  font-family: inherit;
}

.inv-amount-select:focus,
.inv-opened-input:focus {
  outline: none;
  border-color: #3D6B5A;
  box-shadow: 0 0 0 2px rgba(61, 107, 90, 0.35);
}

@media (max-width: 420px) {
  .inv-tabs {
    gap: 4px;
    flex-wrap: wrap;
  }

  .inv-tab {
    flex: 1 1 calc(33.333% - 4px);
    min-height: 48px;
    min-width: calc(33.333% - 4px);
    padding: 10px 6px;
    font-size: 14px;
  }

  .inv-tab-label {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .inv-tab-count,
  .inv-tab__count {
    font-size: 12px;
    flex-shrink: 0;
  }
}

.fill-chips .chip span {
  height: auto;
  min-height: 48px;
  padding: 8px 10px;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
}


/* —— Camera-first scan (18) —— */
.scan-camera-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.scan-camera-panel .barcode-video {
  max-height: min(55vh, 420px);
}

.scan-manual[hidden],
#enter-barcode-instead[hidden],
#stop-scan[hidden] {
  display: none !important;
}

.scan-manual {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.inv-footer button.primary.btn-block {
  width: 100%;
  margin-top: 0;
}

.inv-empty .linkish {
  font-size: 15px;
}

/* —— Kitchens (20) —— */
.page-kitchens .kt-section {
  margin-top: 20px;
  padding-top: 4px;
}

.kt-h {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #3D6B5A;
}

.kt-empty {
  margin: 0 0 8px;
  color: #5C5A55;
  font-size: 15px;
}

.kt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kt-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #E4E2DC;
  border-radius: 12px;
  background: #FFFFFF;
}

.kt-card--active {
  border-color: #3D6B5A;
  box-shadow: 0 0 0 2px rgba(61, 107, 90, 0.2);
}

.kt-card__name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1C1B1A;
}

.kt-card__meta {
  margin: 4px 0 0;
  font-size: 14px;
  color: #5C5A55;
}

.kt-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #E4EFE9;
  color: #2F5647;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.kt-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kt-form .field {
  margin-bottom: 10px;
}

.kt-invite-show {
  margin: 12px 0 8px;
  padding: 16px;
  border-radius: 12px;
  background: #E4EFE9;
  text-align: center;
}

.kt-invite-label {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #2F5647;
}

.kt-invite-code {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #1C1B1A;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.kt-invite-exp {
  margin: 0 0 12px;
  font-size: 14px;
  color: #5C5A55;
}

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

.kt-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #E4E2DC;
  font-size: 16px;
}

.kt-member:last-child {
  border-bottom: none;
}

.kt-member__name {
  font-weight: 600;
  color: #1C1B1A;
}

.kt-member__role {
  color: #5C5A55;
  font-size: 14px;
}


/* —— Shared confirm modal (kitchen delete + inventory eaten/bin) —— */
.ft-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ft-confirm-modal[hidden] {
  display: none !important;
}
.ft-confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 27, 26, 0.55);
}
.ft-confirm-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(420px, 92vw);
  padding: 22px 18px 16px;
  background: var(--bg, #F7F6F3);
  border: 1px solid var(--border, #E4E2DC);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(28, 27, 26, 0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ft-confirm-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1C1B1A;
  letter-spacing: -0.02em;
}
.ft-confirm-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #2F5647;
  word-break: break-word;
}
.ft-confirm-warn {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: #5C5A55;
}
.ft-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.ft-confirm-actions .btn-block,
.ft-confirm-actions button {
  min-height: 48px;
  font-size: 17px;
  font-weight: 600;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid #B33A3A;
  border-radius: 12px;
  background: #B33A3A;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}
.btn-danger:hover {
  background: #9A2F2F;
  border-color: #9A2F2F;
}
.btn-danger:active {
  background: #822828;
}
.btn-danger:focus-visible {
  outline: 3px solid #F0B4B4;
  outline-offset: 2px;
}
.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.kt-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.kt-delete-open {
  margin-top: 0;
}

/* —— Admin (015 barcode suggestions) —— */
.admin-empty {
  margin: 16px 0 8px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.45;
}

.admin-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-list__item {
  margin: 0;
  padding: 0;
}

.admin-list__link {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, #fff);
  text-decoration: none;
  color: inherit;
  min-height: 48px;
}

.admin-list__link:hover {
  border-color: var(--primary);
}

.admin-list__link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.admin-list__barcode {
  display: block;
  font-weight: 600;
  font-size: 17px;
  color: var(--primary);
  margin-bottom: 4px;
  word-break: break-all;
}

.admin-list__desc {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  margin-bottom: 4px;
}

.admin-list__meta {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
}

.admin-barcode-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.admin-section {
  margin-top: 24px;
}

.admin-section__title {
  font-size: 1.05rem;
  color: var(--primary);
  margin: 0 0 12px;
}

.admin-select {
  display: block;
  width: 100%;
  min-height: 48px;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.admin-select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.admin-sug-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-sug {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.admin-sug__who {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.admin-sug__desc {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.35;
}

.admin-sug__meta {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* —— Recipes MVP (pack 25) —— */
.recipe-section-title {
  margin: 20px 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
}

.recipe-actions {
  margin: 12px 0 16px;
}

.recipe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recipe-list__item {
  margin: 0;
}

.recipe-list__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.recipe-list__link:hover {
  border-color: var(--primary);
}

.recipe-list__link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.recipe-list__title {
  font-size: 1.05rem;
  font-weight: 650;
}

.recipe-list__meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.recipe-desc {
  margin: 0 0 12px;
  line-height: 1.45;
}

.recipe-ings,
.recipe-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recipe-steps {
  list-style: decimal;
  padding-left: 1.25rem;
}

.recipe-ing,
.recipe-step {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  line-height: 1.4;
}

.recipe-ing--optimal {
  opacity: 0.92;
}

.recipe-ing__role {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  margin-right: 8px;
}

.recipe-have {
  color: var(--primary);
  font-weight: 700;
}

.recipe-step__timer {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.recipe-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 8px;
}

.recipe-inline-form {
  margin: 0;
}

.recipe-admin-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.recipe-admin-btns .primary,
.recipe-admin-btns .btn-secondary {
  width: auto;
  padding: 8px 14px;
  font-size: 0.95rem;
}

.recipe-dyn-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
}

.recipe-dyn-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--primary-soft, #E4EFE9);
}

.recipe-dyn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recipe-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  min-height: 64px;
}

.recipe-textarea:focus {
  border-color: var(--primary);
  outline: none;
}

.recipe-textarea:focus-visible {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}

.inv-recipes-link {
  font-size: 0.9rem;
}

.recipe-pending {
  margin-bottom: 16px;
}

/* —— Kitchen locations (026 / MySQL 022) —— */
.loc-intro {
  margin: 0 0 16px;
}

.loc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 24px;
  padding: 0;
}

.loc-card {
  position: relative;
  padding: 14px;
  padding-right: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--primary-soft, #E4EFE9);
}

.loc-delete-icon-form {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  z-index: 1;
}

.loc-delete-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #9B3B2F;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius);
}

.loc-delete-x:hover,
.loc-delete-x:focus-visible {
  background: rgba(155, 59, 47, 0.08);
  outline: 2px solid #9B3B2F;
  outline-offset: 2px;
}

.loc-card__name {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.loc-card__meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.loc-rename-form,
.loc-delete-form,
.loc-delete-move-form,
.loc-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.loc-rename-input,
.loc-select,
.loc-add-form input[type="text"] {
  min-height: 48px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--surface);
}

.loc-btn {
  min-height: 48px;
  padding: 0 16px;
  font: inherit;
  cursor: pointer;
}

.inv-move-row .inv-move-btn,
button.btn-secondary.inv-move-btn {
  margin-top: 0;
  height: 28px;
  min-height: 28px;
  width: auto;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 0.9rem;
}

.loc-add {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.inv-move-form {
  margin-top: 6px;
  width: 100%;
}

.inv-move-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.inv-move-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inv-move-select {
  flex: 1;
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
}

.inv-loc-history {
  margin-top: 10px;
  width: 100%;
  font-size: 0.9rem;
}

.inv-loc-history summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--primary);
  font-weight: 500;
}

.inv-loc-history__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-loc-history__when {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.page-locations .card {
  max-width: 440px;
}

/* —— Butter dish (028 / MySQL 023) —— */
.loc-card--butter {
  border-color: var(--primary, #3D6B5A);
}

.loc-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-soft, #E4EFE9);
  color: var(--primary, #3D6B5A);
  vertical-align: middle;
}

.loc-special-form,
.loc-key-add {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.loc-butter-keys {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.loc-butter-keys__title {
  font-weight: 600;
  margin: 0 0 6px;
}

.loc-butter-keys__list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loc-butter-keys__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}

.loc-key-remove {
  margin: 0;
}

.bd-intro {
  margin: 0 0 16px;
}

.bd-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 24px;
}

.bd-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--primary-soft, #E4EFE9);
}

.bd-card__name {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.bd-card__time {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary, #3D6B5A);
  margin: 0 0 14px;
  line-height: 1.3;
}

.bd-amount-label {
  font-weight: 600;
  margin: 0 0 8px;
}

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

.bd-chip {
  min-height: 48px;
  min-width: 48px;
  padding: 10px 14px;
  border: 2px solid var(--primary, #3D6B5A);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--primary, #3D6B5A);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.bd-chip--active,
.bd-chip:active {
  background: var(--primary, #3D6B5A);
  color: #fff;
}



.bd-recipes {
  margin: 0 0 24px;
  padding-top: 4px;
}

.bd-recipes-keys {
  margin: 0 0 12px;
}

.bd-recipes-sub {
  margin: 12px 0 8px;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text-secondary, #5c5a57);
}

.bd-recipe-list {
  margin: 0 0 8px;
}
.bd-backup {
  margin: 8px 0 24px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bd-backup-empty {
  margin: 0 0 6px;
}

.bd-backup-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bd-backup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #ddd);
}

.bd-backup-row:last-child {
  border-bottom: 0;
}

.bd-backup-meta {
  flex: 1 1 12rem;
  line-height: 1.35;
}

.bd-backup-name {
  font-weight: 600;
}

.bd-backup-useby,
.bd-card__useby {
  font-weight: 500;
  color: var(--text-secondary, #555);
}

.bd-backup-move-form {
  margin: 0;
  flex: 0 0 auto;
}

.bd-backup-move {
  min-height: 48px;
  min-width: 48px;
  padding: 10px 16px;
  border: 2px solid var(--primary, #3D6B5A);
  border-radius: 999px;
  background: var(--primary, #3D6B5A);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.bd-backup-move:active {
  filter: brightness(0.95);
}

.bd-chip--gone {
  border-color: var(--primary, #3D6B5A);
}

.bd-home-embed {
  margin: 8px 0 0;
  width: 100%;
  min-height: 420px;
}

.bd-home-iframe {
  display: block;
  width: 100%;
  min-height: 520px;
  height: 70vh;
  max-height: 900px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.inv-butter-link {
  font-weight: 500;
  color: var(--primary, #3D6B5A);
  font-size: 0.95rem;
}

/* Quiet per-location Butter dish mark (030) */
.loc-special-quiet {
  margin-top: 8px;
}

.loc-special-quiet > summary {
  list-style: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 40px;
  display: flex;
  align-items: center;
  user-select: none;
}

.loc-special-quiet > summary::-webkit-details-marker {
  display: none;
}

.loc-special-quiet > summary::before {
  content: "▸ ";
  color: var(--text-muted, #888);
}

.loc-special-quiet[open] > summary::before {
  content: "▾ ";
}

.loc-special-quiet-form {
  margin: 4px 0 0;
}

.loc-special-quiet-btn {
  min-height: 48px;
  padding: 8px 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--primary, #3D6B5A);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

/* Butter dish embed chrome (030) */
body.bd-embed {
  background: transparent;
  margin: 0;
  padding: 0;
}

.page-butter-dish--embed {
  padding: 0;
  max-width: none;
}

.page-butter-dish--embed .card--embed {
  box-shadow: none;
  border: 0;
  margin: 0;
  padding: 8px 4px 16px;
  max-width: none;
  background: transparent;
}

.bd-embed-header {
  margin: 0 0 10px;
}

.bd-embed-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary, #3D6B5A);
}

/* —— pack 38: inventory card stack fix (force column; bust cache) —— */
/* Move + location history are siblings of main/actions; row flex crushed the card. */
.inv-card,
.inv-row,
article.inv-card.inv-row {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.inv-card__main,
.inv-row-main {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  order: 1;
}

.inv-card__actions,
.inv-actions {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  gap: 8px;
  align-items: stretch;
  order: 2;
}

.inv-action-form {
  flex: 1 1 0 !important;
  min-width: 0;
  width: auto;
}

.inv-btn,
.inv-btn-eaten,
.inv-btn-bin,
.inv-btn-open,
.inv-btn--eaten,
.inv-btn--bin,
.inv-btn--open {
  width: 100% !important;
}

.inv-move-form,
.inv-loc-history {
  width: 100% !important;
  flex: 0 0 auto !important;
  align-self: stretch !important;
  max-width: 100% !important;
  order: 3;
}

.inv-loc-history {
  order: 4;
}

.inv-move-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.inv-move-select {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px;
  box-sizing: border-box;
}

.inv-move-row .inv-move-btn,
button.btn-secondary.inv-move-btn,
.inv-move-form button.btn-secondary {
  margin-top: 0 !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px;
  padding: 0 12px !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  flex: 0 0 auto;
  width: auto;
  box-sizing: border-box;
}

.inv-chip {
  white-space: nowrap;
  max-width: 100%;
}

.inv-card__name,
.inv-name {
  display: block !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  color: #1C1B1A !important;
}

.inv-card__meta,
.inv-desc,
.inv-card__opened {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}


/* —— pack 41: Open beside Eaten/Bin (equal row) —— */
.inv-open-form {
  width: auto !important;
  margin: 0;
  flex: 1 1 0 !important;
  order: unset !important;
}

.inv-card__actions,
.inv-actions {
  order: 2;
}

.inv-move-form {
  order: 3;
}

.inv-loc-history {
  order: 4;
}

.inv-btn--open,
.inv-btn-open {
  width: 100% !important;
  min-height: 48px !important;
}

/* —— Pack 42: ingredient suggest (picker miss) —— */
.ingredient-miss {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--primary-soft, #eef5f1);
}

.ingredient-miss__text {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.ingredient-miss__text strong {
  color: var(--text);
}

.ingredient-suggest-form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.ingredient-suggest-form__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
  color: var(--text);
}

/* —— Eggs tab (046 / MySQL 026) —— */
.loc-card--eggs {
  border-color: var(--primary, #3D6B5A);
}

.loc-badge--eggs {
  background: var(--primary-soft, #E4EFE9);
}

.loc-egg-keys {
  /* reuses .loc-butter-keys layout */
}

.eggs-intro {
  margin: 0 0 16px;
}

.eggs-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 24px;
}

.eggs-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--primary-soft, #E4EFE9);
}

.eggs-card__name {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 6px;
}

.eggs-card__useby {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary, #3D6B5A);
  margin: 0 0 14px;
  line-height: 1.3;
}

.eggs-card__useby--none {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted, #888);
}

.eggs-count__label {
  font-weight: 600;
  margin: 0 0 8px;
}

.eggs-count__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.eggs-count__step {
  margin: 0;
}

.eggs-step-btn {
  min-height: 48px;
  min-width: 48px;
  padding: 10px 14px;
  border: 2px solid var(--primary, #3D6B5A);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--primary, #3D6B5A);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.eggs-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.eggs-count__set {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex: 1 1 auto;
}

.eggs-count__input {
  min-height: 48px;
  width: 5.5rem;
  max-width: 40vw;
  padding: 8px 12px;
  border: 2px solid var(--primary, #3D6B5A);
  border-radius: 12px;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
}

.eggs-set-btn {
  min-height: 48px;
  min-width: 48px;
  padding: 10px 16px;
}

.eggs-gone-form {
  margin: 12px 0 0;
}

.eggs-gone-btn {
  min-height: 48px;
  padding: 8px 0;
  font: inherit;
}

.eggs-add {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.eggs-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eggs-add-form label {
  font-weight: 600;
  margin-top: 4px;
}

.eggs-add-qty {
  width: 100%;
  max-width: 12rem;
  text-align: left;
}

.eggs-add-useby {
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: var(--surface, #fff);
}

.eggs-home-embed {
  /* same footprint as butter dish embed */
}

body.eggs-embed {
  background: transparent;
  margin: 0;
  padding: 0;
}

html.eggs-embed-root {
  background: transparent;
}

.page-eggs--embed {
  padding: 0;
  margin: 0;
  min-height: 0;
}

.page-eggs--embed .card--embed {
  box-shadow: none;
  border: 0;
  padding: 8px 4px 16px;
  background: transparent;
  max-width: none;
}

.eggs-embed-header {
  margin: 0 0 12px;
}

.eggs-embed-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--primary, #3D6B5A);
}

.inv-eggs-link {
  font-weight: 500;
  color: var(--primary, #3D6B5A);
  font-size: 0.95rem;
}

/* —— Recipes list + delete (pack 47) —— */
.recipe-list__delete {
  margin-top: 8px;
}

.recipe-actions-row .btn-danger,
.recipe-list__delete .btn-danger {
  min-height: 48px;
}

/* —— Recipes list delete X (pack 49) —— */
.recipe-list__item {
  position: relative;
}

.recipe-list__item--has-delete .recipe-list__link {
  padding-right: 56px;
}

a.recipe-delete-x {
  position: absolute;
  top: 4px;
  right: 2px;
  z-index: 1;
  min-width: 48px;
  min-height: 48px;
  text-decoration: none;
}

a.recipe-delete-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
  margin-top: 8px;
}

.recipe-delete-confirm {
  margin: 0;
}

.recipe-delete-confirm .btn-danger {
  min-height: 48px;
}
/* pack 51: inventory search hide must beat pack 38 display:flex !important */
article.inv-card.inv-row[hidden],
.inv-card[hidden],
.inv-row[hidden],
.inv-group[hidden],
.inv-section[hidden],
.inv-no-matches[hidden] {
  display: none !important;
}

.recipe-list__link {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}
.recipe-list__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.alcohol-tick {
  flex: 0 0 auto;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}
.alcohol-tick--ready {
  color: #00e05a;
}
.alcohol-tick--one {
  color: #e07a00;
}

/* ===== Pack 131 ===== */
/* (b) Search: "article.inv-card.inv-row" sets display !important above, which beat [hidden]. */
article.inv-card.inv-row[hidden],
.inv-list-wrap .inv-card[hidden],
.inv-list-wrap .inv-row[hidden] {
  display: none !important;
}
.inv-group:not(:has(.inv-card:not([hidden]))) {
  display: none;
}
.inv-search-form { margin: 0; }
.inv-search-form noscript button { margin-top: 8px; }

/* (a) Action row on cards with Cook it: wrap, Cook it full width, the others share the row below. */
.inv-card .inv-card__actions,
.inv-card .inv-actions {
  flex-wrap: wrap !important;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.inv-card .inv-actions > .inv-btn--cook,
.inv-card .inv-actions > .inv-meat-warn {
  flex: 1 0 100% !important;
  width: 100% !important;
  box-sizing: border-box;
}
.inv-card .inv-actions > .inv-action-form {
  flex: 1 1 0 !important;
  min-width: 64px !important;
}
.inv-card .inv-actions .inv-btn,
.inv-card .inv-actions .inv-btn-open,
.inv-card .inv-actions .inv-btn-eaten,
.inv-card .inv-actions .inv-btn-bin {
  min-width: 0 !important;
  width: 100% !important;
  padding: 0 8px;
  box-sizing: border-box;
  white-space: nowrap;
}
@media (max-width: 300px) {
  .inv-card .inv-actions > .inv-action-form { flex: 1 0 100% !important; }
}

/* (d) Raw meat stored in the Cupboard: a warning only. */
.inv-meat-warn {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #FFF4E5;
  color: #7A4B00;
  border: 1px solid #F0C27A;
  font-size: 14px;
  line-height: 1.35;
}
.inv-meat-warn--banner { margin: 0 0 12px; }
