:root {
  color-scheme: light;
  --ink: #173044;
  --muted: #63717c;
  --paper: #fff8eb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --line: rgba(23, 48, 68, 0.12);
  --sea: #087f8c;
  --sea-dark: #075d68;
  --mint: #dff4ec;
  --terracotta: #c65f3a;
  --olive: #637a42;
  --amber: #f4c95d;
  --shadow: 0 18px 48px rgba(23, 48, 68, 0.16);
  --soft-shadow: 0 10px 28px rgba(23, 48, 68, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(244, 201, 93, 0.35), transparent 24%),
    radial-gradient(circle at 95% 18%, rgba(8, 127, 140, 0.2), transparent 32%),
    linear-gradient(140deg, #edf7f1 0%, #f7fbf3 52%, #fff4eb 100%);
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface-strong);
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(23, 48, 68, 0.05);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hidden {
  display: none !important;
}

.ghost {
  background: rgba(255, 255, 255, 0.72);
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 980px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 0;
}

.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 980px);
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  padding: max(10px, env(safe-area-inset-top)) 14px 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.app-icon {
  position: relative;
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #0d9aa5, var(--sea));
  box-shadow: 0 12px 24px rgba(8, 127, 140, 0.28);
}

.app-icon::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 24px;
  background: #fff8eb;
  clip-path: polygon(0 0, 100% 0, 56% 58%, 56% 78%, 78% 78%, 78% 100%, 22% 100%, 22% 78%, 44% 78%, 44% 58%);
  transform: translateY(3px);
}

.app-icon::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: #fff8eb;
  transform: translate(9px, -11px) rotate(-30deg);
}

.app-icon span {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--amber);
}

.app-icon.large {
  flex-basis: 64px;
  width: 64px;
  height: 64px;
  border-radius: 20px;
}

.app-header h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-header h1 {
  margin: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 6vw, 2.05rem);
  line-height: 0.98;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header p {
  display: none;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.actions-toggle {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 42px;
  place-items: center;
  border-color: rgba(8, 127, 140, 0.2);
  border-radius: 14px;
  padding: 0;
  color: var(--sea);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(23, 48, 68, 0.08);
}

.actions-toggle span,
.actions-toggle::before,
.actions-toggle::after {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.actions-toggle span {
  box-shadow: 0 -9px 0 currentColor, 0 9px 0 currentColor;
}

.actions-toggle::before,
.actions-toggle::after {
  display: none;
}

.actions-toggle[aria-expanded="true"] {
  border-color: rgba(8, 127, 140, 0.38);
  color: #fff;
  background: var(--sea);
}

.toolbar-actions {
  position: absolute;
  top: calc(100% + 8px);
  right: 10px;
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  width: min(350px, calc(100vw - 20px));
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.toolbar-actions.open {
  display: grid;
}

.toolbar-actions button {
  justify-content: flex-start;
  min-height: 46px;
  text-align: left;
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 980px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -12px 36px rgba(23, 48, 68, 0.12);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.tab-button {
  min-height: 48px;
  border-color: transparent;
  border-radius: 16px;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  font-size: clamp(0.68rem, 2.55vw, 0.92rem);
  font-weight: 850;
  box-shadow: none;
}

.tab-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--sea), #0b95a0);
  box-shadow: 0 10px 22px rgba(8, 127, 140, 0.18);
}

.tab-panels {
  position: fixed;
  top: calc(82px + env(safe-area-inset-top));
  bottom: calc(70px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 1;
  width: min(calc(100% - 22px), 960px);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 14px;
  scrollbar-gutter: stable;
  transform: translateX(-50%);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel,
.menu-page,
.recipe-page {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
}

.tab-sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -14px -14px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 16px 14px 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.tab-panel > .tab-sticky {
  margin: 0 0 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin: 0 0 5px;
  font-size: clamp(1.45rem, 6vw, 2rem);
  line-height: 1.05;
}

.panel-heading p,
.ingredient-intro {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 4.2vw, 1.12rem);
  line-height: 1.35;
}

.ingredient-panel-heading {
  align-items: center;
  margin-bottom: 9px;
}

.ingredient-panel-heading h2 {
  margin-bottom: 0;
}

.cocktail-panel-heading {
  align-items: center;
  margin-bottom: 14px;
}

.cocktail-panel-heading h2 {
  margin-bottom: 0;
}

.ingredient-intro {
  width: 100%;
  margin-bottom: 14px;
}

.ingredient-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.cabinet-scan-launch {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border-color: rgba(8, 127, 140, 0.28);
  border-radius: 13px;
  padding: 0;
  color: #fff;
  background: var(--sea);
  box-shadow: 0 8px 18px rgba(8, 127, 140, 0.2);
}

.cabinet-scan-launch svg,
.scan-onboarding-camera svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.cabinet-scan-launch:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.ingredient-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 0;
}

.search-field {
  display: grid;
  gap: 7px;
}

.search-field label {
  color: #435365;
  font-size: 0.92rem;
  font-weight: 850;
}

.search-input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 58px 0 16px;
  color: var(--ink);
  background: #fff;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(23, 48, 68, 0.04);
}

.search-submit {
  position: absolute;
  right: 7px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border-color: transparent;
  border-radius: 10px;
  padding: 0;
  color: var(--sea);
  background: rgba(8, 127, 140, 0.08);
  box-shadow: none;
}

.search-submit span {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  margin: auto;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.search-submit span::after {
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.filter-btn {
  flex: 0 0 auto;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 15px;
  font-size: 0.9rem;
  font-weight: 850;
}

.filter-btn.active {
  border-color: var(--sea);
  color: #fff;
  background: var(--sea);
}

#ingredientCount,
#cocktailCount {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--olive);
  background: #eef4e4;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.selection-stack {
  display: grid;
  gap: 16px;
}

.selection-group {
  display: grid;
  gap: 9px;
}

.selection-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.selection-group-heading h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-group-heading span {
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(23, 48, 68, 0.07);
  font-size: 0.8rem;
  font-weight: 900;
}

.selection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.chip,
.cocktail-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(23, 48, 68, 0.06);
}

.chip {
  min-height: 64px;
  padding: 12px 14px;
}

.chip strong,
.cocktail-option strong {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
}

.chip small,
.cocktail-option span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
}

