:root {
  color-scheme: light;
  --md-primary: #2f5f73;
  --md-on-primary: #ffffff;
  --md-primary-container: #d8ecf0;
  --md-on-primary-container: #0e2a33;
  --md-secondary: #765800;
  --md-on-secondary: #ffffff;
  --md-secondary-container: #f2d58a;
  --md-on-secondary-container: #332600;
  --md-tertiary: #6f604c;
  --md-on-tertiary: #ffffff;
  --md-tertiary-container: #e6dcc9;
  --md-on-tertiary-container: #241a0f;
  --md-error: #7b4b35;
  --md-on-error: #ffffff;
  --md-error-container: #f0d8c9;
  --md-on-error-container: #2d170d;
  --md-surface: #f6f5f0;
  --md-on-surface: #1b1f20;
  --md-on-surface-variant: #3b4c55;
  --md-surface-container-lowest: #ffffff;
  --md-surface-container-low: #eeeeea;
  --md-surface-container: #e7e7e1;
  --md-surface-container-high: #dee2dd;
  --md-surface-container-highest: #cfd5d0;
  --md-outline: #5d6a70;
  --md-outline-variant: #bec8ca;
  --md-focus-ring: rgba(47, 95, 115, 0.28);
  --md-state-primary-hover: rgba(47, 95, 115, 0.08);
  --md-state-primary-pressed: rgba(47, 95, 115, 0.12);
  --md-state-error-hover: rgba(123, 75, 53, 0.10);
  --md-elevation-1: 0 1px 2px rgba(27, 31, 32, 0.14), 0 1px 3px rgba(27, 31, 32, 0.10);
  --md-elevation-2: 0 2px 6px rgba(27, 31, 32, 0.16), 0 1px 3px rgba(27, 31, 32, 0.12);
  --md-elevation-3: 0 6px 14px rgba(27, 31, 32, 0.16), 0 2px 6px rgba(27, 31, 32, 0.12);
  --md-shape-extra-small: 4px;
  --md-shape-small: 8px;
  --md-shape-medium: 12px;
  --md-shape-large: 16px;
  --md-shape-extra-large: 28px;
  --md-shape-full: 999px;
  --bg: var(--md-surface);
  --surface: var(--md-surface-container-lowest);
  --surface-muted: var(--md-surface-container);
  --surface-warm: var(--md-tertiary-container);
  --ink: var(--md-on-surface);
  --ink-muted: var(--md-on-surface-variant);
  --ink-faint: #5d6a70;
  --border: var(--md-outline-variant);
  --border-strong: var(--md-outline);
  --accent: var(--md-primary);
  --accent-hover: #244b5c;
  --accent-soft: var(--md-primary-container);
  --danger: var(--md-error);
  --danger-soft: var(--md-error-container);
  --gold: var(--md-secondary);
  --gold-soft: var(--md-secondary-container);
  --shadow: var(--md-elevation-2);
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

.recipe-photo-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.cloud-controls-busy {
  opacity: 0.7;
  pointer-events: none;
}

.cloud-auth-open,
.profile-open {
  overflow: hidden;
}

.cloud-auth-overlay[hidden],
.profile-overlay[hidden],
.ai-modal-overlay[hidden] {
  display: none;
}

.cloud-auth-overlay,
.profile-overlay,
.ai-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.cloud-auth-scrim,
.profile-scrim,
.ai-modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(27, 31, 32, 0.38);
  backdrop-filter: blur(8px);
}

.cloud-auth-panel {
  position: relative;
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(27, 31, 32, 0.24);
  padding: 28px;
}

.cloud-auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cloud-auth-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cloud-auth-copy {
  padding-right: 32px;
}

.cloud-auth-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0;
}

.cloud-auth-copy h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.08;
}

.cloud-auth-copy p:last-child {
  margin: 9px 0 0;
  color: var(--ink-muted);
}

.cloud-auth-view,
.cloud-auth-providers,
.cloud-auth-form {
  display: grid;
  gap: 10px;
}

.cloud-auth-view {
  gap: 18px;
}

.cloud-auth-view[hidden],
.cloud-auth-providers[hidden],
.cloud-auth-divider[hidden] {
  display: none;
}

.cloud-auth-hint {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.45;
}

.cloud-auth-link {
  justify-self: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cloud-auth-link:hover {
  color: var(--ink);
}

.cloud-auth-link:focus-visible {
  outline: 3px solid var(--accent-soft);
}

.provider-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.provider-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.provider-button-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
}

.provider-button-google .provider-button-mark {
  background: #4285f4;
}

.provider-button-facebook .provider-button-mark {
  background: #1877f2;
  font-family: var(--sans);
  font-size: 18px;
}

.cloud-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
}

.cloud-auth-divider::before,
.cloud-auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.cloud-auth-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.cloud-auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  font-size: 14px;
}

.cloud-auth-form input:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.cloud-auth-form input[aria-invalid="true"] {
  border-color: var(--danger);
  outline: 3px solid var(--danger-soft);
}

.cloud-auth-form label:has(input[aria-invalid="true"]) > span {
  color: var(--danger);
}

.cloud-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 4px;
}

.cloud-auth-actions .toolbar-button {
  justify-content: center;
}

