:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #f5f7f4;
  --surface-strong: #fdfaf4;
  --text: #20201d;
  --muted: #7a7e76;
  --line: #e5e7e1;
  --accent: #2bb673;
  --accent-dark: #1f8f5a;
  --accent-soft: #e6f5ed;
  --warm: #c4552f;
  --gold: #d79a2b;
  --heart: #e95b6c;
  --shadow-card: 0 4px 18px rgba(20, 40, 30, 0.06);
  --shadow-lift: 0 12px 30px rgba(20, 40, 30, 0.1);
  --shadow: 0 20px 50px rgba(39, 36, 28, 0.12);
  --radius-card: 16px;
  --radius-pill: 999px;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 96px;
  background:
    radial-gradient(600px 300px at 10% -10%, rgba(43, 182, 115, 0.08), transparent 60%),
    radial-gradient(500px 260px at 110% 0%, rgba(255, 199, 95, 0.1), transparent 60%),
    var(--bg);
  color: var(--text);
}

body.dialog-polyfill-lock {
  overflow: hidden;
}

dialog:not([open]) {
  display: none;
}

dialog.dialog-polyfill-open {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  z-index: 999;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  background: var(--surface);
}

dialog.dialog-polyfill-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: -1;
}

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

button {
  cursor: pointer;
}

.app-header {
  padding: 28px clamp(16px, 4vw, 40px) 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  color: var(--text);
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.brand h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.1;
  color: var(--accent-dark);
  letter-spacing: 0.5px;
}

.brand-emoji {
  font-size: 0.9em;
  display: inline-block;
  margin-left: 6px;
}

.brand-tagline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.header-actions,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
}

.layout {
  width: min(1440px, calc(100% - 28px));
  margin: 8px auto 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 80% -20%, rgba(255, 255, 255, 0.35), transparent 60%),
    linear-gradient(120deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(31, 143, 90, 0.22);
}

.welcome-greeting {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.welcome-greeting .heart {
  color: #ffe9b0;
  font-size: 16px;
}

.welcome-message {
  margin: 6px 0 0;
  font-size: 14px;
  opacity: 0.92;
}

.welcome-illustration {
  font-size: 28px;
  letter-spacing: 4px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
}

.action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.action-bar .add-btn {
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  white-space: nowrap;
}

.action-bar .search-box {
  flex: 1;
  min-width: 0;
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.content {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-card);
  padding: 18px;
  min-height: 280px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box {
  position: relative;
  display: block;
  margin: 0;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: 0.6;
  pointer-events: none;
}

.search-box input {
  min-height: 44px;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 104, 0.14);
}

.panel {
  padding-top: 20px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-actions .primary-button,
.quick-actions .ghost-button {
  flex: 1 1 140px;
  border-radius: var(--radius-pill);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 14px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.segmented button,
.chip-list button {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  padding: 8px 16px;
  min-height: 36px;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.segmented button.active,
.chip-list button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(43, 182, 115, 0.28);
}

.segmented button:not(.active):hover,
.chip-list button:not(.active):hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.recipe-count {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-dark);
}

.recipe-count::before {
  content: "🍽 ";
  font-size: 0.85em;
}

.hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.primary-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 10px;
  min-height: 42px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(43, 182, 115, 0.28);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:active {
  transform: translateY(1px);
}

.ghost-button {
  background: var(--surface);
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

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

.ghost-button.light {
  background: var(--surface);
  color: var(--accent-dark);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  min-height: 38px;
}

.danger-button {
  background: #fff1eb;
  color: #a43d22;
}

.recipe-grid,
.menu-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.menu-section {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  grid-column: 1 / -1;
  margin-bottom: 6px;
}

.menu-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 10px;
  border-bottom: 0;
  background: transparent;
}

.menu-section-header h2 {
  margin: 0;
  font-size: 16px;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-section-header h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

.menu-section-header .hint {
  margin: 0;
  font-size: 12px;
  padding: 2px 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: var(--radius-pill);
  font-weight: 800;
}

.menu-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

@media (max-width: 860px) {
  .menu-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.owner-group {
  grid-column: 1 / -1;
}

.owner-group + .owner-group {
  margin-top: 6px;
}

.owner-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 12px;
}

.owner-group-header h2 {
  margin: 0;
  font-size: 20px;
}

.owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.recipe-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
  .recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
  }
}

.recipe-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-card);
}