.chip input,
.cocktail-option input {
  width: 22px;
  height: 22px;
  accent-color: var(--sea);
}

.cocktail-option {
  align-items: flex-start;
  padding: 14px;
}

.cocktail-option.unavailable {
  background: rgba(255, 255, 255, 0.72);
}

.cocktail-option input:disabled {
  opacity: 0.38;
}

.cocktail-option.unavailable strong {
  color: #435365;
}

.missing-note,
.makeable-note {
  margin-top: 7px;
  font-size: 0.82rem;
  font-weight: 900;
}

.missing-note {
  color: var(--terracotta);
}

.missing-ingredient-btn {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-color: rgba(198, 95, 58, 0.28);
  border-radius: 999px;
  margin: 5px 4px 0 0;
  padding: 0 9px;
  color: var(--terracotta);
  background: rgba(198, 95, 58, 0.08);
  font-size: 0.8rem;
  font-weight: 900;
  box-shadow: none;
}

.missing-ingredient-btn:focus-visible,
.missing-ingredient-btn:hover {
  border-color: rgba(198, 95, 58, 0.52);
  background: rgba(198, 95, 58, 0.14);
}

.makeable-note {
  color: var(--sea);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 48, 68, 0.34);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(100%, 360px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.1;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.modal-card strong {
  color: var(--ink);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions button {
  min-height: 46px;
}

.modal-primary {
  border-color: var(--sea);
  color: #fff;
  background: var(--sea);
}

.modal-danger {
  border-color: var(--terracotta);
  color: #fff;
  background: var(--terracotta);
}

.app-confirm-backdrop {
  z-index: 90;
}

.app-confirm-card {
  width: min(100%, 390px);
}

.app-confirm-card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.clear-categories-card {
  width: min(100%, 410px);
}

.clear-category-options {
  display: grid;
  max-height: min(42vh, 330px);
  gap: 7px;
  overflow-y: auto;
  margin-top: 15px;
  padding-right: 3px;
}

.clear-category-option,
.clear-select-all {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(23, 48, 68, 0.12);
  border-radius: 12px;
  padding: 9px 10px;
  color: var(--ink);
  background: rgba(248, 251, 248, 0.92);
  font-size: 0.88rem;
  font-weight: 800;
}

.clear-category-option input,
.clear-select-all input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--sea);
}