.cloud-auth-message,
.profile-message,
.edit-save-message {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.cloud-auth-message.is-error,
.profile-message.is-error,
.edit-save-message.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.cloud-auth-message.is-success,
.profile-message.is-success {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.edit-save-message {
  margin: 0 0 16px;
}

.profile-button[hidden],
.profile-menu-button[hidden] {
  display: none;
}

.profile-panel {
  position: relative;
  width: min(100%, 860px);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(27, 31, 32, 0.24);
  padding: 24px;
  overflow: auto;
}

.ai-modal-panel {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(27, 31, 32, 0.24);
  padding: 24px;
  overflow: auto;
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.ai-modal-header h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.ai-modal-header p:last-child {
  margin: 7px 0 0;
  max-width: 38rem;
  color: var(--ink-muted);
}

.ai-modal-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
}

.ai-modal-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ai-modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ai-modal-form {
  display: grid;
  gap: 14px;
}

.ai-modal-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-modal-form textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.45;
}

.ai-modal-form textarea:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.ai-modal-message {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.ai-modal-message.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.ai-modal-message.is-loading {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.ai-modal-photos[hidden] {
  display: none;
}

.ai-modal-photos {
  display: grid;
  gap: 10px;
}

.ai-modal-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-modal-photo-list:empty {
  display: none;
}

.ai-modal-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

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

.ai-modal-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ai-modal-photo-remove:focus-visible {
  outline: 3px solid var(--accent-soft);
}

.ai-modal-photo-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ai-modal-photo-count {
  color: var(--ink-muted);
  font-size: 13px;
}

.ai-modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
}

.ai-modal-actions .toolbar-button {
  justify-content: center;
  min-width: 136px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.profile-header h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.profile-header p:last-child {
  margin: 5px 0 0;
  color: var(--ink-muted);
}

.profile-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
}

.profile-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.profile-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.profile-content {
  min-width: 0;
}

[data-profile-view-panel][hidden] {
  display: none;
}

.profile-body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-section {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.profile-section-heading h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.profile-section-copy {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-form-hint {
  margin: -4px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
}

.profile-form label[hidden] {
  display: none;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat {
  min-width: 0;
  min-height: 78px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.profile-stat span {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-stat strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-form input,
.profile-form select,
.profile-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  font-size: 14px;
}

.profile-form textarea {
  min-height: 82px;
  resize: vertical;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.profile-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 18px;
}

.profile-actions .toolbar-button {
  justify-content: center;
  min-width: 136px;
}

.profile-actions .toolbar-button-danger,
.toolbar-button-danger {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.profile-actions .toolbar-button-danger:hover,
.toolbar-button-danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.profile-menu {
  position: sticky;
  top: 0;
  display: grid;
  gap: 8px;
  align-self: start;
  border-right: 1px solid var(--border);
  padding-right: 14px;
}

.profile-menu-button {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  text-align: left;
}

.profile-menu-button:hover,
.profile-menu-button.is-active {
  border-color: var(--border-strong);
  background: var(--surface-muted);
  color: var(--ink);
}

.profile-menu-button-signout {
  color: var(--md-tertiary);
}

.profile-menu-button-signout:hover {
  border-color: transparent;
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
}

.toolbar-button,
.action-button {
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.toolbar-button:hover,
.action-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar-button-primary,
.action-button:not(.action-button-secondary):not(.action-button-danger):not(.action-button-warning) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.toolbar-button-primary:hover,
.action-button:not(.action-button-secondary):not(.action-button-danger):not(.action-button-warning):hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.action-button-secondary {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.action-button-warning {
  border-color: #c3a046;
  background: #f2d58a;
  color: #332600;
}

.action-button-warning:hover:not(:disabled) {
  border-color: #9a760f;
  background: #e4c56f;
  color: #332600;
}

.action-button-danger {
  border-color: #d7b8a6;
  background: var(--danger-soft);
  color: var(--danger);
}

.action-button-danger:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}

.toolbar-button:disabled,
.action-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 11px;
}

.field input:focus,
.field textarea:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.detail-empty {
  min-height: calc(100vh - 115px);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink-muted);
}

.detail-empty-title {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
}

.detail-empty-copy {
  margin: 8px 0 0;
  max-width: 34rem;
}

.detail-empty-action {
  margin: 18px auto 0;
}

.recipe-article {
  display: grid;
  gap: 22px;
}

.recipe-header {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.recipe-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 12px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.detail-actions-primary,
.detail-actions-management {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-actions-management {
  margin-left: auto;
}

.recipe-article:not(.recipe-article-edit) .detail-actions {
  align-items: center;
  justify-content: flex-start;
}

.recipe-article:not(.recipe-article-edit) .detail-actions-management {
  margin-left: 0;
}

.detail-actions-edit {
  align-items: center;
}

.recipe-title {
  margin: 0;
  max-width: 58rem;
  font-size: 40px;
  line-height: 1.08;
  font-weight: 700;
}

.panel {
  padding: 0;
  border-top: 1px solid var(--border);
}

.section-title {
  margin: 0 0 14px;
  padding-top: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.group-title {
  margin: 16px 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
}

.group-title:first-child {
  margin-top: 0;
}

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

.nutrition-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.nutrition-list li:last-child {
  border-bottom: 0;
}

.nutrition-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.notes-copy {
  margin: 0;
}

.comments-form {
  display: grid;
  gap: 10px;
}

.comments-form textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.45;
}

.comments-form textarea:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.comments-actions {
  display: flex;
  justify-content: flex-start;
}

.recipe-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  color: var(--ink-muted);
  font-size: 13px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.recipe-footer a {
  color: var(--accent);
}

.recipe-edit-form {
  display: grid;
  gap: 22px;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-span-2 {
  grid-column: span 2;
}

.field textarea {
  resize: vertical;
  min-height: 130px;
}

.edit-list {
  display: grid;
  gap: 10px;
}

.edit-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.edit-list-rows {
  display: grid;
  gap: 8px;
}

.edit-list-row {
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr) 36px;
  align-items: start;
  gap: 8px;
}

.edit-list-row-ingredients {
  grid-template-columns: 34px minmax(0, 1fr) 36px;
}

.edit-list-group {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.edit-list-group-field {
  min-width: 0;
}

.edit-list-group-input {
  font-size: 0.86rem;
  font-weight: 850;
}

.edit-list-drag-handle {
  width: 34px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-muted);
  cursor: grab;
  touch-action: none;
}

.edit-list-drag-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.edit-list-drag-handle:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
  border-color: var(--accent);
}

.edit-list-drag-icon {
  display: grid;
  gap: 3px;
}

.edit-list-drag-icon span {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.edit-list-row.is-dragging,
.edit-list-group.is-dragging {
  opacity: 0.58;
}

.edit-list-row.is-drag-block,
.edit-list-group.is-drag-block {
  opacity: 0.72;
}

.edit-list-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-muted);
  font-weight: 800;
}

.edit-list-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.edit-list-input:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.edit-list-textarea {
  display: block;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
}

.ingredient-input-shell {
  position: relative;
  display: block;
  min-width: 0;
}

.ingredient-input-highlight {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  color: transparent;
  line-height: 1.45;
  padding: 10px 11px;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ingredient-edit-input {
  position: relative;
  z-index: 2;
  background: transparent;
  caret-color: var(--ink);
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}

.ingredient-edit-input::placeholder {
  color: var(--ink-muted);
  opacity: 1;
  -webkit-text-fill-color: var(--ink-muted);
}

.ingredient-highlight-amount,
.ingredient-highlight-unit {
  border-radius: 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: transparent;
}

.ingredient-highlight-amount {
  background: #d8ecf0;
}

.ingredient-highlight-unit {
  background: #f2d58a;
}

.edit-list-remove,
.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
}

.edit-list-remove {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
}

.edit-list-remove:hover,
.chip-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.inline-add-button {
  justify-self: start;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.inline-add-button-secondary {
  color: var(--ink-muted);
}

.inline-add-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chip-editor {
  min-width: 0;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  align-items: center;
}

.editable-chip {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) 22px;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 6px 6px 6px 11px;
  color: var(--ink);
  font-weight: 750;
}

.editable-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chip-remove {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}

.chip-add {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.chip-add-toggle {
  width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px;
  font-weight: 850;
  cursor: pointer;
}

.chip-add-toggle:hover {
  border-color: var(--accent);
  background: #cfe5e9;
}

.chip-add-toggle:focus-visible {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.chip-add-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.chip-add-field {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 11px;
}

.chip-add-field[hidden] {
  display: none;
}

.chip-add-field input {
  width: 132px;
  min-width: 90px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.chip-add.is-adding .chip-add-toggle {
  display: none;
}

.chip-add-field:focus-within {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

/* Material 3 component pass */

body {
  background: var(--md-surface);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--md-focus-ring);
  outline-offset: 2px;
}

.toolbar-button,
.action-button,
.provider-button,
.profile-menu-button,
.inline-add-button {
  min-height: 40px;
  border-radius: var(--md-shape-full);
  font-weight: 700;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.toolbar-button,
.action-button,
.provider-button {
  border-color: var(--md-outline);
  background: transparent;
  color: var(--md-primary);
  padding: 9px 16px;
}

.toolbar-button:hover,
.action-button:hover:not(:disabled),
.provider-button:hover {
  border-color: var(--md-primary);
  background: var(--md-state-primary-hover);
  color: var(--md-primary);
}

.toolbar-button-primary,
.action-button:not(.action-button-secondary):not(.action-button-danger):not(.action-button-warning) {
  border-color: var(--md-primary);
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: var(--md-elevation-1);
}

.toolbar-button-primary:hover,
.action-button:not(.action-button-secondary):not(.action-button-danger):not(.action-button-warning):hover:not(:disabled) {
  border-color: #244b5c;
  background: #244b5c;
  color: var(--md-on-primary);
  box-shadow: var(--md-elevation-2);
}

.action-button-secondary,
.toolbar-button:not(.toolbar-button-primary):not(.toolbar-button-danger) {
  border-color: transparent;
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
}

.action-button-secondary:hover:not(:disabled),
.toolbar-button:not(.toolbar-button-primary):not(.toolbar-button-danger):hover {
  border-color: transparent;
  background: #e4c56f;
  color: var(--md-on-secondary-container);
}

.action-button-warning {
  border-color: transparent;
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
}

.action-button-warning:hover:not(:disabled) {
  border-color: transparent;
  background: #d9ccb8;
  color: var(--md-on-tertiary-container);
}

.action-button-danger,
.toolbar-button-danger {
  border-color: transparent;
  background: var(--md-error-container);
  color: var(--md-on-error-container);
}

.action-button-danger:hover:not(:disabled),
.toolbar-button-danger:hover {
  border-color: transparent;
  background: #e4c5b2;
  color: var(--md-on-error-container);
}

.toolbar-button-quiet {
  border-color: var(--md-outline-variant) !important;
  background: transparent !important;
  color: var(--md-on-surface-variant) !important;
  box-shadow: none !important;
}

.toolbar-button-quiet:hover {
  border-color: var(--md-primary) !important;
  background: var(--md-state-primary-hover) !important;
  color: var(--md-primary) !important;
}

.cloud-auth-close,
.profile-close,
.edit-list-remove,
.chip-remove,
.chip-add-toggle {
  border-color: var(--md-outline-variant);
  background: var(--md-surface-container-high);
  color: var(--md-primary);
}

.cloud-auth-close:hover,
.profile-close:hover,
.edit-list-remove:hover,
.chip-remove:hover,
.chip-add-toggle:hover {
  border-color: var(--md-primary);
  background: var(--md-state-primary-hover);
  color: var(--md-primary);
}

.edit-list-remove:hover,
.chip-remove:hover {
  border-color: var(--md-error);
  background: var(--md-state-error-hover);
  color: var(--md-error);
}

.cloud-auth-panel,
.profile-panel {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-large);
  background: var(--md-surface-container-low);
  box-shadow: var(--md-elevation-3);
}

.cloud-auth-kicker,
.profile-kicker,
.recipe-kicker {
  letter-spacing: 0;
}

.cloud-auth-kicker,
.profile-kicker {
  color: var(--md-on-surface-variant);
  font-weight: 720;
  text-transform: none;
}

.cloud-auth-copy h2,
.profile-header h2,
.detail-empty-title,
.recipe-title {
  font-family: var(--sans);
  letter-spacing: 0;
}

.cloud-auth-form input,
.profile-form input,
.profile-form select,
.profile-form textarea,
.field input,
.field textarea,
.comments-form textarea,
.edit-list-input {
  min-height: 48px;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container-high);
  color: var(--md-on-surface);
  padding: 11px 13px;
}

.cloud-auth-form input:hover,
.profile-form input:hover,
.profile-form select:hover,
.profile-form textarea:hover,
.field input:hover,
.field textarea:hover,
.comments-form textarea:hover,
.edit-list-input:hover {
  border-color: var(--md-on-surface);
}

.cloud-auth-form input:focus,
.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus,
.field input:focus,
.field textarea:focus,
.comments-form textarea:focus,
.edit-list-input:focus {
  outline: 3px solid var(--md-focus-ring);
  border-color: var(--md-primary);
  background: var(--md-surface-container-lowest);
}

.profile-form label,
.cloud-auth-form label,
.field span {
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 720;
}

.recipe-header {
  border-bottom-color: var(--md-outline-variant);
}

.recipe-title {
  color: var(--md-on-surface);
  font-size: 40px;
  font-weight: 760;
  text-wrap: balance;
}

.editable-chip {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: var(--md-shape-small);
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  font-weight: 650;
}

.editable-chip {
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
}

.panel {
  border-top-color: var(--md-outline-variant);
}

.section-title {
  color: var(--md-on-surface);
  font-size: 14px;
  font-weight: 780;
}

.group-title {
  color: var(--md-primary);
}

.nutrition-list li {
  border-bottom-color: var(--md-outline-variant);
}

.edit-list-index {
  border: 0;
  border-radius: var(--md-shape-small);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.comments-form textarea {
  min-height: 132px;
}

.profile-stat,
.cloud-auth-message,
.profile-message,
.edit-save-message {
  border-color: transparent;
  border-radius: var(--md-shape-large);
  background: var(--md-surface-container);
}

.inline-add-button {
  border-color: transparent;
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  padding: 10px 16px;
}

.inline-add-button:hover {
  border-color: transparent;
  background: #e4c56f;
  color: var(--md-on-secondary-container);
}

.chip-add-toggle {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-color: transparent;
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
}

.chip-add-icon {
  width: 24px;
  height: 24px;
  background: transparent;
  color: currentColor;
  font-size: 24px;
  font-weight: 600;
}

.chip-add-field {
  min-height: 40px;
  border-color: var(--md-primary);
  border-radius: var(--md-shape-full);
  background: var(--md-surface-container-high);
}

.ingredient-highlight-amount {
  background: color-mix(in srgb, var(--md-primary-container) 76%, transparent);
}

.ingredient-highlight-unit {
  background: color-mix(in srgb, var(--md-tertiary-container) 80%, transparent);
}

/* Edit form redesign */

.recipe-article-edit {
  width: min(100%, 1120px);
  margin: 0 auto;
  gap: 18px;
}

.edit-recipe-header {
  padding: 18px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container-lowest);
  box-shadow: var(--md-elevation-1);
}

.edit-title-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.edit-title-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.edit-recipe-header .recipe-kicker {
  gap: 6px;
}

.edit-recipe-header .recipe-kicker span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container);
  color: var(--md-on-surface-variant);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.edit-recipe-header .recipe-title {
  max-width: none;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.recipe-article-edit .detail-actions-edit {
  justify-content: flex-end;
  gap: 10px;
}

.recipe-article-edit .detail-actions-primary,
.recipe-article-edit .detail-actions-management {
  gap: 8px;
}

.recipe-article-edit .action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recipe-article-edit .recipe-edit-form {
  gap: 16px;
}

.recipe-article-edit .edit-panel {
  padding: 18px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-small);
  background: color-mix(in srgb, var(--md-surface-container-lowest) 84%, var(--md-surface-container));
}

.recipe-article-edit .section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  color: var(--md-on-surface);
  font-size: 13px;
  font-weight: 780;
}

.recipe-article-edit .section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--md-outline-variant);
}

.recipe-article-edit .edit-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.recipe-article-edit .field {
  min-width: 0;
  gap: 6px;
}

.recipe-article-edit .field > span {
  margin: 0;
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 740;
}

.recipe-article-edit .field-title,
.recipe-article-edit .field-description,
.recipe-article-edit .field-category,
.recipe-article-edit .field-tags {
  grid-column: span 12;
}

.recipe-article-edit .field-cuisine,
.recipe-article-edit .field-servings {
  grid-column: span 3;
}

.recipe-article-edit .field-time {
  grid-column: span 2;
}

.recipe-article-edit .field input,
.recipe-article-edit .field textarea,
.recipe-article-edit .edit-list-input {
  min-height: 44px;
  border-color: var(--md-outline-variant);
  background: var(--md-surface-container-lowest);
  box-shadow: inset 0 1px 0 rgba(27, 31, 32, 0.04);
  font-size: 14px;
}

.recipe-article-edit .field input,
.recipe-article-edit .field textarea {
  padding: 10px 12px;
}

.recipe-article-edit .field textarea {
  min-height: 112px;
}

.recipe-article-edit .field-description textarea {
  min-height: 118px;
}

.recipe-article-edit .field textarea[name="notes"] {
  min-height: 150px;
}

.recipe-article-edit .chip-editor {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container-lowest);
  padding: 6px 8px;
}

.recipe-article-edit .chip-list {
  min-height: 30px;
  align-items: flex-start;
  gap: 6px;
}

.recipe-article-edit .editable-chip {
  min-height: 30px;
  border-radius: var(--md-shape-small);
  padding: 5px 5px 5px 9px;
  font-size: 13px;
}

.recipe-article-edit .chip-add-toggle {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: var(--md-shape-small);
}

.recipe-article-edit .chip-add-icon {
  width: 22px;
  height: 22px;
  font-size: 20px;
}

.recipe-article-edit .chip-add-field {
  min-height: 30px;
  border-radius: var(--md-shape-small);
  padding: 3px 9px;
}

.recipe-article-edit .edit-list {
  gap: 10px;
}

.recipe-article-edit .edit-list-rows {
  gap: 8px;
}

.recipe-article-edit .edit-list-row {
  grid-template-columns: 32px 32px minmax(0, 1fr) 32px;
  gap: 8px;
}

.recipe-article-edit .edit-list-row-ingredients {
  grid-template-columns: 32px minmax(0, 1fr) 32px;
}

.recipe-article-edit .edit-list-index {
  min-height: 38px;
  border-radius: var(--md-shape-small);
  font-size: 13px;
}

.recipe-article-edit .edit-list-input {
  min-height: 40px;
  padding: 9px 11px;
}

.recipe-article-edit .edit-list-remove {
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border-radius: var(--md-shape-small);
}

.recipe-article-edit .edit-list-group {
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  min-height: 34px;
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container);
  color: var(--md-on-surface-variant);
  padding: 6px;
  font-size: 12px;
  text-transform: none;
}

.recipe-article-edit .edit-list-group-input {
  min-height: 32px;
  border-color: transparent;
  background: var(--md-surface-container-lowest);
  font-size: 13px;
}

.recipe-article-edit .edit-list-drag-handle {
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container-lowest);
}

.recipe-article-edit .inline-add-button {
  min-height: 36px;
  justify-self: start;
  padding: 8px 12px;
}

.recipe-article-edit .inline-add-button-secondary {
  color: var(--md-on-surface-variant);
}

/* Material 3 chip sets for recipe taxonomy */

.material-chip {
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-shape-small);
  background: transparent;
  color: var(--md-on-surface);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  vertical-align: middle;
}

