main.recipes-screen {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: 0;
  padding-bottom: calc(env(safe-area-inset-bottom) + 80px);
  align-items: stretch !important;
  justify-content: flex-start;
}

body.has-tab-bar main.recipes-screen {
  min-height: calc(100dvh - 68px - env(safe-area-inset-bottom, 0px));
}

main.recipe-form-screen {
  padding-bottom: var(--space-4);
}

.recipes-screen header {
  position: static;
  padding: 0;
}

.recipes-screen .recipes-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: calc(env(safe-area-inset-top) + var(--space-5)) var(--space-5) var(--space-4);
  flex-shrink: 0;
}

.recipes-title {
  flex: 1;
  font-size: var(--type-title);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.recipes-title-center {
  font-size: var(--type-heading);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipes-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--gray-300);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.recipes-header-btn:hover {
  color: var(--text);
}

.recipe-card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 0 var(--space-4);
}

.recipe-card {
  display: block;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.recipe-card:hover {
  border-color: var(--gray-700);
}

.recipe-card-photo {
  aspect-ratio: 16 / 9;
  background: var(--gray-800);
}

.recipe-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recipe-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
}

.recipe-card-body {
  padding: var(--space-4) var(--space-5);
}

.recipe-card-name {
  font-size: var(--type-body);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-1);
}

.recipe-card-meta {
  font-size: var(--type-label);
  color: var(--gray-500);
  margin: 0;
  font-family: var(--font-mono);
}

.recipes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-16) var(--space-6);
  color: var(--gray-500);
  text-align: center;
}

.recipes-empty p {
  margin: 0;
  font-size: var(--type-body);
}

.recipes-empty-hint {
  font-size: var(--type-label);
  color: var(--gray-600);
  max-width: 280px;
}

.recipes-empty-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  min-height: 52px;
  margin-top: var(--space-3);
  padding: 0 var(--space-6);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-radius: var(--radius-lg);
  font-size: var(--type-body);
  font-weight: 700;
  text-decoration: none;
}

.recipes-empty-cta:hover {
  color: var(--btn-primary-text);
  opacity: 0.9;
}

body.has-tab-bar main.recipe-show-screen {
  padding-top: 0;
}

.recipe-hero {
  position: relative;
  aspect-ratio: 5 / 4;
  max-height: 60dvh;
  overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--blue-500) 28%, var(--gray-900)), var(--gray-900) 70%);
}

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

.recipe-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.35), transparent 30%, transparent 70%, var(--bg));
  pointer-events: none;
}

.recipe-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--blue-500) 70%, var(--text));
  opacity: 0.8;
}

.recipes-screen .recipe-hero-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + var(--space-4)) var(--space-4) 0;
}

.recipe-hero-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.4);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.recipe-hero-btn:active {
  transform: scale(0.94);
}

.recipe-show-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  margin-top: calc(var(--space-12) * -1);
  padding: 0 var(--space-4) var(--space-8);
}

.recipe-show-name {
  margin: 0;
  font-size: var(--type-title);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.recipe-show-description {
  margin: var(--space-2) 0 0;
  font-size: var(--type-body);
  line-height: 1.55;
  color: var(--gray-400);
}

.recipe-show-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.recipe-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  font-size: var(--type-label);
  font-weight: 600;
  color: var(--gray-300);
}

.recipe-nutrition {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
}