.clear-category-option span {
  min-width: 0;
}

.clear-category-option small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.clear-category-option:has(input:disabled) {
  opacity: 0.5;
}

.clear-select-all {
  margin-top: 10px;
  border-color: rgba(8, 127, 140, 0.24);
  color: var(--sea);
  background: rgba(8, 127, 140, 0.07);
}

.scan-setup-card {
  width: min(100%, 430px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 15px;
  scrollbar-width: none;
}

.scan-setup-card::-webkit-scrollbar {
  display: none;
}

.scan-setup-card > h2 {
  margin-bottom: 4px;
}

.scan-setup-card > p {
  font-size: 0.9rem;
}

.scan-setup-card .clear-category-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  gap: 6px;
  overflow: visible;
  margin-top: 10px;
  padding-right: 0;
}

.scan-setup-card .clear-category-option {
  min-width: 0;
  gap: 7px;
  padding: 7px 8px;
  font-size: 0.81rem;
}

.scan-setup-card .clear-category-option input,
.scan-setup-card .clear-select-all input {
  width: 18px;
  height: 18px;
}

.scan-setup-card .clear-category-option small {
  display: grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(23, 48, 68, 0.07);
  font-size: 0.7rem;
}

.scan-setup-card .clear-select-all {
  min-height: 40px;
  margin-top: 7px;
  padding: 7px 9px;
  font-size: 0.83rem;
}

.scan-update-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 0;
  margin: 11px 0 0;
  padding: 0;
}

.scan-update-mode legend {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.scan-update-mode label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  border: 1px solid rgba(23, 48, 68, 0.13);
  border-radius: 11px;
  padding: 8px;
  background: rgba(248, 251, 248, 0.92);
}

.scan-update-mode input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--sea);
}

.scan-update-mode span {
  display: grid;
  gap: 2px;
}

.scan-update-mode strong {
  font-size: 0.8rem;
  line-height: 1.2;
}

.scan-update-mode small {
  display: none;
}

.scan-setup-card .modal-actions {
  margin-top: 11px;
}

.scan-setup-card .modal-actions button {
  min-height: 42px;
}

.app-confirm-card.app-choice .modal-actions {
  grid-template-columns: 1fr;
}

.app-confirm-card.app-choice #appConfirmAccept {
  order: 1;
}

.app-confirm-card.app-choice #appConfirmAlternative {
  order: 2;
}

.app-confirm-card.app-choice #appConfirmDanger {
  order: 3;
}

.app-confirm-card.app-choice #appConfirmCancel {
  order: 4;
}

.menu-page {
  min-height: calc(100dvh - 184px);
  padding: 58px 14px 14px;
  background:
    linear-gradient(rgba(255, 248, 235, 0.88), rgba(255, 248, 235, 0.95)),
    radial-gradient(circle at 20% 18%, rgba(244, 201, 93, 0.45) 0 8%, transparent 9%),
    linear-gradient(135deg, rgba(8, 127, 140, 0.22) 0 28%, transparent 28% 100%),
    repeating-linear-gradient(45deg, rgba(198, 95, 58, 0.16) 0 2px, transparent 2px 18px),
    #fff8eb;
}

.menu-panel-actions {
  position: sticky;
  top: 8px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  width: fit-content;
  max-width: calc(100% - 20px);
  gap: 6px;
  border: 0;
  margin: 8px 10px -42px auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.menu-toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-color: rgba(23, 48, 68, 0.16);
  border-radius: 999px;
  padding: 0 11px 0 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.76rem;
  font-weight: 850;
  box-shadow: 0 7px 18px rgba(23, 48, 68, 0.13);
  backdrop-filter: blur(12px);
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

.menu-toolbar-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-toolbar-button:hover {
  border-color: rgba(8, 127, 140, 0.4);
  color: var(--sea);
  background: #fff;
}

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

.menu-mode-toggle[aria-pressed="true"] {
  border-color: var(--sea);
  color: #fff;
  background: var(--sea);
  box-shadow: 0 6px 14px rgba(8, 127, 140, 0.2);
}

.order-summary-button {
  border-color: rgba(8, 127, 140, 0.24);
  color: var(--sea);
  background: rgba(240, 251, 250, 0.94);
}

.order-summary-button[aria-pressed="true"] {
  border-color: var(--sea);
  color: #fff;
  background: var(--sea);
}

.menu-fullscreen-button[aria-pressed="true"] {
  border-color: var(--sea);
  color: #fff;
  background: var(--sea);
}

.exit-fullscreen-button {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 20;
  display: none;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 0;
  color: #fff;
  background: rgba(23, 48, 68, 0.58);
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(23, 48, 68, 0.2);
  backdrop-filter: blur(12px);
}

body.menu-presenting .app-header,
body.menu-presenting .tab-bar,
body.menu-presenting #menuPanel > .tab-sticky {
  display: none;
}