.recipe-card.selectable {
  cursor: pointer;
}

.recipe-card.selected {
  border-color: var(--accent);
  background: #f6fdf9;
  box-shadow: 0 0 0 3px rgba(43, 182, 115, 0.22), var(--shadow-card);
}

.recipe-card .card-image-wrap {
  position: relative;
  display: block;
}

.recipe-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e7e0d1;
  display: block;
}

.card-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #c8c8c8;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(20, 40, 30, 0.15);
  transition: transform 0.1s ease, color 0.15s ease, background 0.15s ease;
}

.card-favorite:active {
  transform: scale(0.9);
}

.card-favorite.is-favorite {
  color: var(--heart);
  background: #fff;
}

.card-favorite:hover {
  color: var(--heart);
}

.card-image-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(20, 40, 30, 0.12);
}

.recipe-body {
  padding: 12px 14px 14px;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
}

.menu-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.order-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: transparent;
  font-weight: 900;
}

.recipe-card.selected .order-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef5f2;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.pill.warm {
  background: #fff0e9;
  color: var(--warm);
}

.recipe-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--text);
}

.recipe-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.recipe-card .recipe-subline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.recipe-card .recipe-subline .subline-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.recipe-card .recipe-subline .subline-owner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.mini-list {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  line-height: 1.48;
}

.card-actions {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.detail-dialog {
  width: min(880px, calc(100% - 26px));
}

.detail-shell {
  padding: 24px;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.detail-image {
  width: 100%;
  border-radius: var(--radius-card);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e7e0d1;
  grid-row: span 6;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 4px 0 4px;
}

.detail-meta .pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

.detail-meta .pill strong {
  font-size: 15px;
  color: var(--accent-dark);
  font-weight: 900;
}

.detail-meta .pill small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 4px;
}

.detail-tags .tag {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.detail-section {
  padding-top: 4px;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.detail-section h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

.detail-section.tip-section {
  border: 1px solid var(--accent-soft);
  background: #f3fbf6;
  border-radius: 12px;
  padding: 12px 14px;
}

.detail-section.tip-section h3::before {
  display: none;
}

.detail-section.tip-section h3 {
  color: var(--accent-dark);
  font-size: 14px;
}

.detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
  font-size: 13px;
}

.detail-list,
.step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
}

.detail-list.ingredient-table {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 12px 14px;
  gap: 4px;
}

.detail-list.ingredient-table li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(43, 182, 115, 0.22);
  color: var(--text);
}

.detail-list.ingredient-table li:last-child {
  border-bottom: 0;
}

.detail-list.ingredient-table li .amount {
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 12px;
}

.step-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: start;
}

.step-list li {
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
}

.step-list strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  margin-top: 1px;
}

.order-panel {
  margin-bottom: 16px;
  border: 1px solid #b8d8cc;
  border-radius: 8px;
  background: #eef8f4;
  padding: 14px 16px;
}

.action-fab {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: 0 18px 40px rgba(20, 40, 30, 0.18), 0 2px 6px rgba(20, 40, 30, 0.06);
  z-index: 90;
}

.action-fab-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 6px;
}

.action-fab-info[hidden] {
  display: none;
}

.action-fab-info strong {
  font-size: 14px;
  color: var(--accent-dark);
  font-weight: 900;
}

.action-fab-hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-fab-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.action-fab .fab-primary {
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  min-height: 42px;
  font-size: 14px;
}

.action-fab .fab-ghost {
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  min-height: 38px;
  font-size: 13px;
}

.action-fab .fab-primary[hidden],
.action-fab .fab-ghost[hidden] {
  display: none;
}

@media (max-width: 540px) {
  body {
    padding-bottom: 110px;
  }

  .action-fab {
    width: calc(100vw - 16px);
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px;
    gap: 8px;
    border-radius: 16px;
  }

  .action-fab-info {
    padding-left: 4px;
  }

  .action-fab-info strong {
    font-size: 13px;
  }

  .action-fab-hint {
    font-size: 11px;
  }

  .action-fab .fab-primary {
    padding: 9px 14px;
    font-size: 13px;
  }

  .action-fab .fab-ghost {
    padding: 7px 12px;
  }
}

.wishlist-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.wishlist-panel h2 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-dark);
}

.wishlist-panel h2::before {
  content: "💛";
}

.wishlist-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.wishlist-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.wishlist-actions {
  display: flex;
  gap: 6px;
}