.recipe-nutrition-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.recipe-nutrition-caption {
  margin: 0;
  font-size: var(--type-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  white-space: nowrap;
}

.recipe-nutrition-kcal {
  margin: var(--space-1) 0 0;
  font-size: var(--type-title);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.recipe-nutrition-kcal span {
  font-size: var(--type-body);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--gray-500);
}

.recipe-macro-bar {
  display: flex;
  gap: 3px;
  height: 8px;
  margin: var(--space-3) 0 var(--space-4);
  border-radius: 999px;
  overflow: hidden;
  background: var(--gray-800);
}

.recipe-macro-bar-part {
  min-width: 0;
  transform-origin: left;
  animation: recipe-bar-grow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.recipe-macro-bar-part:nth-child(2) { animation-delay: 0.08s; }
.recipe-macro-bar-part:nth-child(3) { animation-delay: 0.16s; }

.recipe-macro--protein { --macro: var(--macro-protein); }
.recipe-macro--carbs { --macro: var(--macro-carbs); }
.recipe-macro--fat { --macro: var(--macro-fat); }

.recipe-macro-bar-part {
  background: var(--macro);
}

.recipe-macro-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.recipe-macro {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: var(--space-2);
  border-left: 3px solid var(--macro);
}

.recipe-macro-value {
  font-size: var(--type-heading);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.recipe-macro-label {
  font-size: var(--type-caption);
  color: var(--gray-500);
  white-space: nowrap;
}

.recipe-section {
  margin-top: var(--space-8);
}

.recipe-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  margin-bottom: var(--space-2);
}

.recipe-section-title {
  margin: 0;
  font-size: var(--type-heading);
  font-weight: 700;
  color: var(--text);
}

.recipe-servings-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px;
  border-radius: 999px;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
}

.recipe-servings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--gray-800);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.recipe-servings-btn:active {
  transform: scale(0.92);
}

.recipe-servings-label {
  min-width: 92px;
  text-align: center;
  font-size: var(--type-label);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}

.recipe-ingredient-list {
  display: flex;
  flex-direction: column;
}

.recipe-ingredient-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  border-bottom: 1px solid var(--gray-900);
}

.recipe-ingredient-row:last-child {
  border-bottom: none;
}

.recipe-ingredient-row .food-thumb {
  width: 40px;
  height: 40px;
}

.recipe-ingredient-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipe-ingredient-name {
  font-size: var(--type-body);
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recipe-ingredient-amount {
  font-size: var(--type-label);
  font-variant-numeric: tabular-nums;
  color: var(--gray-500);
}

.recipe-ingredient-kcal {
  font-size: var(--type-label);
  font-variant-numeric: tabular-nums;
  color: var(--gray-400);
  white-space: nowrap;
}

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

.recipe-method-step {
  position: relative;
  display: flex;
  gap: var(--space-3);
  padding-bottom: var(--space-5);
}

.recipe-method-step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 32px;
  bottom: 4px;
  left: 13px;
  width: 2px;
  border-radius: 1px;
  background: var(--gray-800);
}

.recipe-method-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-500);
  color: var(--btn-primary-text);
  font-size: var(--type-label);
  font-weight: 700;
}

.recipe-method-step p {
  margin: 3px 0 0;
  font-size: var(--type-body);
  line-height: 1.6;
  color: var(--gray-300);
}

.recipe-panel-empty {
  margin: 0;
  padding: var(--space-6) 0;
  text-align: center;
  font-size: var(--type-body);
  color: var(--gray-500);
}

.recipe-panel-empty a {
  color: var(--blue-500);
}

.recipe-options .fl-more-row:last-child,
.recipe-options form:last-child .fl-more-row {
  border-bottom: none;
}

@keyframes recipe-bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .recipe-macro-bar-part,
  .share-qr-card {
    animation: none;
  }
}

.recipe-form-body {
  padding: 0 var(--space-4) var(--space-8);
}

.recipe-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.recipe-photo-field {
  display: block;
  cursor: pointer;
  margin: 0;
}

.recipe-photo-input {
  display: none;
}

.recipe-photo-preview {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
}

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

.recipe-photo-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--gray-600);
  border-style: dashed;
  font-size: var(--type-label);
  font-family: var(--font-mono);
}

.rf-field {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.rf-field-row {
  display: flex;
  gap: var(--space-4);
}

.rf-label {
  display: block;
  color: var(--gray-300);
  font-weight: 500;
  margin-bottom: var(--space-2);
  font-size: var(--type-body);
}

.rf-ingredient-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.rf-ingredient-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--gray-900);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-1);
  min-height: 60px;
}

.rf-ingredient-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 44px;
  color: var(--gray-600);
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}