body.menu-presenting .menu-panel-actions {
  top: max(8px, env(safe-area-inset-top));
}

body.menu-presenting .exit-fullscreen-button {
  display: none;
}

body.menu-presenting .tab-panels {
  inset: 0;
  width: 100%;
  max-width: none;
  padding: 0;
  overflow-y: auto;
  scrollbar-gutter: auto;
  transform: none;
  left: 0;
}

body.menu-presenting .tab-panel {
  display: none;
}

body.menu-presenting[data-presenting-tab="menu"] #menuPanel {
  display: block;
  min-height: 100dvh;
}

body.menu-presenting .menu-page {
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
  padding: clamp(58px, 8vw, 70px) clamp(12px, 3vw, 24px) clamp(12px, 3vw, 24px);
  box-shadow: none;
}

body.menu-presenting .menu-border {
  min-height: calc(100dvh - clamp(24px, 6vw, 48px));
}

.menu-border {
  min-height: calc(100dvh - 214px);
  border: 2px solid rgba(198, 95, 58, 0.42);
  padding: clamp(24px, 7vw, 48px);
  background: rgba(255, 248, 235, 0.88);
}

.menu-kicker,
.eyebrow {
  margin-bottom: 10px;
  color: var(--sea);
  font-weight: 950;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}

.menu-border h2,
.recipe-page h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 12vw, 4.8rem);
  font-weight: 500;
  line-height: 0.95;
  text-align: center;
}

.menu-subtitle,
.menu-footer {
  width: min(560px, 100%);
  margin: 18px auto 0;
  color: #4f5e57;
  text-align: center;
  line-height: 1.35;
}

.menu-items {
  display: grid;
  gap: 16px;
  margin: 30px 0;
  padding-left: 0;
  list-style-position: inside;
}

.menu-items > li {
  border-top: 1px solid rgba(99, 122, 66, 0.28);
  padding-top: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 6vw, 1.8rem);
}

.menu-items > li.menu-orderable {
  position: relative;
  border: 1px solid rgba(8, 127, 140, 0.2);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.menu-items > li.menu-orderable:hover,
.menu-items > li.menu-orderable:focus-within {
  border-color: rgba(8, 127, 140, 0.52);
  background: rgba(255, 255, 255, 0.78);
}

.menu-items > li > p {
  margin: 7px 0 0;
  color: #42514b;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.96rem;
  line-height: 1.45;
}

.menu-items > li > .menu-bar-choice {
  border-left: 3px solid var(--sea);
  border-radius: 0 9px 9px 0;
  margin-top: 10px;
  padding: 7px 9px;
  color: #314955;
  background: rgba(8, 127, 140, 0.07);
  font-size: 0.86rem;
}

.menu-bar-choice strong {
  color: var(--sea);
}

.menu-add-order {
  min-height: 34px;
  border-color: rgba(8, 127, 140, 0.24);
  border-radius: 999px;
  margin-top: 12px;
  padding: 0 13px;
  color: var(--sea);
  background: rgba(8, 127, 140, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  box-shadow: none;
}

.menu-order-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.menu-order-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  border-color: rgba(99, 122, 66, 0.25);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--ink);
  background: rgba(244, 201, 93, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
  box-shadow: none;
}

.menu-order-pill span {
  color: var(--muted);
  font-size: 0.7rem;
}

.order-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(8, 127, 140, 0.16);
  border-radius: 13px;
  margin: 18px 0 0;
  padding: 9px 10px;
  background: rgba(8, 127, 140, 0.06);
}

.order-view-toolbar p {
  margin: 0;
  color: #40525d;
  font-size: 0.82rem;
  font-weight: 800;
}

.order-view-toolbar button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.76rem;
}

.menu-items > li.order-summary-card {
  border: 1px solid rgba(8, 127, 140, 0.2);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.66);
  list-style-position: inside;
}