.material-chip-label {
  min-width: 0;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.material-chip-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.material-input-chip {
  background: transparent;
  color: var(--md-on-surface);
}

.recipe-article-edit .material-chip span {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.recipe-article-edit .field .material-chip,
.recipe-article-edit .field .chip-add {
  display: inline-flex;
  margin: 0;
}

.recipe-article-edit .material-chip .material-chip-icon {
  display: inline-grid;
  font-size: 18px;
  line-height: 1;
}

.material-assist-chip {
  cursor: pointer;
}

.recipe-article-edit .chip-editor {
  min-height: 32px;
  border: 0;
  background: transparent;
  padding: 0;
}

.recipe-article-edit .chip-list {
  min-height: 32px;
  align-items: center;
  gap: 8px;
}

.recipe-article-edit .editable-chip {
  min-height: 32px;
  border-color: var(--md-outline);
  border-radius: var(--md-shape-small);
  background: transparent;
  color: var(--md-on-surface);
  padding: 0 4px 0 12px;
  font-size: 14px;
  font-weight: 500;
}

.recipe-article-edit .chip-remove {
  width: 32px;
  height: 30px;
  margin: 0 -4px 0 0;
  border: 0;
  border-radius: var(--md-shape-small);
  background: transparent;
  color: var(--md-on-surface-variant);
  font-size: 18px;
  padding: 0;
}

.recipe-article-edit .chip-remove span {
  display: block;
  color: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.recipe-article-edit .chip-remove:hover {
  border-color: transparent;
  background: var(--md-state-error-hover);
  color: var(--md-error);
}

.recipe-article-edit .chip-add-toggle {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-shape-full);
  background: transparent;
  color: var(--md-on-surface);
  justify-content: center;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
}

.recipe-article-edit .chip-add-toggle:hover {
  border-color: var(--md-primary);
  background: var(--md-state-primary-hover);
  color: var(--md-primary);
}

.recipe-article-edit .chip-add-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: transparent;
  color: currentColor;
  font-size: 18px;
  font-weight: 500;
}

.recipe-article-edit .chip-add-field {
  min-height: 32px;
  border-color: var(--md-primary);
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container-lowest);
  padding: 0 12px;
}