.rf-ingredient-name {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  font-size: var(--type-body);
  color: var(--text);
}

.rf-ingredient-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rf-pack-btn {
  padding: 0;
  border: none;
  background: none;
  font-size: var(--type-label);
  color: var(--blue-500);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rf-package-row {
  display: flex;
  gap: var(--space-2);
}

.rf-package-row input {
  flex: 1;
  min-width: 0;
}

.rf-package-unit {
  flex: 0 0 88px;
  padding: var(--space-4) var(--space-3);
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-md);
  background: var(--gray-1000);
  color: var(--gray-100);
  font-size: var(--type-body);
  font-family: var(--font-mono);
  -webkit-appearance: none;
  appearance: none;
}

.rf-ingredient-row .rf-grams-input {
  width: 72px;
  padding: var(--space-2) var(--space-2);
  text-align: right;
  font-size: var(--type-input);
}

.rf-grams-unit {
  font-size: var(--type-label);
  color: var(--gray-500);
  font-family: var(--font-mono);
}

.rf-add-ingredient {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  min-height: 48px;
  border: 1px dashed var(--gray-700);
  border-radius: var(--radius-md);
  color: var(--gray-400);
  font-size: var(--type-label);
  font-weight: 600;
  font-family: var(--font-mono);
  background: none;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.rf-add-ingredient:hover {
  border-color: var(--blue-500);
  color: var(--blue-500);
}

.rf-total {
  margin: var(--space-2) 0 0;
  font-size: var(--type-label);
  color: var(--gray-500);
  font-family: var(--font-mono);
  text-align: right;
  min-height: 1.2em;
}

.recipe-submit-btn {
  width: 100%;
  min-height: 56px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--type-body);
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.recipe-submit-btn:active {
  opacity: 0.85;
}

.recipe-photo-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.photo-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex: 1;
  min-height: 44px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--gray-800);
  color: var(--text);
  font-size: var(--type-body);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.recipe-photo-field--compact {
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
}

.recipe-photo-field--compact .recipe-photo-preview {
  aspect-ratio: 1;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.recipe-photo-field--compact .recipe-photo-preview-empty span {
  display: none;
}

.recipe-photo-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.recipe-photo-field--compact .recipe-photo-actions {
  flex-direction: column;
  gap: var(--space-2);
  margin-top: 0;
}

.recipe-photo-field--compact .photo-action-btn {
  min-height: 44px;
  justify-content: flex-start;
  padding: 0 var(--space-3);
}

.recipe-form--compact {
  gap: var(--space-3);
}

.recipe-form-screen .recipes-header {
  padding-top: calc(env(safe-area-inset-top) + var(--space-3));
  padding-bottom: var(--space-3);
}

.recipe-form-screen .recipe-form-body {
  padding-bottom: var(--space-4);
}

.rf-field-row--four {
  gap: var(--space-2);
}

.recipe-form--compact .rf-grams-input {
  padding-left: var(--space-3);
  padding-right: var(--space-2);
}

.recipe-form--compact .rf-field-row--four input[type="number"] {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  font-size: var(--type-input);
  text-align: center;
}

.recipe-form--compact .rf-field label,
.recipe-form--compact .rf-label {
  margin-bottom: var(--space-1);
  font-size: var(--type-label);
}

.recipe-form--compact input[type="text"],
.recipe-form--compact input[type="number"],
.recipe-form--compact textarea,
.recipe-form--compact .rf-package-unit {
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
}


.recipe-form--compact .recipe-submit-btn {
  margin-top: var(--space-2);
}

.recipes-header-form {
  display: contents;
}

.recipes-header-btn--danger {
  border: none;
  background: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.food-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.food-thumb span {
  font-size: var(--type-body);
  font-weight: 700;
  color: var(--gray-500);
  font-family: var(--font-mono);
}

.food-thumb--sm {
  width: 32px;
  height: 32px;
}

.food-thumb--sm span {
  font-size: var(--type-label);
}

.food-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 var(--space-4);
}

.food-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  min-height: 64px;
  text-decoration: none;
  transition: border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.food-row:hover {
  border-color: var(--gray-700);
}

.food-row-text {
  flex: 1;
  min-width: 0;
}

.food-row-name {
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
}

.food-row-macros {
  font-size: var(--type-label);
  color: var(--gray-500);
  margin: 0;
  font-family: var(--font-mono);
}

.food-row-kcal {
  font-size: var(--type-label);
  font-weight: 600;
  color: var(--gray-400);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.recipe-photo-progress {
  height: 4px;
  margin-top: var(--space-2);
  border-radius: 2px;
  background: var(--gray-800);
  overflow: hidden;
}

.recipe-photo-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--text);
  transition: width 0.2s ease;
}