.order-guest-list {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.order-guest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-color: rgba(23, 48, 68, 0.12);
  border-radius: 11px;
  padding: 7px 10px;
  color: var(--ink);
  background: rgba(248, 251, 248, 0.92);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.84rem;
  text-align: left;
  box-shadow: none;
}

.order-guest-row span {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

.order-empty-state {
  list-style: none;
}

.empty-state {
  border: 1px dashed rgba(8, 127, 140, 0.42);
  border-radius: 14px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.48);
}

.menu-items .empty-state {
  list-style: none;
}

.menu-item-notes {
  border-top: 1px solid rgba(99, 122, 66, 0.2);
  margin-top: 13px;
  padding-top: 12px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.35;
}

.order-entry-backdrop {
  z-index: 85;
}

.order-entry-card {
  width: min(100%, 390px);
}

.order-entry-card h2 {
  margin-bottom: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.order-name-field {
  margin-top: 15px;
}

.order-preference-fields {
  display: grid;
  gap: 10px;
  margin-top: 11px;
}

.order-preference-fields:empty {
  display: none;
}

.order-preference-fields small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.order-entry-card .form-error {
  margin-top: 9px;
}

.menu-border .empty-state {
  width: min(800px, 100%);
  margin: 30px auto;
  color: #657282;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 6vw, 2rem);
  line-height: 1.08;
}

.empty-state.compact {
  padding: 13px;
  font-size: 0.92rem;
}

.recipe-page {
  padding: 14px;
}

.recipe-items {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.recipe-card {
  break-inside: avoid;
  border: 1px solid rgba(99, 122, 66, 0.22);
  border-radius: 18px;
  margin-bottom: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.recipe-card h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.recipe-card dl,
.menu-item-notes dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
  margin: 0 0 12px;
}

.recipe-card dt,
.menu-item-notes dt {
  color: var(--terracotta);
  font-weight: 900;
}

.recipe-card dd,
.menu-item-notes dd {
  margin: 0;
}

.recipe-card ol,
.menu-item-notes ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.menu-item-notes > strong {
  display: block;
  margin-top: 12px;
}

.menu-item-notes li {
  border: 0;
  padding: 0;
  font: inherit;
}

.about-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  margin-bottom: 14px;
  padding: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 12%, rgba(244, 201, 93, 0.4), transparent 24%),
    linear-gradient(135deg, var(--sea-dark), var(--sea));
  box-shadow: var(--soft-shadow);
}

.about-hero .eyebrow,
.about-hero p {
  color: rgba(255, 255, 255, 0.84);
  text-align: left;
}

.about-hero h2 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 8vw, 3rem);
  line-height: 0.95;
}

.tab-instruction {
  font-size: 0.88rem;
}

.about-grid {
  display: grid;
  gap: 12px;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.82);
}

.info-card h3 {
  margin: 0 0 6px;
}

.info-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.support-card {
  background: linear-gradient(135deg, rgba(244, 201, 93, 0.22), rgba(255, 255, 255, 0.86));
}

.support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  margin-top: 12px;
  padding: 0 16px;
  color: #fff;
  background: var(--terracotta);
  font-weight: 900;
  text-decoration: none;
}

@media (min-width: 560px) {
  .app-header p {
    display: block;
  }
}

@media (min-width: 760px) {
  .app-header {
    min-height: 84px;
    padding-inline: 18px;
  }

  .tab-panels {
    top: calc(92px + env(safe-area-inset-top));
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: min(calc(100% - 36px), 944px);
  }

  .selection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .selection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.visually-hidden {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.scan-onboarding-card {
  text-align: center;
}

.scan-onboarding-camera {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--sea);
  box-shadow: 0 10px 24px rgba(8, 127, 140, 0.22);
}

.scan-onboarding-camera svg {
  width: 30px;
  height: 30px;
}

.scan-onboarding-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.scan-onboarding-choice input {
  width: 19px;
  height: 19px;
  accent-color: var(--sea);
}

.scan-onboarding-dismiss {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
}

.install-guide-backdrop {
  z-index: 75;
}

.install-guide-card {
  width: min(100%, 390px);
  padding: 22px;
  text-align: center;
}

.install-guide-icon {
  margin: 0 auto 16px;
}

.install-guide-card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.install-guide-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.install-guide-choice input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--sea);
}