.recipe-article-edit .chip-add-field input {
  width: 160px;
  min-height: 30px;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  padding: 0;
  font-size: 14px;
}

.recipe-article-edit .chip-add-field input:hover,
.recipe-article-edit .chip-add-field input:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.recipe-article-edit .chip-editor[data-chip-editor="category"] .editable-chip {
  border-color: transparent;
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
}

.recipe-article-edit .chip-editor[data-chip-editor="tags"] .editable-chip {
  border-color: transparent;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.recipe-article-edit .chip-editor[data-chip-editor="category"] .chip-remove {
  color: var(--md-on-tertiary-container);
}

.recipe-article-edit .chip-editor[data-chip-editor="tags"] .chip-remove {
  color: var(--md-on-primary-container);
}

.recipe-article-edit .chip-editor[data-chip-editor="category"] .chip-add-toggle {
  border-color: color-mix(in srgb, var(--md-tertiary) 58%, transparent);
  color: var(--md-tertiary);
}

.recipe-article-edit .chip-editor[data-chip-editor="tags"] .chip-add-toggle {
  border-color: color-mix(in srgb, var(--md-primary) 58%, transparent);
  color: var(--md-primary);
}

.recipe-article-edit .chip-editor[data-chip-editor="category"] .chip-add-toggle:hover {
  border-color: var(--md-tertiary);
  background: color-mix(in srgb, var(--md-tertiary-container) 58%, transparent);
  color: var(--md-on-tertiary-container);
}

.recipe-article-edit .chip-editor[data-chip-editor="tags"] .chip-add-toggle:hover {
  border-color: var(--md-primary);
  background: color-mix(in srgb, var(--md-primary-container) 58%, transparent);
  color: var(--md-on-primary-container);
}

@media (max-width: 1250px) {
  .recipe-article-edit {
    width: 100%;
  }

  .recipe-article-edit .field-title,
  .recipe-article-edit .field-description,
  .recipe-article-edit .field-category,
  .recipe-article-edit .field-tags {
    grid-column: span 12;
  }

  .recipe-article-edit .field-cuisine,
  .recipe-article-edit .field-servings,
  .recipe-article-edit .field-time {
    grid-column: span 4;
  }
}

@media (max-width: 1100px) {
  .recipe-article-edit .edit-grid {
    grid-template-columns: 1fr;
  }

  .recipe-article-edit .field-title,
  .recipe-article-edit .field-description,
  .recipe-article-edit .field-category,
  .recipe-article-edit .field-tags,
  .recipe-article-edit .field-cuisine,
  .recipe-article-edit .field-servings,
  .recipe-article-edit .field-time {
    grid-column: auto;
  }

  .edit-title-bar {
    grid-template-columns: 1fr;
  }

  .recipe-article-edit .detail-actions-edit {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .edit-recipe-header,
  .recipe-article-edit .edit-panel {
    padding: 14px;
  }

  .recipe-article-edit .detail-actions-edit,
  .recipe-article-edit .detail-actions-primary,
  .recipe-article-edit .detail-actions-management {
    width: 100%;
  }

  .recipe-article-edit .detail-actions-primary,
  .recipe-article-edit .detail-actions-management {
    display: grid;
    grid-template-columns: 1fr;
  }

  .recipe-article-edit .edit-list-row {
    grid-template-columns: 28px 28px minmax(0, 1fr) 32px;
  }

  .recipe-article-edit .edit-list-row-ingredients {
    grid-template-columns: 28px minmax(0, 1fr) 32px;
  }

  .recipe-article-edit .edit-list-group {
    grid-template-columns: 28px minmax(0, 1fr) 32px;
  }

  .recipe-article-edit .edit-list-drag-handle {
    width: 28px;
  }
}

@media (max-width: 1100px) {
  .edit-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  .recipe-title {
    font-size: 32px;
  }
}

@media (max-width: 620px) {
  .cloud-auth-overlay,
  .profile-overlay,
  .ai-modal-overlay {
    align-items: end;
    padding: 12px;
  }

  .cloud-auth-panel,
  .ai-modal-panel {
    width: 100%;
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 22px;
  }

  .profile-panel {
    width: 100%;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
    padding: 22px;
  }

  .cloud-auth-copy h2,
  .profile-header h2,
  .ai-modal-header h2 {
    font-size: 28px;
  }

  .cloud-auth-actions {
    grid-template-columns: 1fr;
  }

  .ai-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-body,
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .profile-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 2px 8px 0;
  }

  .profile-menu {
    position: static;
    grid-row: 1;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 0 12px;
  }

  .profile-menu-button {
    justify-content: center;
    text-align: center;
  }

  .profile-actions {
    flex-wrap: wrap;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-button {
    width: 100%;
    justify-content: center;
  }

  .detail-actions {
    gap: 6px;
  }

  .recipe-title {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Open Pantry layout: one Add entry point, a calm library, a focused cooking view. */
[hidden] {
  display: none !important;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon .icon-fill {
  fill: currentColor;
  stroke: none;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--md-outline-variant);
  background: rgba(246, 245, 240, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(27, 31, 32, 0.04);
}

.brand-block {
  width: 332px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--md-shape-medium);
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: var(--md-elevation-1);
}

.brand-mark .icon {
  width: 22px;
  height: 22px;
}

.brand-block h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  line-height: 1.1;
}

.search-box {
  position: relative;
  flex: 1 1 auto;
  max-width: 560px;
  min-width: 0;
}

.search-box-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-full);
  background: var(--md-surface-container-lowest);
  color: var(--ink);
  padding: 10px 16px 10px 44px;
  font-size: 15px;
}

.search-box input:hover:not(:disabled) {
  border-color: var(--md-outline);
}

.search-box input:focus {
  border-color: var(--md-primary);
}

.search-box input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cloud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-sheet-open {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 0 16px;
  box-shadow: var(--md-elevation-1);
  font-size: 15px;
}

.add-sheet-open .icon {
  stroke-width: 2.2;
}

.icon-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-full);
  background: var(--md-surface-container-low);
  color: var(--md-on-surface-variant);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.icon-button:hover {
  border-color: var(--md-outline);
  background: var(--md-surface-container-high);
  color: var(--md-on-surface);
}

.icon-button-danger:hover {
  border-color: var(--md-error);
  background: var(--md-error-container);
  color: var(--md-on-error-container);
}

.pill-button,
.secondary-pill-button,
.lets-cook-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--md-shape-full);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.pill-button {
  border: 1px solid var(--md-outline-variant);
  background: var(--md-surface-container-lowest);
  color: var(--md-on-surface);
  padding: 0 16px;
}

.pill-button .icon {
  width: 18px;
  height: 18px;
}

.pill-button:hover:not(:disabled) {
  border-color: var(--md-outline);
  background: var(--md-surface-container-low);
}

.secondary-pill-button {
  min-height: 44px;
  border: 0;
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
}

.secondary-pill-button:hover {
  background: #f8e8b8;
}

.lets-cook-button {
  min-height: 48px;
  gap: 10px;
  border: 0;
  background: var(--md-primary);
  color: var(--md-on-primary);
  padding: 0 24px 0 18px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--md-elevation-1);
}

.lets-cook-button:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: var(--md-elevation-2);
}

.pill-button:disabled,
.lets-cook-button:disabled,
.stepper-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

/* Library */
.workspace {
  flex: 1 1 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-right: 1px solid var(--md-outline-variant);
  background: var(--md-surface-container-low);
  overflow: hidden;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 36px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container-lowest);
  color: var(--md-on-surface-variant);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--md-outline);
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--md-secondary);
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
}

.filters-summary {
  min-height: 36px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-small);
  padding: 0 12px;
  color: var(--md-on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.filters-summary::-webkit-details-marker {
  display: none;
}

.filters-summary .icon {
  width: 16px;
  height: 16px;
}

.filters-summary:hover,
.filters-disclosure[open] > .filters-summary {
  border-color: var(--md-outline);
  background: var(--md-surface-container-high);
}

.filters-summary:focus-visible {
  outline: 3px solid var(--md-focus-ring);
  outline-offset: 2px;
}

.filters-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--md-shape-full);
  background: var(--md-primary);
  color: var(--md-on-primary);
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
}