.rf-sheet-panel {
  display: flex;
  flex-direction: column;
  max-height: 80dvh;
  padding-top: var(--space-3);
}

.rf-sheet-panel .pi-sheet-header {
  margin-bottom: var(--space-3);
}

.rf-sheet-search {
  position: relative;
  margin-bottom: var(--space-2);
}

.rf-sheet-search svg {
  position: absolute;
  top: 50%;
  left: var(--space-4);
  transform: translateY(-50%);
  color: var(--gray-500);
  pointer-events: none;
}

.rf-sheet-search-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4) var(--space-3) 44px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--gray-800);
  color: var(--text);
  font-size: var(--type-input);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.rf-sheet-search-input:focus {
  box-shadow: 0 0 0 2px var(--gray-600);
}

.rf-sheet-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.rf-sheet-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 60px;
  padding: var(--space-2) var(--space-1);
  border: none;
  border-bottom: 1px solid var(--gray-800);
  background: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.rf-sheet-item:active {
  background: var(--gray-800);
}

.rf-sheet-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rf-sheet-item-name {
  font-size: var(--type-body);
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rf-sheet-item-kcal {
  font-size: var(--type-label);
  color: var(--gray-500);
}

.rf-sheet-item-add {
  color: var(--gray-500);
  flex-shrink: 0;
}

.rf-sheet-empty {
  margin: 0;
  padding: var(--space-6) 0;
  color: var(--gray-500);
  font-size: var(--type-body);
  text-align: center;
}

.rf-sheet-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 52px;
  margin-top: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--gray-800);
  color: var(--text);
  font-size: var(--type-body);
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}

.rf-sheet-new:hover {
  color: var(--text);
}

.foods-screen {
  padding-bottom: calc(68px + 84px + env(safe-area-inset-bottom, 0px));
}

.recipes-header-count {
  margin-left: auto;
  font-size: var(--type-label);
  color: var(--gray-500);
}

.foods-list {
  margin: 0;
  padding: 0 var(--space-4);
  list-style: none;
}

.foods-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--gray-800);
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.foods-list li:last-child .foods-row {
  border-bottom: none;
}

.foods-thumb {
  overflow: hidden;
}

.foods-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fl-search-bar-form {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  min-height: 44px;
  color: var(--gray-500);
}

.fl-search-bar-form input,
.fl-search-bar-form input:focus {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--type-input);
  outline: none;
  box-shadow: none;
}

.fl-search-bar-form input::placeholder {
  color: var(--gray-500);
}

.fl-search-bar-form input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.food-form-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--gray-900);
}