@media (max-width: 480px) {
  .panel-heading {
    gap: 8px;
  }
}

.ingredient-chip {
  position: relative;
  display: grid;
  gap: 9px;
  min-width: 0;
}

.ingredient-chip:has(.ingredient-actions) {
  padding-right: 82px;
}

.ingredient-check {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.ingredient-checkbox-control {
  display: grid;
  flex: 0 0 auto;
  cursor: pointer;
}

.ingredient-checkbox-control input {
  margin: 0;
  cursor: pointer;
}

.ingredient-copy {
  min-width: 0;
}

.ingredient-thumbnail {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(8, 127, 140, 0.18);
  border-radius: 11px;
  padding: 0;
  color: var(--sea);
  background: linear-gradient(145deg, rgba(8, 127, 140, 0.11), rgba(244, 201, 93, 0.2));
  font-weight: 950;
  cursor: pointer;
  box-shadow: none;
}

.ingredient-thumbnail:focus-visible {
  outline: 3px solid rgba(8, 127, 140, 0.35);
  outline-offset: 2px;
}

.ingredient-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ingredient-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ingredient-edit-icon,
.ingredient-delete-icon {
  display: inline-grid;
  width: 30px;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  box-shadow: none;
}

.ingredient-edit-icon {
  border-color: rgba(8, 127, 140, 0.22);
  color: var(--sea);
  background: rgba(8, 127, 140, 0.07);
}

.ingredient-delete-icon {
  border-color: rgba(198, 95, 58, 0.25);
  color: var(--terracotta);
  background: rgba(198, 95, 58, 0.07);
}

.ingredient-edit-icon svg,
.ingredient-delete-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chip-action {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--sea);
  background: rgba(8, 127, 140, 0.07);
  font-size: 0.78rem;
  box-shadow: none;
}

.danger-text {
  color: var(--terracotta);
  background: rgba(198, 95, 58, 0.08);
}

.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(244, 201, 93, 0.34), transparent 25%),
    linear-gradient(140deg, #edf7f1 0%, #fff8eb 100%);
}

.scan-header {
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(23, 48, 68, 0.1);
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(23, 48, 68, 0.08);
  backdrop-filter: blur(16px);
}

.scan-header h2 {
  margin: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 5vw, 1.8rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-header .eyebrow {
  margin: 0 0 3px;
  font-size: 0.66rem;
  text-align: left;
}

.scan-back-button,
.scan-close-button {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 10px;
  font-size: 0.84rem;
}

.scan-scroll {
  width: min(100%, 820px);
  min-height: 0;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 14px 26px;
}

.scan-footer {
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid rgba(23, 48, 68, 0.1);
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 -8px 24px rgba(23, 48, 68, 0.08);
  backdrop-filter: blur(16px);
}

.scan-footer .primary,
.scan-primary {
  border-color: var(--sea);
  color: #fff;
  background: var(--sea);
}

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

.scan-card,
.scan-hero,
.photo-card,
.detection-card,
.scan-summary-card {
  border: 1px solid rgba(23, 48, 68, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--soft-shadow);
}

.scan-hero {
  overflow: hidden;
  margin-bottom: 14px;
}

.scan-hero-copy {
  padding: 20px;
}

.scan-hero h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 9vw, 3.6rem);
  line-height: 0.95;
}

.scan-hero p,
.scan-card p,
.scan-summary-card p {
  color: var(--muted);
  line-height: 1.45;
}

.scan-guide-grid {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
}

.guide-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 9px;
  border-radius: 13px;
  padding: 10px;
  color: #314955;
  background: rgba(8, 127, 140, 0.07);
  font-size: 0.92rem;
  line-height: 1.35;
}

.guide-item span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--sea);
  font-weight: 950;
}

.inline-notice {
  border-left: 4px solid var(--sea);
  border-radius: 10px;
  margin: 14px 0 0;
  padding: 11px 12px;
  color: #435365;
  background: rgba(8, 127, 140, 0.07);
  font-size: 0.86rem;
  line-height: 1.4;
}

.scan-privacy-link-row {
  margin: 14px 0 0;
  text-align: center;
}

.scan-intro-options {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
}

.scan-intro-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.scan-intro-choice input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--sea);
}