.filters {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-large);
  background: var(--md-surface-container-lowest);
}

.filter label {
  display: block;
  margin-bottom: 6px;
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 720;
}

.filter select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container-high);
  color: var(--ink);
  padding: 9px 11px;
}

.filter select:focus {
  border-color: var(--md-primary);
  background: var(--md-surface-container-lowest);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--md-on-surface-variant);
  font-size: 13px;
  font-weight: 720;
}

.results {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.result-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid transparent;
  border-radius: var(--md-shape-large);
  background: var(--md-surface-container);
  color: var(--md-on-surface);
  padding: 10px 12px 10px 10px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.result-card:hover {
  border-color: var(--md-outline-variant);
  background: var(--md-surface-container-high);
}

.result-card.active {
  border-color: var(--md-primary);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.result-thumb,
.add-option-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--md-shape-medium);
}

.result-thumb .icon,
.add-option-icon .icon {
  width: 22px;
  height: 22px;
}

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

.result-thumb-web,
.add-option-icon-web {
  background: var(--md-primary-container);
  color: #244b5c;
}

.result-thumb-photo,
.add-option-icon-photo {
  background: var(--md-tertiary-container);
  color: var(--md-tertiary);
}

.result-thumb-ai,
.add-option-icon-ai {
  background: #f8e8b8;
  color: var(--md-secondary);
}

.add-option-icon-paste {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
}

.result-thumb-file,
.add-option-icon-file {
  background: var(--md-surface-container-highest);
  color: var(--md-primary);
}

.result-thumb-manual,
.add-option-icon-manual {
  background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant);
}

.result-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.result-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.result-meta {
  overflow: hidden;
  color: var(--md-on-surface-variant);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card.active .result-meta {
  color: var(--md-on-primary-container);
}

/* Recipe view */
.detail-panel {
  min-width: 0;
  background: var(--md-surface-container-lowest);
  padding: 32px 48px 48px;
}

.recipe-view {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.recipe-view-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.phone-back-button {
  display: none;
}

.source-pill {
  max-width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--md-shape-small);
  background: var(--md-surface-container-low);
  color: var(--md-on-surface-variant);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.source-pill .icon {
  width: 16px;
  height: 16px;
}

.source-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-view-date {
  color: var(--ink-faint);
  font-size: 13px;
}

.recipe-view-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recipe-view-actions .icon-button {
  width: 40px;
  height: 40px;
  background: var(--md-surface-container-lowest);
}

.recipe-view-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.recipe-view-hero.has-photo {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.recipe-view-heading {
  display: grid;
  gap: 14px;
}

.recipe-view-title {
  margin: 0;
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 760;
  line-height: 1.08;
  text-wrap: balance;
}

.recipe-view-description {
  max-width: 62ch;
  margin: 0;
  color: var(--md-on-surface-variant);
  font-size: 17px;
  line-height: 1.5;
  text-wrap: pretty;
}

.recipe-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 4px;
  color: var(--md-on-surface-variant);
  font-size: 14px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-item .icon {
  width: 18px;
  height: 18px;
}

.chip-list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--md-shape-small);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.chip-oak {
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
}

.chip-azure {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.recipe-view-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  border-radius: var(--md-shape-large);
  object-fit: cover;
  box-shadow: var(--md-elevation-1);
}

.cook-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-large);
  background: var(--md-surface);
  padding: 12px 12px 12px 20px;
}

.cook-bar-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cook-bar .lets-cook-button {
  margin-left: auto;
}

.cook-bar-label {
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 720;
}

.servings-stepper {
  height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-full);
  background: var(--md-surface-container-lowest);
}

.stepper-button {
  width: 40px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--md-shape-full);
  background: transparent;
  cursor: pointer;
}

.stepper-button .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.stepper-button:hover:not(:disabled) {
  background: var(--md-surface-container-high);
}

.servings-stepper input {
  width: 3.5em;
  border: 0;
  border-radius: var(--md-shape-small);
  background: transparent;
  color: var(--ink);
  padding: 4px 0;
  font-size: 16px;
  font-weight: 760;
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}

.servings-stepper input::-webkit-outer-spin-button,
.servings-stepper input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  border-radius: var(--md-shape-full);
  background: var(--md-surface-container);
  padding: 3px;
}

.segmented-option {
  min-height: 34px;
  white-space: nowrap;
  border: 0;
  border-radius: var(--md-shape-full);
  background: transparent;
  color: var(--md-on-surface-variant);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.segmented-option:hover {
  color: var(--md-on-surface);
}

.segmented-option[aria-pressed="true"] {
  background: var(--md-surface-container-lowest);
  color: var(--md-on-surface);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(27, 31, 32, 0.14);
}

.cook-bar-note {
  flex: 1 1 140px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.35;
}

.recipe-view-columns {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.recipe-view-section {
  display: grid;
  align-content: start;
  gap: 12px;
}

.recipe-view-card {
  border-radius: var(--md-shape-large);
  background: var(--md-surface);
  padding: 20px 24px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 760;
  line-height: 1.2;
}

.section-heading-note {
  color: var(--ink-faint);
  font-size: 13px;
  white-space: nowrap;
}

.section-empty {
  margin: 0;
  color: var(--md-on-surface-variant);
}

.recipe-view .group-title,
.cook-view .group-title {
  margin: 8px 0 2px;
  color: var(--md-tertiary);
  font-size: 12px;
  font-weight: 720;
}

.check-group {
  display: grid;
  gap: 2px;
}

.check-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: 20px 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: var(--md-shape-small);
  padding: 4px 8px;
  cursor: pointer;
}

.check-row:hover {
  background: var(--md-surface-container-low);
}

.check-row input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--md-primary);
}

.check-row-amount {
  color: var(--md-secondary);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.check-row-text {
  font-size: 15px;
  line-height: 1.35;
}

.check-row.is-checked .check-row-amount,
.check-row.is-checked .check-row-text {
  color: var(--ink-faint);
}

.check-row.is-checked .check-row-text {
  text-decoration: line-through;
}

.method-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.method-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 8px;
}

.method-step-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--md-shape-full);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-size: 14px;
  font-weight: 760;
}

.method-step-body {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.method-step-body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

.time-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--md-shape-small);
  background: #f8e8b8;
  color: var(--md-on-secondary-container);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.time-chip .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

/* Add sheet */
body.add-sheet-visible {
  overflow: hidden;
}

.add-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.add-sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(27, 31, 32, 0.42);
}

.add-sheet-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 20px;
  overflow: auto;
  border-radius: var(--md-shape-extra-large);
  background: var(--md-surface-container-lowest);
  padding: 28px;
  box-shadow: var(--md-elevation-3);
}

.add-sheet-panel:focus {
  outline: none;
}

.add-sheet-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.add-sheet-header > div {
  flex: 1 1 auto;
}

.add-sheet-kicker {
  margin: 0 0 4px;
  color: var(--md-primary);
  font-size: 12px;
  font-weight: 720;
}

.add-sheet-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 760;
  line-height: 1.15;
}

.add-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.add-option {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-large);
  background: var(--md-surface-container-lowest);
  color: var(--md-on-surface);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.add-option:hover:not(:disabled) {
  border-color: var(--md-outline);
  background: var(--md-surface);
}

.add-option:disabled {
  cursor: progress;
  opacity: 0.6;
}

.add-option-icon {
  width: 44px;
  height: 44px;
}

.add-option-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.add-option-title {
  font-size: 16px;
  font-weight: 700;
}

.add-option-copy {
  color: var(--md-on-surface-variant);
  font-size: 13px;
  line-height: 1.35;
}

.add-sheet-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--md-on-surface-variant);
  font-size: 13px;
}

.add-sheet-tip .icon {
  width: 18px;
  height: 18px;
}

.mobile-nav {
  display: none;
}

.profile-section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Cooking mode: every step stays visible next to the current one. */
.cooking-mode-active .app-header,
.cooking-mode-active .sidebar,
.cooking-mode-active .mobile-nav:not([hidden]) {
  display: none;
}

.cooking-mode-active .workspace {
  grid-template-columns: minmax(0, 1fr);
}

.cooking-mode-active .detail-panel {
  background: var(--md-surface);
  padding: 0;
}

.cook-view {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.cook-top {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--md-outline-variant);
  background: var(--md-surface-container-low);
  padding: 12px 32px;
}

.cook-top-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cook-top-title h2 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cook-top-title span {
  color: var(--md-on-surface-variant);
  font-size: 13px;
}

.cook-top-elapsed {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.cook-top-label {
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 720;
}

.cook-elapsed {
  font-size: 22px;
  font-weight: 760;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.cook-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 32px 28px;
}

.cook-rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  border: 1px solid var(--md-outline-variant);
  border-radius: 20px;
  background: var(--md-surface-container-lowest);
  padding: 18px 14px 14px;
}

.cook-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
}