.food-form-card-title {
  margin: 0;
  font-size: var(--type-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.food-form-card input,
.food-form-card select {
  background: var(--bg);
}

.rf-barcode-row {
  display: flex;
  gap: var(--space-2);
}

.rf-barcode-row input {
  flex: 1;
  min-width: 0;
}

.rf-scan-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  min-height: 48px;
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.scan-panel--sheet {
  flex: none;
  height: 260px;
  margin: 0 var(--space-4) var(--space-4);
  border-radius: 16px;
}

.scan-panel--sheet .scan-frame {
  width: 80%;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.scan-tool--sheet {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}

.recipe-form--compact input[type="text"],
.recipe-form--compact input[type="number"],
.recipe-form--compact input[type="search"],
.recipe-form--compact select {
  font-size: var(--type-input);
}

.recipe-form--compact .rf-field label,
.recipe-form--compact .rf-label {
  font-size: var(--type-label);
}

.rf-field-row--four input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.rf-field-row--four input[type="number"]::-webkit-inner-spin-button,
.rf-field-row--four input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.recipes-title-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.foods-filter-caption {
  margin: 2px 0 0;
  font-size: var(--type-label);
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.foods-filter-btn {
  position: relative;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.foods-filter-btn.is-active {
  color: var(--text);
}

.foods-filter-btn.is-active::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-500);
}

.foods-filter-group {
  padding: 0 var(--space-4) var(--space-4);
}

.foods-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.foods-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  color: var(--text);
  font-size: var(--type-label);
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.foods-chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.foods-filter-hint {
  margin: 0;
  font-size: var(--type-label);
  color: var(--gray-500);
}

.foods-categories {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
}

.foods-categories::-webkit-scrollbar {
  display: none;
}

.foods-categories .foods-chip {
  flex-shrink: 0;
  min-height: 36px;
}

.foods-category-picker {
  margin-top: 0;
}

.foods-chip-option {
  position: relative;
  cursor: pointer;
}

.foods-chip-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.foods-chip-option .foods-chip {
  min-height: 36px;
  background: var(--bg);
}

.foods-chip-option input:checked + .foods-chip {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.foods-chip-option input:focus-visible + .foods-chip {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

main.share-screen,
body.has-tab-bar main.share-screen {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  max-width: none;
  padding: calc(env(safe-area-inset-top) + var(--space-4)) var(--space-4) calc(env(safe-area-inset-bottom) + var(--space-5));
  background:
    radial-gradient(90% 55% at 50% 42%, color-mix(in srgb, var(--blue-500) 22%, transparent), transparent 70%),
    radial-gradient(70% 40% at 100% 0%, color-mix(in srgb, var(--blue-500) 12%, transparent), transparent 70%),
    var(--bg);
  color: var(--text);
}

.share-screen .share-bar {
  position: static;
  display: flex;
  justify-content: space-between;
  padding: 0;
  background: none;
}

.share-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gray-800);
  border-radius: 50%;
  background: var(--gray-900);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-bar-btn:active {
  transform: scale(0.94);
}

.share-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.share-qr-card {
  width: min(78vw, 300px);
  padding: var(--space-5);
  border-radius: 24px;
  background: #fff;
  box-shadow:
    0 0 0 1px var(--gray-800),
    0 0 0 8px color-mix(in srgb, var(--blue-500) 14%, transparent),
    0 24px 60px color-mix(in srgb, var(--blue-500) 30%, transparent);
  animation: share-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.share-qr {
  display: block;
  width: 100%;
  height: auto;
}

.share-qr path {
  fill: color-mix(in srgb, var(--blue-500) 35%, #0a0a0a);
}

.share-title {
  margin: var(--space-6) 0 0;
  font-size: var(--type-title);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.share-hint {
  margin: 0;
  font-size: var(--type-label);
  color: var(--gray-500);
}

.share-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.share-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 56px;
  padding: 0 var(--space-2) 0 var(--space-4);
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-lg);
  background: var(--gray-900);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-link-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: var(--type-label);
  color: var(--gray-400);
}

.share-link-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: var(--type-label);
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.share-copied .share-link-status {
  background: var(--green-500);
  color: var(--bg);
}

.shared-recipe-screen .recipe-show-body {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.shared-recipe-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 110;
  width: 100%;
  max-width: var(--app-width);
  transform: translateX(-50%);
  padding: var(--space-3) var(--space-4) calc(env(safe-area-inset-bottom) + var(--space-3));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

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

.shared-recipe-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font: inherit;
  font-size: var(--type-body);
  font-weight: 700;
  cursor: pointer;
}

.shared-recipe-cta:hover {
  color: var(--btn-primary-text);
}

body.has-tab-bar .shared-recipe-bar {
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

@keyframes share-pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