.scan-privacy-link {
  min-height: 36px;
  border: 0;
  padding: 4px 10px;
  color: var(--sea);
  background: transparent;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.scan-privacy-backdrop {
  z-index: 50;
}

.scan-privacy-card {
  width: min(100%, 390px);
}

.scan-privacy-close {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
}

.capture-screen {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  min-height: 100%;
}

.capture-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.capture-heading h3 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 7vw, 2.2rem);
}

.capture-heading-copy {
  min-width: 0;
}

.capture-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.capture-heading p + p {
  margin-top: 2px;
}

.progress-pill,
.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--sea-dark);
  background: rgba(8, 127, 140, 0.1);
  font-size: 0.8rem;
  font-weight: 900;
}

.capture-stage {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 2px dashed rgba(8, 127, 140, 0.3);
  border-radius: 22px;
  padding: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.62);
}

.camera-button-label {
  margin: 16px 0 0;
}

@media (max-height: 700px) {
  .capture-screen {
    grid-template-rows: auto minmax(210px, 1fr) auto;
  }

  .capture-stage {
    min-height: 210px;
  }
}

.camera-button {
  position: relative;
  width: 88px;
  min-width: 88px;
  height: 88px;
  border: 8px solid #fff;
  border-radius: 999px;
  padding: 0;
  background: var(--sea);
  box-shadow: 0 0 0 3px var(--sea), 0 14px 28px rgba(8, 127, 140, 0.25);
}

.camera-button::after {
  position: absolute;
  inset: 22px;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  content: "";
}

.scan-filmstrip {
  display: grid;
  grid-auto-columns: 104px;
  grid-auto-flow: column;
  gap: 9px;
  overflow-x: auto;
  margin-top: 14px;
  padding: 2px 2px 8px;
}

.filmstrip-item {
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0;
  background: #fff;
}

.filmstrip-item img {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: cover;
}

.filmstrip-item span {
  display: block;
  padding: 6px;
  font-size: 0.72rem;
}

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

.photo-card {
  min-width: 0;
  overflow: hidden;
}

.photo-preview-button {
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #edf1ed;
  box-shadow: none;
}

.photo-preview-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-card-copy {
  padding: 10px;
}

.photo-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 6px;
  margin-bottom: 10px;
}

.photo-status-row strong {
  min-width: 0;
  white-space: nowrap;
}

.photo-quality-pill {
  max-width: 100%;
  padding: 5px 8px;
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

.photo-quality-excellent {
  color: #276642;
  background: rgba(59, 138, 89, 0.14);
}

.photo-quality-good {
  color: var(--sea-dark);
  background: rgba(8, 127, 140, 0.11);
}

.photo-quality-ok {
  color: #765b12;
  background: rgba(244, 201, 93, 0.25);
}

.photo-quality-poor {
  color: #93421f;
  background: rgba(198, 95, 58, 0.13);
}

.photo-quality-unsuitable {
  color: #8e2626;
  background: rgba(186, 52, 52, 0.15);
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.compact-actions button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.75rem;
  box-shadow: none;
}

.analysis-progress {
  display: grid;
  min-height: 58vh;
  place-items: center;
  text-align: center;
}

.analysis-orbit {
  position: relative;
  width: 92px;
  height: 92px;
  border: 6px solid rgba(8, 127, 140, 0.14);
  border-top-color: var(--sea);
  border-radius: 999px;
  margin: 0 auto 22px;
  animation: scan-spin 1.2s linear infinite;
}

.analysis-progress h3 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.analysis-progress p {
  color: var(--muted);
}

@keyframes scan-spin {
  to { transform: rotate(360deg); }
}

.result-section {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.result-review-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  gap: 12px;
  margin: -18px -14px 18px;
  border-bottom: 1px solid rgba(23, 48, 68, 0.12);
  padding: 14px;
  background: rgba(249, 250, 241, 0.96);
  box-shadow: 0 10px 20px rgba(23, 48, 68, 0.08);
  backdrop-filter: blur(16px);
}

.result-review-heading h3 {
  margin: 0 0 3px;
  font-size: 1.35rem;
}

.result-review-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

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

.review-total {
  display: grid;
  gap: 1px;
  min-width: 0;
  min-height: 48px;
  border: 1px solid rgba(23, 48, 68, 0.1);
  border-radius: 12px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
  box-shadow: none;
}

.review-total[aria-selected="true"] {
  border-color: rgba(8, 127, 140, 0.5);
  background: rgba(8, 127, 140, 0.1);
  box-shadow: inset 0 0 0 1px rgba(8, 127, 140, 0.08);
}

.review-total:focus-visible {
  outline: 3px solid rgba(8, 127, 140, 0.35);
  outline-offset: 2px;
}

.review-total strong {
  font-size: 1.05rem;
  line-height: 1;
}

.review-total small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
}