.wishlist-item strong {
  display: block;
  font-size: 14px;
}

.wishlist-item span {
  color: var(--muted);
  font-size: 12px;
}

.tiny-button {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  min-height: 30px;
  padding: 5px 12px;
  background: var(--surface);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 12px;
}

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

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 900;
}

.empty-state {
  min-height: 420px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  background: var(--surface-strong);
}

.empty-state h2 {
  margin: 0 0 8px;
}

.recipe-dialog {
  width: min(760px, calc(100% - 26px));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 25px 80px rgba(26, 24, 20, 0.28);
  padding: 0;
}

.compact-dialog {
  width: min(460px, calc(100% - 26px));
}

.order-dialog {
  width: min(560px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.order-dialog::backdrop {
  background: rgba(15, 25, 20, 0.5);
  backdrop-filter: blur(4px);
}

.cute-order-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 22px;
  background:
    radial-gradient(circle at 92% -10%, rgba(43, 182, 115, 0.08), transparent 60%),
    var(--surface);
  box-shadow: 0 28px 80px rgba(20, 40, 30, 0.18);
}

.history-card {
  max-height: min(760px, calc(100vh - 36px));
}

.history-list {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.history-item,
.empty-history {
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 13px;
}

.history-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.history-item-head strong {
  color: var(--accent-dark);
}

.history-item-head span {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.history-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.empty-history {
  color: var(--muted);
  text-align: center;
}

.order-receipt {
  margin: 12px 0 18px;
  padding: 16px;
  border: 1px dashed rgba(43, 182, 115, 0.45);
  border-radius: 12px;
  background: var(--accent-soft);
}

.receipt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(43, 182, 115, 0.25);
}

.receipt-top strong {
  font-size: 22px;
  color: var(--accent-dark);
}

.receipt-section {
  padding: 12px 0 0;
}

.receipt-section h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.receipt-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.receipt-section li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #fff;
}

.receipt-section em {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 900;
}

.receipt-note {
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-weight: 800;
  text-align: center;
}

.recipe-dialog::backdrop {
  background: rgba(15, 25, 20, 0.5);
  backdrop-filter: blur(4px);
}

.recipe-dialog form {
  padding: 22px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
}

.dialog-header h2 {
  margin: 2px 0 0;
  font-size: 24px;
  color: var(--text);
}

@media (max-width: 540px) {
  .recipe-dialog form,
  .detail-shell {
    padding: 16px;
  }

  .dialog-header h2 {
    font-size: 20px;
  }

  .dialog-header {
    padding-bottom: 12px;
  }

  .form-grid {
    gap: 10px;
  }

  .form-grid label > span {
    font-size: 12px;
  }

  textarea {
    padding: 8px 10px;
  }
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

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

.image-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f0;
}

.image-preview {
  width: 116px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  background: #e7e0d1;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.image-tools span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 42px;
  border-radius: 6px;
  padding: 10px 16px;
  background: #f1eee6;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.order-field {
  margin: 10px 0;
}

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0 14px;
}

.wide {
  grid-column: 1 / -1;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
}

.single-action {
  justify-content: flex-end;
}

.dialog-actions > div {
  display: flex;
  gap: 10px;
}

@media (max-width: 860px) {
  body {
    background-attachment: scroll;
  }

  .app-header {
    padding: 20px 16px 4px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .brand h1 {
    font-size: 24px;
  }

  .brand-tagline {
    font-size: 12px;
  }

  .image-tools,
  .image-actions,
  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .layout {
    width: calc(100% - 24px);
    gap: 14px;
  }

  .welcome-banner {
    padding: 14px 16px;
  }

  .welcome-illustration {
    font-size: 22px;
    letter-spacing: 2px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-bar .add-btn {
    width: 100%;
  }

  .toolbar,
  .dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar > div:first-child {
    text-align: left;
  }

  .recipe-grid,
  .menu-board {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .recipe-card {
    min-height: 0;
  }

  .recipe-card h3 {
    font-size: 14px;
  }

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

  .detail-content {
    grid-template-columns: 1fr;
  }

  .detail-image {
    grid-row: auto;
    aspect-ratio: 16 / 10;
  }

  .detail-columns {
    grid-template-columns: 1fr;
  }

  .dialog-actions > div {
    flex-direction: column;
  }

  .quick-actions {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .recipe-grid,
  .menu-board {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