.cook-rail-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.cook-rail-head span {
  color: var(--md-on-surface-variant);
  font-size: 13px;
}

.cook-rail-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cook-rail-step {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--md-surface);
  color: var(--md-on-surface);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.cook-rail-step:hover {
  border-color: var(--md-outline);
}

.cook-rail-step.is-done {
  background: var(--md-surface-container-lowest);
}

.cook-rail-step.is-current {
  border-color: var(--md-primary);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  box-shadow: inset 0 0 0 1px var(--md-primary);
}

.cook-rail-badge {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--md-shape-full);
  background: var(--md-surface-container);
  font-size: 13px;
  font-weight: 760;
}

.cook-rail-step.is-done .cook-rail-badge,
.cook-rail-step.is-current .cook-rail-badge {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.cook-rail-badge .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}

.cook-rail-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.cook-rail-text {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.cook-rail-step.is-done .cook-rail-text {
  color: var(--ink-faint);
}

.cook-rail-step.is-current .cook-rail-text {
  font-weight: 600;
}

.cook-rail-step .time-chip {
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.cook-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.cook-step-card {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-extra-large);
  background: var(--md-surface-container-lowest);
  padding: 36px 44px;
}

.cook-step-label {
  min-height: 32px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  border-radius: var(--md-shape-full);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 760;
}

.cook-step-text {
  max-width: 36ch;
  margin: 0;
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 520;
  line-height: 1.3;
}

.cook-need {
  display: grid;
  gap: 10px;
}

.cook-need-label {
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 720;
}

.cook-need-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cook-need-item {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--md-shape-small);
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
  padding: 4px 14px;
  font-size: 15px;
}

.cook-need-item strong {
  color: #433421;
  font-weight: 760;
}

.cook-timer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-large);
  background: var(--md-surface);
  padding: 16px 16px 16px 20px;
}

.cook-timer.is-running {
  border-color: #c3a046;
  background: #fff8e4;
}