.review-total.accepted strong {
  color: var(--sea);
}

.review-total.rejected strong {
  color: var(--terracotta);
}

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

.result-section-heading h3 {
  margin: 0;
  font-size: 1.15rem;
}

.result-section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.result-section-empty {
  border: 1px dashed rgba(23, 48, 68, 0.16);
  border-radius: 14px;
  margin: 0;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
  font-size: 0.84rem;
}

.detection-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.detection-card.rejected {
  opacity: 0.68;
}

.detection-card.accepted {
  border-color: rgba(8, 127, 140, 0.28);
}

.detection-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
}

.detection-thumb {
  display: grid;
  width: 64px;
  height: 78px;
  border: 0;
  overflow: hidden;
  place-items: center;
  border-radius: 12px;
  padding: 0;
  color: var(--sea);
  background: linear-gradient(145deg, rgba(8, 127, 140, 0.12), rgba(244, 201, 93, 0.22));
  font-size: 1.5rem;
  font-weight: 950;
  box-shadow: none;
}

button.detection-thumb {
  cursor: zoom-in;
}

button.detection-thumb:focus-visible {
  outline: 3px solid rgba(8, 127, 140, 0.4);
  outline-offset: 3px;
}

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

.detection-copy {
  min-width: 0;
  padding-top: 1px;
}

.detection-copy > .status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 5px;
}

.detection-copy h4 {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  line-height: 1.08;
}

.detection-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.detection-copy .chip-action {
  display: inline-flex;
  align-items: center;
  margin: 6px 6px 0 0;
}

.detection-fields {
  display: grid;
  gap: 8px;
}

.detection-fields label,
.modal-field {
  display: grid;
  gap: 5px;
  color: #435365;
  font-size: 0.82rem;
  font-weight: 850;
}

.detection-fields select,
.detection-fields input,
.modal-field input,
.modal-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

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

.decision-row button {
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.9rem;
}

.decision-row button[aria-pressed="true"] {
  border-color: var(--sea);
  color: #fff;
  background: var(--sea);
}

.decision-row .reject[aria-pressed="true"] {
  border-color: var(--terracotta);
  background: var(--terracotta);
}

.custom-ingredient-form {
  display: grid;
  gap: 8px;
  border-radius: 13px;
  padding: 10px;
  background: rgba(8, 127, 140, 0.07);
}

.custom-save-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.custom-save-row button {
  min-height: 38px;
}

.recipe-mapping-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}

.recipe-mapping-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.recipe-mapping-summary strong {
  grid-column: 1;
  color: var(--ink);
  font-size: 0.9rem;
}

.recipe-mapping-summary .chip-action {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.recipe-use-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.scan-summary-card {
  padding: 18px;
}

.scan-summary-card h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.success-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 999px;
  margin: 0 auto 18px;
  color: #fff;
  background: var(--sea);
  font-size: 2rem;
  font-weight: 950;
}

.scan-error {
  border-left: 5px solid var(--terracotta);
  padding: 18px;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(13, 26, 36, 0.96);
}

.photo-viewer header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  color: #fff;
}

.photo-viewer header > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-viewer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.photo-viewer-actions button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.photo-viewer-stage {
  display: grid;
  min-height: 0;
  padding: 12px;
  place-items: center;
}

.photo-viewer img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.app-toast {
  position: fixed;
  right: 14px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 80;
  width: fit-content;
  max-width: min(440px, calc(100% - 28px));
  border-radius: 999px;
  margin: auto;
  padding: 12px 18px;
  color: #fff;
  background: rgba(23, 48, 68, 0.94);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.ingredient-editor-card {
  display: grid;
  gap: 14px;
}

.form-error {
  margin: 0;
  color: var(--terracotta);
  font-size: 0.84rem;
  font-weight: 800;
}

@media (min-width: 680px) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scan-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detection-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  }

  .detection-main {
    align-self: start;
  }
}

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