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

.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: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.recipes-title-center {
  font-size: 1.125rem;
  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: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-1);
}

.recipe-card-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin: 0;
  font-family: "Geist Mono", monospace;
}

.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: 0.9375rem;
}

.recipes-empty-hint {
  font-size: 0.8125rem !important;
  color: var(--gray-600);
  max-width: 280px;
}

.recipes-empty-cta {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--blue-500);
  color: #fff;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: "Geist Mono", monospace;
  text-decoration: none;
}

.recipes-empty-cta:hover {
  background: var(--blue-600);
  color: #fff;
}

.recipe-show-body {
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
}

.recipe-hero {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
}

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

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

.recipe-show-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin: var(--space-5) 0 0;
  letter-spacing: -0.02em;
}

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

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

.recipe-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-400);
  font-family: "Geist Mono", monospace;
}

.recipe-servings-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-5);
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: 999px;
  padding: var(--space-1);
  max-width: 240px;
}

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

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

.recipe-servings-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  font-family: "Geist Mono", monospace;
  white-space: nowrap;
}

.recipe-tabs {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-6);
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: 999px;
  padding: var(--space-1);
}

.recipe-tab {
  flex: 1;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--gray-500);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: "Geist Mono", monospace;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.recipe-tab.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.recipe-panel {
  margin-top: var(--space-5);
  padding-bottom: var(--space-6);
}

.recipe-panel-empty {
  color: var(--gray-500);
  font-size: 0.875rem;
  text-align: center;
  padding: var(--space-8) 0;
}

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

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

.recipe-ingredient-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--gray-900);
}

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

.recipe-ingredient-amount {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  font-family: "Geist Mono", monospace;
  min-width: 64px;
  text-align: right;
}

.recipe-ingredient-name {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--gray-300);
}

.recipe-ingredient-kcal {
  font-size: 0.75rem;
  color: var(--gray-600);
  font-family: "Geist Mono", monospace;
}

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

.recipe-method-step {
  font-size: 0.9375rem;
  color: var(--gray-300);
  line-height: 1.6;
  padding-left: var(--space-2);
}

.recipe-method-step::marker {
  color: var(--blue-500);
  font-weight: 700;
  font-family: "Geist Mono", monospace;
}

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

.recipe-nutrition-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin: 0 0 var(--space-3);
  font-family: "Geist Mono", monospace;
}

.recipe-nutrition-kcal {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-4);
  font-family: "Geist Mono", monospace;
  letter-spacing: -0.02em;
}

.recipe-nutrition-kcal span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-500);
}

.recipe-macro-row {
  display: flex;
  gap: var(--space-2);
}

.recipe-macro {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  background: var(--gray-800);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
}

.recipe-macro-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  font-family: "Geist Mono", monospace;
}

.recipe-macro-label {
  font-size: 0.6875rem;
  color: var(--gray-500);
  font-family: "Geist Mono", monospace;
}

.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: 0.8125rem;
  font-family: "Geist Mono", monospace;
}

.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: 0.875rem;
}

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

.rf-ingredient-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
}

.rf-ingredient-row.hidden {
  display: none;
}

.rf-ingredient-name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.rf-grams-unit {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-family: "Geist Mono", monospace;
}

.rf-remove-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.rf-remove-btn:hover {
  color: var(--danger);
}

.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: 0.875rem;
  font-weight: 600;
  font-family: "Geist Mono", monospace;
  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: 0.8125rem;
  color: var(--gray-500);
  font-family: "Geist Mono", monospace;
  text-align: right;
  min-height: 1.2em;
}

.recipe-submit-btn {
  width: 100%;
  min-height: 56px;
  background: var(--blue-500) !important;
  color: #fff !important;
  border: none;
  border-radius: 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: "Geist Mono", monospace;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.recipe-submit-btn:hover {
  background: var(--blue-600) !important;
}

.recipe-delete-btn {
  width: 100%;
  min-height: 48px;
  margin-top: var(--space-6);
  background: none;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: "Geist Mono", monospace;
  cursor: pointer;
}

.rf-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.rf-sheet.open {
  opacity: 1;
  pointer-events: auto;
}

.rf-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
}

.rf-sheet-panel {
  position: relative;
  z-index: 1;
  background: var(--gray-900);
  border-top: 1px solid var(--gray-800);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-5) var(--space-4);
  padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px);
  transition: transform 0.25s ease;
}

.rf-sheet.open .rf-sheet-panel {
  transform: translateY(0);
}

.rf-sheet-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-3);
  padding: 0 var(--space-2);
  font-family: "Geist Mono", monospace;
}

.rf-sheet-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 80px;
}

.rf-sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-3);
  border: none;
  background: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

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

.rf-sheet-item-name {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
}

.rf-sheet-item-kcal {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-family: "Geist Mono", monospace;
  flex-shrink: 0;
}

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

.rf-sheet-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  margin-top: var(--space-3);
  border-top: 1px solid var(--gray-800);
  padding-top: var(--space-3);
  color: var(--blue-500);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: "Geist Mono", monospace;
  text-decoration: none;
}

.recipe-photo-field-small .recipe-photo-preview {
  aspect-ratio: auto;
  height: 120px;
}

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

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

.ingredient-thumb span {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-500);
  font-family: "Geist Mono", monospace;
}

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

.ingredient-thumb--sm span {
  font-size: 0.8125rem;
}

.recipe-ingredient-row .ingredient-thumb--sm {
  align-self: center;
}

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

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

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

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

.ingredient-row-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
}

.ingredient-row-macros {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin: 0;
  font-family: "Geist Mono", monospace;
}

.ingredient-row-kcal {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-400);
  font-family: "Geist Mono", monospace;
  flex-shrink: 0;
}