.cook-timer-dial {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.cook-timer-ring {
  width: 100%;
  height: 100%;
  display: block;
}

.cook-timer-ring-track,
.cook-timer-ring-value {
  fill: none;
  stroke-width: 5;
}

.cook-timer-ring-track {
  stroke: rgba(20, 32, 42, 0.1);
}

.cook-timer-ring-value {
  stroke: var(--md-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear;
}

.cook-timer-display {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cook-timer-caption {
  flex: 1 1 180px;
  color: var(--md-on-surface-variant);
  font-size: 14px;
  line-height: 1.4;
}

.cook-timer-actions {
  display: flex;
  gap: 10px;
}

.cook-timer-actions .pill-button,
.cook-timer-actions .lets-cook-button {
  min-height: 48px;
  font-size: 15px;
}

.cook-timer-actions .lets-cook-button {
  padding: 0 22px;
}

.cook-all-ingredients {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-large);
  background: var(--md-surface-container-lowest);
  padding: 0 16px;
}

.cook-all-ingredients > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.cook-all-ingredients[open] {
  padding-bottom: 12px;
}

.cook-all-ingredients > summary::-webkit-details-marker {
  display: none;
}

.cook-all-ingredients > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin: 0 4px 4px auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.cook-all-ingredients[open] > summary::after {
  margin-bottom: 0;
  transform: rotate(-135deg);
}

.cook-nav {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 16px;
  background: var(--md-surface);
  padding-top: 4px;
}

.cook-nav-button {
  width: 240px;
  white-space: nowrap;
  min-height: 64px;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}

.cook-nav-button .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.cook-nav-button.pill-button {
  border-color: var(--md-outline);
}

.cook-nav-next {
  flex: 1 1 auto;
}

.cook-empty {
  margin: 0;
  padding: 32px;
  color: var(--md-on-surface-variant);
}

@media (max-width: 1100px) {
  .brand-block {
    width: auto;
  }

  .workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .detail-panel {
    padding: 28px 32px 40px;
  }

  .recipe-view-hero.has-photo {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .recipe-view-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .cook-body {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .app-header {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 16px;
  }

  .search-box {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--md-outline-variant);
    overflow: visible;
  }

  .results {
    max-height: 360px;
  }

  .detail-panel {
    padding: 24px 20px 40px;
  }

  .recipe-view-hero.has-photo {
    grid-template-columns: minmax(0, 1fr);
  }

  .recipe-view-photo {
    max-height: 280px;
  }

  .cook-view {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto;
  }

  .cook-top {
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 12px 16px;
  }

  .cook-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }

  .cook-rail {
    overflow: visible;
    padding: 12px;
  }

  .cook-rail-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .cook-rail-list > li {
    flex: 0 0 min(240px, 72vw);
  }

  .cook-rail-step {
    height: 100%;
  }

  .cook-rail-text {
    -webkit-line-clamp: 2;
  }

  .cook-main {
    overflow: visible;
  }

  .cook-step-card {
    padding: 24px;
  }

  .cook-step-text {
    max-width: none;
    font-size: 26px;
  }

  .cook-nav {
    padding: 12px 0 16px;
  }

  .cook-nav-button {
    width: auto;
    flex: 1 1 0;
    min-height: 56px;
  }
}

@media (max-width: 620px) {
  .app-header {
    min-height: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-block h1 {
    font-size: 17px;
  }

  .header-actions .add-sheet-open,
  .header-actions .profile-button {
    display: none;
  }

  .header-actions .toolbar-button {
    width: auto;
  }

  .page-shell.phone-view-search .detail-panel,
  .page-shell.phone-view-recipe .sidebar,
  .page-shell.phone-view-recipe .search-box {
    display: none;
  }

  .sidebar {
    min-height: calc(100vh - 124px);
    border-bottom: 0;
    background: var(--md-surface);
    padding: 14px 16px 104px;
  }

  .results {
    max-height: none;
    overflow: visible;
  }

  .detail-panel {
    padding: 16px 16px 184px;
  }

  .phone-back-button {
    display: inline-grid;
  }

  .recipe-view {
    gap: 22px;
  }

  .recipe-view-actions {
    width: 100%;
    margin-left: 0;
  }

  .recipe-view-title {
    font-size: 28px;
  }

  .cook-bar {
    gap: 12px 16px;
    padding: 12px;
  }

  .cook-bar-group {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .segmented-option {
    padding: 0 12px;
  }

  .cook-bar .lets-cook-button {
    position: fixed;
    right: 16px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    left: 16px;
    z-index: 15;
    min-height: 52px;
    box-shadow: var(--md-elevation-2);
  }

  .check-row {
    min-height: 44px;
    grid-template-columns: 22px 5rem minmax(0, 1fr);
    gap: 10px;
    padding: 2px 4px;
  }

  .check-row input {
    width: 22px;
    height: 22px;
  }

  .mobile-nav:not([hidden]) {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    border-top: 1px solid var(--md-outline-variant);
    background: var(--md-surface-container-low);
    padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .mobile-nav-item {
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--md-on-surface-variant);
    font-size: 12px;
    font-weight: 720;
    cursor: pointer;
  }

  .mobile-nav-icon {
    width: 56px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: var(--md-shape-full);
  }

  .mobile-nav-item[aria-current="page"] {
    color: var(--md-on-primary-container);
  }

  .mobile-nav-item[aria-current="page"] .mobile-nav-icon {
    background: var(--md-primary-container);
  }

  .mobile-nav-add {
    min-height: 52px;
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: var(--md-shape-full);
    background: var(--md-primary);
    color: var(--md-on-primary);
    padding: 0 20px 0 16px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: var(--md-elevation-2);
    cursor: pointer;
  }

  .mobile-nav-add .icon {
    stroke-width: 2.2;
  }

  .add-sheet-overlay {
    align-items: end;
    padding: 12px;
  }

  .add-sheet-panel {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 22px;
  }

  .add-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .cook-step-card {
    padding: 20px;
  }

  .cook-step-text {
    font-size: 22px;
  }

  .cook-timer {
    padding: 14px;
  }

  .cook-timer-dial {
    width: 80px;
    height: 80px;
  }

  .cook-timer-display {
    font-size: 19px;
  }

  .cook-timer-actions {
    width: 100%;
  }

  .cook-timer-actions > button {
    flex: 1 1 0;
  }

  .cook-nav {
    gap: 10px;
  }

  .cook-nav-button {
    min-height: 56px;
    padding: 0 12px;
    font-size: 16px;
  }
}

/* Liquid glass layer: calm translucent surfaces over a soft tinted background.
   Glass stays quiet so the recipe content keeps the attention. */
:root {
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --ink-faint: #5b6a73;
  --glass-bg: rgba(255, 255, 255, 0.64);
  --glass-bg-soft: rgba(255, 255, 255, 0.58);
  --glass-bg-strong: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-hairline: rgba(20, 32, 42, 0.08);
  --glass-hairline-strong: rgba(20, 32, 42, 0.16);
  --glass-blur: blur(24px) saturate(140%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 16px rgba(20, 32, 42, 0.05);
  --dark-glass-bg: rgba(255, 255, 255, 0.055);
  --dark-glass-soft: rgba(255, 255, 255, 0.06);
  --dark-glass-border: rgba(255, 255, 255, 0.1);
  --dark-ink: #eef3f6;
  --dark-ink-muted: #aebdc5;
  --dark-accent: #9fd3e1;
}

body {
  background-color: #f2f3f5;
  background-image:
    radial-gradient(640px 640px at 0% 0%, rgba(156, 201, 214, 0.42), transparent 70%),
    radial-gradient(560px 560px at 100% 25%, rgba(243, 223, 174, 0.42), transparent 70%),
    radial-gradient(600px 600px at 55% 100%, rgba(217, 212, 240, 0.4), transparent 70%);
  background-attachment: fixed;
  font-family: var(--sans);
}

.app-header,
.sidebar,
.detail-panel {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}

.app-header {
  top: 12px;
  margin: 12px 16px 0;
  min-height: 64px;
  border-radius: var(--md-shape-full);
  padding: 10px;
}

.brand-block {
  width: 344px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--md-shape-full);
  box-shadow: 0 2px 6px rgba(31, 70, 86, 0.18);
}

.brand-block h1 {
  font-size: 17px;
  font-weight: 600;
}

.search-box input {
  border-color: var(--glass-hairline);
  background: var(--glass-bg-strong);
}

.search-box input:hover:not(:disabled) {
  border-color: var(--glass-hairline-strong);
}

.toolbar-button-primary,
.add-sheet-open,
.lets-cook-button {
  background: var(--md-primary);
  box-shadow: 0 2px 6px rgba(31, 70, 86, 0.18);
  font-weight: 600;
}

.lets-cook-button {
  min-height: 46px;
  font-size: 15px;
}

.lets-cook-button:hover:not(:disabled) {
  box-shadow: 0 2px 8px rgba(31, 70, 86, 0.24);
}

.workspace {
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.sidebar {
  top: 92px;
  height: calc(100vh - 108px);
  border-radius: 28px;
  padding: 18px;
}

.detail-panel {
  min-height: calc(100vh - 108px);
  border-radius: 32px;
  padding: 28px 36px 40px;
}

.filter-chip,
.filters-summary {
  min-height: 34px;
  border-color: var(--glass-hairline);
  border-radius: var(--md-shape-full);
  background: var(--glass-bg-soft);
  color: var(--md-on-surface);
  font-size: 13px;
  font-weight: 500;
}

.filter-chip:hover,
.filters-summary:hover,
.filters-disclosure[open] > .filters-summary {
  border-color: var(--glass-hairline-strong);
  background: var(--glass-bg-strong);
}

.filter-chip[aria-pressed="true"] {
  border-color: #1b262d;
  background: #1b262d;
  color: #ffffff;
}

.filters {
  border-color: var(--glass-hairline);
  border-radius: 20px;
  background: var(--glass-bg-strong);
}

.filter select {
  border-color: var(--glass-hairline-strong);
  border-radius: var(--md-shape-medium);
  background: rgba(255, 255, 255, 0.9);
}

.results {
  gap: 4px;
}

.result-card {
  border-color: transparent;
  border-radius: var(--md-shape-large);
  background: transparent;
  padding: 8px 10px 8px 8px;
}

.result-card:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.6);
}

.result-card.active {
  border-color: rgba(47, 95, 115, 0.3);
  background: var(--glass-bg-strong);
  color: var(--md-on-surface);
  box-shadow: 0 2px 8px rgba(20, 32, 42, 0.06);
}

.result-card.active .result-meta {
  color: var(--md-on-surface-variant);
}

.result-thumb {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.result-thumb .icon {
  width: 20px;
  height: 20px;
}

.result-thumb-web,
.add-option-icon-web {
  background: #dcebf0;
  color: #2f5f73;
}

.result-thumb-photo,
.add-option-icon-photo {
  background: #eee4d6;
  color: #7a5a32;
}

.result-thumb-ai,
.add-option-icon-ai {
  background: #e6e2f5;
  color: #5b4bb0;
}

.result-thumb-manual,
.add-option-icon-manual {
  background: #e3ece6;
  color: #3f6b56;
}

.source-pill,
.pill-button,
.icon-button,
.chip-oak,
.chip-azure {
  border: 1px solid var(--glass-hairline);
  background: var(--glass-bg-soft);
}

.source-pill {
  border-radius: var(--md-shape-full);
  font-weight: 500;
}

.pill-button {
  font-weight: 500;
}

.pill-button:hover:not(:disabled),
.icon-button:hover {
  border-color: var(--glass-hairline-strong);
  background: var(--glass-bg-strong);
}

.recipe-view-actions .icon-button {
  background: var(--glass-bg-soft);
}

.recipe-view-title,
.section-heading h3,
.add-sheet-header h2,
.cook-rail-head h3,
.detail-empty-title,
.cloud-auth-copy h2,
.profile-header h2,
.ai-modal-header h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
}

.recipe-view-title {
  font-size: clamp(34px, 3.4vw, 48px);
  line-height: 1.02;
}

.recipe-view-description {
  color: #3a4a54;
  font-size: 16px;
}

.recipe-meta-row {
  color: #45555f;
  font-size: 13px;
}

.chip {
  min-height: 28px;
  border-radius: var(--md-shape-full);
  padding: 0 10px;
  font-weight: 500;
}

.chip-oak,
.chip-azure {
  color: #3a4a54;
}

.recipe-view-photo {
  border-radius: 22px;
  box-shadow: none;
}

.cook-bar {
  border-color: var(--glass-hairline);
  border-radius: 22px;
  background: var(--glass-bg-soft);
  padding: 8px 8px 8px 18px;
}

.servings-stepper {
  border-color: var(--glass-hairline);
  background: var(--glass-bg-strong);
}

.segmented {
  background: rgba(20, 32, 42, 0.06);
}

.segmented-option[aria-pressed="true"] {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(20, 32, 42, 0.1);
  font-weight: 600;
}

.section-heading h3 {
  font-size: 26px;
}

.check-row:hover {
  background: rgba(255, 255, 255, 0.5);
}

.check-row-amount {
  color: #6b4f00;
  font-size: 14px;
  font-weight: 600;
}

.check-row-text {
  font-size: 14px;
}

.method-list {
  gap: 0;
}

.method-step {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid rgba(20, 32, 42, 0.07);
  padding: 12px 4px;
}

.method-step-number {
  width: 26px;
  height: 26px;
  background: rgba(47, 95, 115, 0.1);
  color: #1f4656;
  font-size: 13px;
  font-weight: 600;
}

.method-step-body p {
  font-size: 15px;
}

.time-chip {
  min-height: 24px;
  border-radius: var(--md-shape-full);
  background: rgba(118, 88, 0, 0.08);
  color: #5c4300;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
}

.recipe-view-card {
  border: 1px solid var(--glass-hairline);
  border-radius: 22px;
  background: var(--glass-bg-soft);
}

.comments-form textarea {
  border-color: var(--glass-hairline-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
}

.add-sheet-scrim {
  background: rgba(20, 32, 42, 0.2);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.add-sheet-panel {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  backdrop-filter: blur(28px) saturate(140%);
  box-shadow: inset 0 1px 0 #ffffff, 0 16px 48px rgba(20, 32, 42, 0.14);
}

.add-sheet-header h2 {
  font-size: 34px;
  line-height: 1.1;
}

.add-option {
  border-color: var(--glass-hairline);
  border-radius: 20px;
  background: var(--glass-bg-soft);
}

.add-option:hover:not(:disabled) {
  border-color: var(--glass-hairline-strong);
  background: rgba(255, 255, 255, 0.95);
}

.add-option-icon {
  border-radius: 13px;
}

.add-option-title {
  font-size: 15px;
  font-weight: 600;
}

/* Cooking mode: dark glass so the screen stays calm in the kitchen. */
body.cooking-mode-active {
  background-color: #11171c;
  background-image:
    radial-gradient(620px 620px at 0% 0%, rgba(31, 94, 112, 0.45), transparent 70%),
    radial-gradient(560px 560px at 100% 100%, rgba(107, 82, 32, 0.4), transparent 70%);
  color: var(--dark-ink);
  color-scheme: dark;
}

.cooking-mode-active :focus-visible {
  outline-color: rgba(159, 211, 225, 0.75);
}

.cooking-mode-active .workspace {
  padding: 0;
}

.cooking-mode-active .detail-panel {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  padding: 0;
}

.cook-view {
  gap: 16px;
  padding: 16px;
}

.cook-top,
.cook-rail,
.cook-step-card,
.cook-all-ingredients {
  border: 1px solid var(--dark-glass-border);
  background: var(--dark-glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  backdrop-filter: blur(24px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 20px rgba(0, 0, 0, 0.18);
  color: var(--dark-ink);
}

.cook-top {
  min-height: 64px;
  border-radius: var(--md-shape-full);
  padding: 10px;
}

.cook-top-title h2 {
  font-size: 16px;
  font-weight: 600;
}

.cook-top-title span,
.cook-top-label,
.cook-rail-head span,
.cook-need-label {
  color: var(--dark-ink-muted);
}

.cook-elapsed {
  font-size: 20px;
  font-weight: 600;
}

.cook-body {
  gap: 16px;
  padding: 0;
}

.cook-rail {
  border-radius: 28px;
}

.cook-rail-head h3 {
  font-size: 24px;
}

.cook-rail-step {
  border-color: transparent;
  border-radius: var(--md-shape-large);
  background: transparent;
  color: #bfcbd1;
}

.cook-rail-step:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
}

.cook-rail-step.is-done {
  background: transparent;
}

.cook-rail-step.is-done .cook-rail-text {
  color: #8193a0;
}

.cook-rail-step.is-current {
  border-color: rgba(159, 211, 225, 0.4);
  background: rgba(159, 211, 225, 0.1);
  color: #ffffff;
  box-shadow: none;
}

.cook-rail-badge,
.cook-rail-step.is-done .cook-rail-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #cfd9de;
}

.cook-rail-step.is-done .cook-rail-badge {
  color: var(--dark-accent);
}

.cook-rail-step.is-current .cook-rail-badge {
  background: var(--dark-accent);
  color: #06222c;
}

.cook-view .time-chip {
  background: rgba(255, 255, 255, 0.07);
  color: #d9c9a4;
}

.cook-step-card {
  border-radius: 32px;
}

.cook-step-label {
  background: rgba(255, 255, 255, 0.08);
  color: #b9d9e2;
  font-weight: 500;
}

.cook-step-text {
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 450;
  line-height: 1.28;
}

.cook-need-item {
  border: 1px solid var(--dark-glass-border);
  border-radius: var(--md-shape-full);
  background: var(--dark-glass-soft);
  color: var(--dark-ink);
}

.cook-need-item strong {
  color: #e6cf98;
  font-weight: 600;
}

.cook-timer {
  border-color: var(--dark-glass-border);
  border-radius: 22px;
  background: var(--dark-glass-soft);
}

.cook-timer.is-running {
  border-color: rgba(159, 211, 225, 0.35);
  background: rgba(159, 211, 225, 0.06);
}

.cooking-mode-active .cook-timer-ring-track {
  stroke: rgba(255, 255, 255, 0.1);
}

.cooking-mode-active .cook-timer-ring-value {
  stroke: var(--dark-accent);
}

.cook-timer-caption {
  color: var(--dark-ink-muted);
}

.cooking-mode-active .pill-button {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--dark-glass-soft);
  color: var(--dark-ink);
}

.cooking-mode-active .pill-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

.cooking-mode-active .lets-cook-button {
  background: var(--dark-accent);
  color: #06222c;
  box-shadow: none;
}

.cooking-mode-active .lets-cook-button:hover:not(:disabled) {
  background: #b8e0ea;
  box-shadow: none;
}

.cooking-mode-active .secondary-pill-button {
  border: 1px solid rgba(242, 213, 138, 0.25);
  background: rgba(242, 213, 138, 0.1);
  color: #f1d9a0;
}

.cooking-mode-active .secondary-pill-button:hover {
  background: rgba(242, 213, 138, 0.16);
}

.cook-all-ingredients {
  border-radius: var(--md-shape-large);
  box-shadow: none;
}

.cook-view .group-title {
  color: #c7b89e;
}

.cook-view .check-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cook-view .check-row input {
  accent-color: var(--dark-accent);
}

.cook-view .check-row-text {
  color: #dfe7eb;
}

.cook-view .check-row-amount {
  color: #e6cf98;
}

.cook-view .check-row.is-checked .check-row-amount,
.cook-view .check-row.is-checked .check-row-text {
  color: #8193a0;
}

.cook-nav {
  background: rgba(17, 23, 28, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.cook-empty {
  color: var(--dark-ink-muted);
}

@media (max-width: 1100px) {
  .brand-block {
    width: auto;
  }

  .workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .detail-panel {
    padding: 24px 28px 36px;
  }
}

@media (max-width: 820px) {
  .app-header {
    margin: 12px 12px 0;
    border-radius: 24px;
  }

  .workspace {
    padding: 12px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .detail-panel {
    min-height: 0;
    padding: 22px 20px 32px;
  }

  .cook-view {
    padding: 12px;
  }

  .cook-top {
    border-radius: 24px;
  }
}

@media (max-width: 620px) {
  .app-header {
    top: 8px;
    margin: 8px 8px 0;
  }

  .workspace {
    padding: 8px;
  }

  .sidebar {
    min-height: calc(100vh - 124px);
    border: 0;
    border-radius: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    padding: 8px 8px 104px;
  }

  .result-card {
    border-color: var(--glass-hairline);
    background: var(--glass-bg-soft);
  }

  /* A backdrop filter would become the containing block of the fixed
     Let's cook button, so the phone panel uses a denser plain fill. */
  .detail-panel {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.84);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 16px 16px 184px;
  }

  .cook-bar .lets-cook-button {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .mobile-nav:not([hidden]) {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
    min-height: 64px;
    border: 1px solid var(--glass-border);
    border-radius: var(--md-shape-full);
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 20px rgba(20, 32, 42, 0.08);
    padding: 8px;
  }

  .mobile-nav-item {
    min-height: 48px;
    flex-direction: row;
    justify-self: center;
    gap: 6px;
    border-radius: var(--md-shape-full);
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
  }

  .mobile-nav-icon,
  .mobile-nav-item[aria-current="page"] .mobile-nav-icon {
    width: auto;
    height: auto;
    background: none;
  }

  .mobile-nav-item[aria-current="page"] {
    background: rgba(47, 95, 115, 0.1);
    color: #1f4656;
  }

  .mobile-nav-add {
    min-height: 48px;
    box-shadow: 0 2px 8px rgba(31, 70, 86, 0.2);
    font-size: 14px;
    font-weight: 600;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .app-header,
  .sidebar,
  .detail-panel,
  .add-sheet-panel,
  .mobile-nav:not([hidden]) {
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .cook-top,
  .cook-rail,
  .cook-step-card,
  .cook-all-ingredients {
    background: #1a2228;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Color zones: a faint tint per area so the parts of the app read apart.
   Cool steel for navigation and actions, warm cream for the library and
   the ingredients, neutral white for the recipe itself. */
body {
  background-image:
    radial-gradient(660px 660px at 0% 0%, rgba(143, 195, 210, 0.55), transparent 70%),
    radial-gradient(580px 580px at 100% 20%, rgba(241, 217, 160, 0.55), transparent 70%),
    radial-gradient(620px 620px at 60% 100%, rgba(213, 205, 240, 0.52), transparent 70%),
    radial-gradient(460px 460px at 0% 100%, rgba(242, 196, 176, 0.45), transparent 70%);
}

.app-header {
  background: rgba(232, 242, 246, 0.74);
}

.sidebar {
  background: rgba(251, 245, 234, 0.72);
}

.detail-panel {
  background: rgba(239, 249, 255, 0.64);
}

.cook-bar {
  border-color: rgba(47, 95, 115, 0.14);
  background: rgba(214, 233, 239, 0.6);
}

.recipe-view-columns > .recipe-view-section:first-child {
  align-self: start;
  border: 1px solid rgba(118, 88, 0, 0.1);
  border-radius: 22px;
  background: rgba(243, 223, 174, 0.2);
  padding: 16px 12px 12px;
}

body.cooking-mode-active {
  background-image:
    radial-gradient(640px 640px at 0% 0%, rgba(31, 94, 112, 0.55), transparent 70%),
    radial-gradient(580px 580px at 100% 100%, rgba(107, 82, 32, 0.5), transparent 70%),
    radial-gradient(420px 420px at 55% 35%, rgba(60, 52, 120, 0.4), transparent 70%);
}

.cook-rail {
  border-color: rgba(159, 211, 225, 0.14);
  background: rgba(159, 211, 225, 0.07);
}

.cook-timer {
  border-color: rgba(230, 207, 152, 0.16);
  background: rgba(230, 207, 152, 0.07);
}

@media (max-width: 620px) {
  .sidebar {
    background: transparent;
  }

  .result-card {
    background: rgba(251, 245, 234, 0.72);
  }

  .mobile-nav:not([hidden]) {
    background: rgba(232, 242, 246, 0.82);
  }

  /* Same tint, denser: the phone panel has no blur behind it. */
  .detail-panel {
    background: rgba(239, 249, 255, 0.86);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .app-header {
    background: #eef5f8;
  }

  .sidebar {
    background: #fbf6ee;
  }

  .detail-panel {
    background: #eff9ff;
  }
}
