:root {
  --bg-app: #0b0e14;
  --bg-surface: #121721;
  --bg-elevated: #19202e;
  --bg-hover: #212a3b;
  --bg-input: #0d1119;
  --border-subtle: #253042;
  --border-strong: #37465e;

  --text-primary: #f4f6f9;
  --text-secondary: #9ca9bc;
  --text-muted: #6c7a8e;

  --accent-copper: #e57c3c;
  --accent-copper-hover: #f28c4e;
  --accent-copper-soft: rgba(229, 124, 60, 0.14);

  --emerald: #22c55e;
  --emerald-soft: rgba(34, 197, 94, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --crimson: #ef4444;
  --crimson-soft: rgba(239, 68, 68, 0.15);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.14);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

/* =========================================================================
   HEADER, NAVIGATION & GLOBAL KPI BAR
   ========================================================================= */
.app-header {
  background: rgba(18, 23, 33, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #e57c3c, #c25115);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(229, 124, 60, 0.3);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.restaurant-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: #ff9d63;
  background: var(--accent-copper-soft);
  border: 1px solid rgba(229, 124, 60, 0.35);
  padding: 2px 10px;
  border-radius: 999px;
  max-width: 100%;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.header-actions .btn {
  padding: 6px 10px;
  font-size: 12px;
}

/* Navigation & KPI Bar */
.nav-kpi-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.nav-tab {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-tab.active {
  background: var(--accent-copper-soft);
  border-color: rgba(229, 124, 60, 0.45);
  color: #ff9d63;
}

.tab-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tab-badge.alert {
  background: var(--crimson-soft);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.kpi-mini {
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  border-left: 2px solid var(--border-subtle);
}

.kpi-mini-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-mini-val {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Mobile Bottom Tab Bar (Shown on phones & compact tablets <= 820px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 23, 33, 0.98);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-strong);
  z-index: 90;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.mobile-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.mobile-nav-btn.active {
  color: #ff9d63;
  background: var(--accent-copper-soft);
}

.mobile-nav-icon {
  font-size: 17px;
  line-height: 1;
}

/* =========================================================================
   BUTTONS & BADGES (CLEAN, NON-OVERFLOWING PILL BOXES)
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.3;
  max-width: 100%;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--accent-copper);
  border-color: var(--accent-copper);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-copper-hover);
  border-color: var(--accent-copper-hover);
}

.btn-success {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Pill Badges — Clean, never clipped or spilling out of cards */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  line-height: 1.25;
  max-width: 100%;
  white-space: nowrap;
  text-align: left;
}

.badge-nowrap {
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-ok {
  background: var(--emerald-soft);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.badge-warn {
  background: var(--amber-soft);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-danger,
.badge-bad {
  background: var(--crimson-soft);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.38);
}

.badge-info {
  background: var(--sky-soft);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.badge-purple {
  background: var(--purple-soft);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.32);
}

/* =========================================================================
   MAIN WORKSPACE & RESPONSIVE LAYOUT GRIDS
   ========================================================================= */
.workspace {
  flex: 1;
  padding: 20px 24px 64px;
  width: 100%;
}

.split-grid {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.invoice-impact-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
}

/* Mobile/Tablet Horizontal Quick Dish Switcher */
.mobile-dish-switcher {
  display: none;
  margin-bottom: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.mobile-dish-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.mobile-dish-chip {
  flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 155px;
  text-align: left;
}

.mobile-dish-chip.active {
  border-color: var(--accent-copper);
  background: var(--accent-copper-soft);
}

/* Panels */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 0;
}

.panel-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-header > div:first-child {
  flex: 1;
  min-width: 220px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.panel-body {
  padding: 18px;
}

/* Form Controls */
.input,
.select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  width: 100%;
  transition: border-color 0.15s ease;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent-copper);
}

.input-mono {
  font-family: var(--font-mono);
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.filter-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-pill.active {
  background: var(--accent-copper-soft);
  color: #ff9d63;
  border-color: rgba(229, 124, 60, 0.45);
}

/* =========================================================================
   LEFT SIDEBAR MENU LIST
   ========================================================================= */
.dish-list {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
}

.dish-card {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dish-card:hover {
  background: var(--bg-elevated);
}

.dish-card.active {
  background: rgba(229, 124, 60, 0.1);
  border-left: 3px solid var(--accent-copper);
}

.dish-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dish-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.3;
}

.dish-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.dish-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}

.fc-progress-track {
  height: 5px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
}

.fc-progress-fill {
  height: 100%;
  border-radius: 99px;
}

/* =========================================================================
   PLAIN-ENGLISH CHEF PROFIT COACH BANNER (CLEAN & ZERO OVERFLOW)
   ========================================================================= */
.profit-coach-banner {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: center;
}

.profit-coach-banner.healthy {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(25, 32, 46, 0.9));
  border: 1px solid rgba(34, 197, 94, 0.38);
}

.profit-coach-banner.watch {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.13), rgba(25, 32, 46, 0.9));
  border: 1px solid rgba(245, 158, 11, 0.42);
}

.profit-coach-banner.action_needed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(25, 32, 46, 0.92));
  border: 1px solid rgba(239, 68, 68, 0.48);
}

.coach-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.coach-light {
  width: 42px;
  height: 42px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.coach-driver-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(11, 14, 20, 0.55);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.coach-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.coach-action-card {
  width: 100%;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
  color: var(--text-primary);
}

.coach-action-card:hover {
  border-color: var(--accent-copper);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.coach-action-card.primary-fix {
  background: rgba(229, 124, 60, 0.16);
  border-color: var(--accent-copper);
}

.coach-action-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.coach-action-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.coach-action-gain {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 3px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

/* =========================================================================
   VISUAL "WHERE EVERY DOLLAR GOES" BAR
   ========================================================================= */
.dollar-split-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.dollar-bar-track {
  height: 30px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  width: 100%;
  margin: 10px 0 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.dollar-bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  padding: 0 6px;
  transition: width 0.25s ease;
}

/* =========================================================================
   VISUAL PLATE CANVAS & VISUAL PANTRY SHELF
   ========================================================================= */
.visual-plate-section {
  margin-bottom: 22px;
}

.visual-plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.plate-ing-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  transition: all 0.16s ease;
  cursor: pointer;
  min-width: 0;
}

.plate-ing-card:hover {
  border-color: var(--accent-copper);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

.plate-ing-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

svg[viewBox="0 0 80 80"] {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  flex-shrink: 0;
}

.ing-illus-wrap {
  width: 74px;
  height: 74px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, #1e293b 0%, #0f172a 78%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.ing-illus-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.ing-illus-wrap svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  transition: transform 0.18s ease;
}

.plate-ing-card:hover .ing-illus-wrap svg,
.shelf-item-card:hover .ing-illus-wrap svg {
  transform: scale(1.07);
}

.ing-illus-wrap svg:has(> image[data-studio-photo]) > rect:first-of-type,
#studioLiveSvgPreview svg:has(> image[data-studio-photo]) > rect:first-of-type,
#studioGalleryPreviewBox svg:has(> image[data-studio-photo]) > rect:first-of-type {
  stroke: transparent;
  stroke-width: 0;
}

#dishHeroIllusTrigger svg[viewBox="0 0 80 80"] > image[data-studio-photo],
.visual-menu-dish-card .ing-illus-wrap svg[viewBox="0 0 80 80"] > image[data-studio-photo],
.spec-hero-photo-frame svg[viewBox="0 0 80 80"] > image[data-studio-photo],
#studioLiveSvgPreview svg[viewBox="0 0 80 80"] > image[data-studio-photo],
#studioGalleryPreviewBox:not(.loupe-active) svg[viewBox="0 0 80 80"] > image[data-studio-photo] {
  x: 0px;
  y: 0px;
  width: 80px;
  height: 80px;
  clip-path: inset(0px round 16px) !important;
}

#dishHeroIllusTrigger svg[viewBox="0 0 64 64"] > image[data-studio-photo],
.visual-menu-dish-card .ing-illus-wrap svg[viewBox="0 0 64 64"] > image[data-studio-photo],
.spec-hero-photo-frame svg[viewBox="0 0 64 64"] > image[data-studio-photo],
#studioLiveSvgPreview svg[viewBox="0 0 64 64"] > image[data-studio-photo] {
  x: 0px;
  y: 0px;
  width: 64px;
  height: 64px;
  clip-path: inset(0px round 14px) !important;
}

.customer-quote-line-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 48px;
}

.ing-illus-wrap img.ing-studio-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease;
}

.plate-ing-card:hover .ing-illus-wrap img.ing-studio-photo,
.shelf-item-card:hover .ing-illus-wrap img.ing-studio-photo {
  transform: scale(1.08);
}

.dish-studio-thumb {
  width: 54px;
  height: 54px;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  background: #121721;
}

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

.plate-ing-info {
  flex: 1;
  min-width: 0;
}

.plate-ing-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.plate-ing-portion-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #ff9d63;
  background: var(--accent-copper-soft);
  border: 1px solid rgba(229, 124, 60, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
}

.plate-ing-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 9px;
  flex-wrap: wrap;
}

.plate-ing-cost {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Visual Pantry Shelf */
.visual-shelf-box {
  background: rgba(18, 23, 33, 0.95);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.visual-shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
  max-height: 390px;
  overflow-y: auto;
  padding-right: 4px;
}

.shelf-item-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  min-width: 0;
}

.shelf-card-top-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 20px;
}

.shelf-card-audit-pill {
  font-size: 9.5px;
  font-weight: 700;
  color: #34d399;
  white-space: nowrap;
  flex-shrink: 0;
}

.shelf-item-card:hover {
  border-color: var(--accent-copper);
  background: rgba(229, 124, 60, 0.12);
  transform: translateY(-2px);
}

.shelf-item-card.on-plate {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.07);
}

.shelf-on-plate-dot {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  padding: 1px 6px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.shelf-item-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shelf-item-price-hint {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* =========================================================================
   INVOICE DROPZONE & SUPPLIER DELIVERY PRESET CARDS (CLEAN MULTI-CHIP DESIGN)
   ========================================================================= */
.dropzone-box {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(25, 32, 46, 0.55);
  padding: 26px 20px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dropzone-box:hover,
.dropzone-box.dragover {
  border-color: var(--accent-copper);
  background: rgba(229, 124, 60, 0.08);
}

.preset-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.preset-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.preset-card:hover {
  border-color: var(--accent-copper);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.preset-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-highlight-box {
  font-size: 11.5px;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  line-height: 1.35;
}

/* Pricing & Target Food Cost Simulator Box */
.pricing-sim-bar {
  background: linear-gradient(90deg, rgba(229, 124, 60, 0.09), rgba(56, 189, 248, 0.06));
  border: 1px solid rgba(229, 124, 60, 0.3);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.sim-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.sim-slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  flex: 1;
}

.sim-slider-group input[type='range'] {
  accent-color: var(--accent-copper);
  cursor: pointer;
  width: 100%;
}

/* Segmented Control */
.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.segment-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.segment-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.num-col {
  text-align: right;
  font-family: var(--font-mono);
}

.share-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.share-bar-bg {
  width: 60px;
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
}

.share-bar-fill {
  height: 100%;
  background: var(--accent-copper);
  border-radius: 99px;
}

/* Portion Picker Modal */
.portion-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.portion-preset-btn {
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.portion-preset-btn:hover,
.portion-preset-btn.selected {
  border-color: var(--accent-copper);
  background: var(--accent-copper-soft);
  transform: translateY(-1px);
}

.portion-preset-icon {
  font-size: 22px;
}

.portion-preset-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

.portion-preset-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.portion-preset-cost {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--emerald);
}

/* Supplier Negotiation Script Box */
.negotiation-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Sub-recipe cards grid */
.subrecipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
  gap: 18px;
}

.subrecipe-grid .data-table th,
.subrecipe-grid .data-table td {
  padding: 7px 8px;
  font-size: 12px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 16px;
}

.modal-card,
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.modal-header > div:first-child {
  flex: 1 1 220px;
  min-width: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 32px);
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--accent-copper);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
}

/* =========================================================================
   ZERO-EFFORT / 1-CLICK AUTOMATION COMPONENTS
   ========================================================================= */
.magic-builder-bar {
  background: linear-gradient(135deg, rgba(229, 124, 60, 0.14), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(229, 124, 60, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.magic-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.magic-input-row .input {
  flex: 1;
  min-width: 190px;
}

.template-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.template-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
  color: var(--text-primary);
}

.template-card:hover {
  border-color: var(--accent-copper);
  background: var(--accent-copper-soft);
  transform: translateY(-2px);
}

.template-card-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.template-card-sub {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  flex: 1;
}

.quick-preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.quick-preset-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
  line-height: 1.2;
}

.quick-preset-btn > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 1px;
  flex-shrink: 0;
}

.quick-preset-btn svg,
.dish-card svg,
.mobile-dish-pill svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.quick-preset-btn:hover,
.quick-preset-btn.active {
  border-color: var(--accent-copper);
  background: var(--accent-copper-soft);
  color: #ff9d63;
}

.bulk-rescue-banner {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.16), rgba(229, 124, 60, 0.14));
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.express-toggle-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.express-toggle-bar.active {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS: TABLET (<= 1080px) & PHONE (<= 768px)
   ========================================================================= */
@media (max-width: 1080px) {
  .split-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .split-grid > * {
    min-width: 0;
    max-width: 100%;
  }

  .desktop-dish-sidebar {
    display: none;
  }

  .mobile-dish-switcher {
    display: block;
  }

  .profit-coach-banner {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .kpi-strip {
    grid-template-columns: repeat(2, auto);
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 820px) {
  .app-header {
    padding: 10px 14px;
    position: relative;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 2px;
    gap: 6px;
  }

  .header-actions .btn {
    flex-shrink: 0;
  }

  .kpi-strip {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 10px;
  }

  .kpi-mini {
    flex-shrink: 0;
  }

  .nav-tabs {
    display: none;
  }

  .mobile-bottom-nav {
    display: grid;
  }

  .workspace {
    padding: 14px 12px 92px;
  }

  .panel-header,
  .panel-body {
    padding: 14px;
  }

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

  .visual-plate-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  }

  .visual-shelf-grid {
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  }

  .toast-container {
    bottom: 76px;
    right: 16px;
    left: 16px;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 16px;
  }

  .brand-subtitle {
    display: none;
  }

  .kpi-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kpi-mini {
    padding-left: 10px;
  }

  .kpi-mini-val {
    font-size: 13px;
  }

  .visual-plate-grid {
    grid-template-columns: 1fr;
  }

  .sim-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
}

/* =========================================================================
   GUIDED INTERACTIVE DEMO TOUR, SIMPLE KITCHEN MODE & 1-TAP WASTE LOG
   ========================================================================= */
.btn-header-guided-tour {
  border-color: rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(229, 124, 60, 0.14));
  color: #7dd3fc;
  font-weight: 700;
}

.btn-header-guided-tour:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.24);
}

.btn-header-simple-toggle {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  font-weight: 700;
}

.btn-header-simple-toggle.active-simple {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.mode-sub-pill {
  background: #22c55e;
  color: #052e16;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
}

.btn-header-waste {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-weight: 700;
}

.btn-header-waste:hover {
  border-color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}

.waste-header-pill {
  background: rgba(239, 68, 68, 0.28);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fecaca;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
}

/* Simple Kitchen Mode Top Helper Strip */
.simple-helper-strip {
  margin: 14px 28px 0;
  padding: 12px 20px;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.14), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.simple-helper-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

.simple-helper-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.simple-helper-title {
  font-size: 13px;
  font-weight: 800;
  color: #86efac;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.simple-helper-sentence {
  font-size: 13px;
  color: var(--text-primary);
  margin-top: 2px;
  line-height: 1.4;
}

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

/* In Simple Kitchen Mode, simplify secondary pro-accounting controls */
body.simple-kitchen-mode #btnOpenConverter,
body.simple-kitchen-mode #btnAiSettings,
body.simple-kitchen-mode #btnEditDishRecipe,
body.simple-kitchen-mode #btnModeAtomic,
body.simple-kitchen-mode #btnModeSpec {
  display: none !important;
}

/* Interactive 60-Second Guided Tour Dock */
.guided-tour-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  width: min(940px, calc(100vw - 24px));
  pointer-events: none;
}

.guided-tour-card {
  pointer-events: auto;
  background: rgba(15, 20, 29, 0.97);
  border: 2px solid #38bdf8;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.78), 0 0 0 4px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guided-tour-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.guided-tour-step-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tour-step-pill {
  width: 26px;
  height: 26px;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tour-step-pill.active {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #082f49;
  transform: scale(1.08);
}

.tour-step-pill.done {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

.guided-tour-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #7dd3fc;
  margin-left: 6px;
}

.guided-tour-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.guided-tour-info {
  flex: 1;
  min-width: 260px;
}

.guided-tour-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.guided-tour-num-circle {
  width: 22px;
  height: 22px;
  border-radius: 99px;
  background: var(--accent-copper);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guided-tour-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.45;
}

.guided-tour-desc code {
  background: rgba(229, 124, 60, 0.16);
  color: #ff9d63;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.guided-tour-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.btn-tour-try {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
  font-weight: 700;
  font-size: 12px;
}

.btn-tour-try:hover {
  background: rgba(56, 189, 248, 0.26);
  border-color: #38bdf8;
}

.guided-tour-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes tourPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.75);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(56, 189, 248, 0.18);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  }
}

.tour-spotlight-pulse {
  animation: tourPulseGlow 1.2s ease-in-out 2;
  outline: 2px solid #38bdf8 !important;
  outline-offset: 3px;
}

/* 1-Tap Kitchen Waste Modal Styles */
.waste-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.waste-kpi-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.waste-kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.waste-kpi-val {
  font-size: 19px;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-top: 3px;
}

.waste-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.waste-preset-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-primary);
}

.waste-preset-card:hover {
  border-color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  transform: translateY(-2px);
}

.waste-preset-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.waste-preset-info {
  flex: 1;
  min-width: 0;
}

.waste-preset-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.waste-preset-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.waste-preset-tap-pill {
  font-size: 11px;
  font-weight: 800;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 3px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .guided-tour-dock {
    bottom: 74px;
  }

  .guided-tour-controls {
    width: 100%;
    align-items: stretch;
  }

  .guided-tour-nav-btns {
    justify-content: space-between;
  }
}

/* =========================================================================
   1-TAP VOICE CHEF DICTATION & ANIMATED WAVEFORM MODAL
   ========================================================================= */
.btn-header-voice-chef {
  border-color: rgba(229, 124, 60, 0.55);
  background: rgba(229, 124, 60, 0.14);
  color: #ffb085;
  font-weight: 700;
}

.btn-header-voice-chef:hover {
  border-color: var(--accent-copper);
  background: rgba(229, 124, 60, 0.24);
}

.voice-waveform-container {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.75));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

.voice-waveform-container.is-speaking {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.voice-waveform-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 220px;
}

.voice-mic-circle {
  width: 48px;
  height: 48px;
  border-radius: 99px;
  border: 2px solid rgba(229, 124, 60, 0.65);
  background: rgba(229, 124, 60, 0.18);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.voice-mic-circle:hover {
  transform: scale(1.06);
  background: rgba(229, 124, 60, 0.3);
}

.voice-status-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.voice-status-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.voice-equalizer {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
}

.eq-bar {
  width: 4px;
  height: 10px;
  border-radius: 99px;
  background: #38bdf8;
  transition: height 0.15s ease;
}

@keyframes voiceWaveBounce {
  0%,
  100% {
    height: 8px;
    background: #38bdf8;
  }
  50% {
    height: 26px;
    background: #4ade80;
  }
}

.voice-waveform-container.is-speaking .eq-bar {
  animation: voiceWaveBounce 0.45s ease-in-out infinite;
}

.voice-waveform-container.is-speaking .eq-bar:nth-child(2) {
  animation-delay: 0.08s;
}
.voice-waveform-container.is-speaking .eq-bar:nth-child(3) {
  animation-delay: 0.16s;
}
.voice-waveform-container.is-speaking .eq-bar:nth-child(4) {
  animation-delay: 0.24s;
}
.voice-waveform-container.is-speaking .eq-bar:nth-child(5) {
  animation-delay: 0.12s;
}
.voice-waveform-container.is-speaking .eq-bar:nth-child(6) {
  animation-delay: 0.2s;
}

.voice-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.voice-demo-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.voice-demo-btn:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-2px);
}

.voice-demo-title {
  font-size: 13px;
  font-weight: 700;
  color: #7dd3fc;
}

.voice-demo-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

/* =========================================================================
   PILLARS 2, 4 & 5: WORKSPACE SWITCHER, CORE-4 MODE, 3-MIN QUICKSTART & SIDE-BY-SIDE INVOICE REVIEW
   ========================================================================= */
.workspace-switcher-select {
  background: rgba(15, 23, 42, 0.92);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  max-width: 240px;
}

.workspace-switcher-select:hover,
.workspace-switcher-select:focus {
  outline: none;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.core4-mode-pill {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.core4-mode-pill:hover {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.22);
}

.core4-mode-pill.advanced-active {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.5);
}

.chef-quickstart-bar {
  background: linear-gradient(90deg, rgba(18, 23, 33, 0.98), rgba(25, 32, 46, 0.95));
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 24px;
  width: 100%;
}

.quickstart-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quickstart-brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.quickstart-timer-pill {
  background: var(--accent-copper-soft);
  color: #ff9d63;
  border: 1px solid rgba(229, 124, 60, 0.4);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.quickstart-steps-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chef-quickstart-bar.collapsed .quickstart-steps-inline {
  display: none;
}

.quickstart-step-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.quickstart-step-pill:hover {
  border-color: var(--accent-copper);
  background: var(--bg-hover);
}

.quickstart-step-pill.done {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.09);
}

.qs-check {
  color: #4ade80;
  font-weight: 800;
  font-family: var(--font-mono);
}

.qs-arrow {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.quickstart-core4-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.core4-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.core4-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.core4-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.core4-pill.active {
  background: var(--accent-copper-soft);
  color: #ff9d63;
  border-color: rgba(229, 124, 60, 0.5);
}

.quickstart-collapse-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.quickstart-collapse-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* Side-by-Side Invoice Review Panel */
.side-by-side-invoice-review {
  background: var(--bg-surface);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-by-side-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.side-by-side-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

.side-by-side-col {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.side-by-side-col-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.raw-invoice-line-card,
.parsed-invoice-line-card {
  background: rgba(11, 14, 20, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.raw-invoice-line-card {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #cbd5e1;
}

.parsed-invoice-line-card.spike-flagged {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.parsed-invoice-line-card.clean-approved {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
}

.parsed-invoice-line-card.skipped-non-food {
  opacity: 0.56;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
}

.sbs-inline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
}

.sbs-include-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.sbs-include-checkbox {
  width: 15px;
  height: 15px;
  accent-color: #22c55e;
  cursor: pointer;
}

.sbs-qty-input {
  width: 68px;
  padding: 4px 6px;
  font-size: 11.5px;
}

.sbs-pack-input {
  width: 108px;
  padding: 4px 6px;
  font-size: 11.5px;
}

.sbs-price-input {
  width: 86px;
  padding: 4px 6px;
  font-size: 11.5px;
}

.sbs-pantry-select {
  min-width: 175px;
  max-width: 240px;
  padding: 4px 8px;
  font-size: 11.5px;
}

.sbs-ocr-warning-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(18, 23, 33, 0.96));
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.shelf-to-sheet-zone-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.sbs-duplicate-invoice-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(18, 23, 33, 0.96));
  border: 1.5px solid rgba(239, 68, 68, 0.65);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fecaca;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.fifo-date-dot-sticker {
  background: #ffffff;
  color: #0f172a;
  border: 4px solid #ef4444;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-palette-item {
  width: 100%;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.14s ease;
  color: var(--text-primary);
}

.search-palette-item:hover {
  border-color: var(--accent-copper);
  background: var(--bg-hover);
}

.advanced-audits-drawer {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(18, 23, 33, 0.95));
  border: 1px solid rgba(168, 85, 247, 0.42);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
}

/* New Restaurant Quickstart Empty-State Card */
.new-restaurant-quickstart-card {
  background: linear-gradient(135deg, rgba(18, 23, 33, 0.98), rgba(28, 36, 52, 0.94));
  border: 1.5px solid rgba(229, 124, 60, 0.48);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.quickstart-empty-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.quickstart-empty-action-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.quickstart-empty-action-btn:hover {
  border-color: var(--accent-copper);
  background: rgba(229, 124, 60, 0.14);
  transform: translateY(-1px);
}

/* =========================================================================
   PILLAR 2: LAMINATED LINE SPEC CARD & @MEDIA PRINT STYLESHEET
   ========================================================================= */
#lineSpecPrintModal.hide-costs .spec-sensitive-cost {
  display: none !important;
}

.laminated-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.laminated-spec-tile {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Progressive Disclosure Drawer for Deep Culinary & HACCP Telemetry */
.deep-telemetry-drawer {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.deep-telemetry-drawer[open] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
}

.deep-telemetry-drawer > summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  list-style: none;
  max-width: 100%;
  box-sizing: border-box;
  transition: all 0.14s ease;
}

.deep-telemetry-drawer > summary::-webkit-details-marker {
  display: none;
}

.deep-telemetry-drawer > summary:hover {
  border-color: var(--accent-copper);
  background: rgba(229, 124, 60, 0.16);
  color: #ffffff;
}

.deep-telemetry-drawer-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.deep-telemetry-drawer-body .hero-telemetry-pill {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
  box-sizing: border-box;
}

@media print {
  .deep-telemetry-drawer:not([open]) {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .app-header,
  .chef-quickstart-bar,
  .mobile-bottom-nav,
  .toast-container,
  .no-print,
  #plateGuidedTourOverlay {
    display: none !important;
  }

  /* When a modal (such as #lineSpecPrintModal, Prep Station Card, or Shelf-to-Sheet) is open, print only the modal cleanly */
  body:has(#modalContainer .modal-backdrop) .workspace-container {
    display: none !important;
  }

  #modalContainer .modal-backdrop {
    position: static !important;
    inset: auto !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    display: block !important;
  }

  #modalContainer .modal-card,
  #modalContainer .modal-box {
    max-width: 100% !important;
    max-height: none !important;
    width: 100% !important;
    border: 2px solid #0f172a !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border-radius: 8px !important;
  }

  #modalContainer .panel-body,
  #modalContainer .modal-body {
    overflow: visible !important;
    max-height: none !important;
    color: #0f172a !important;
  }

  .laminated-spec-tile,
  .line-spec-thermal-strip,
  .visual-menu-dish-card {
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    break-inside: avoid;
  }

  .ing-illus-wrap,
  .ing-illus-wrap svg,
  .ing-illus-wrap svg image {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* =========================================================================
   DAY 1 UX POLISH: STREAMLINED HEADER, MORE TOOLS POPOVER & CORE WORKFLOW NAV
   ========================================================================= */
.btn-header-search {
  border-color: rgba(56, 189, 248, 0.42);
  color: #7dd3fc;
  font-weight: 700;
}

.btn-header-primary-cta {
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(229, 124, 60, 0.28);
}

.more-tools-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-more-tools {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 700;
}

.more-tools-dropdown.is-open .btn-more-tools {
  border-color: rgba(229, 124, 60, 0.65);
  background: var(--accent-copper-soft);
  color: #ff9d63;
}

.more-tools-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  max-width: calc(100vw - 24px);
  background: rgba(17, 22, 32, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
  padding: 10px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.more-tools-popover[hidden] {
  display: none !important;
}

.more-tools-section-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 2px 8px 4px;
}

.more-tools-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.more-tools-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 4px;
}

.more-tools-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  white-space: normal;
}

.more-tools-item:hover {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.more-tools-item-accent {
  color: #34d399;
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(16, 185, 129, 0.28);
}

.more-tools-item-accent:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
}

.more-tools-item.core4-mode-pill {
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12.5px;
  justify-content: flex-start;
}

.more-tools-item.active-simple {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.more-tools-item-danger {
  color: #fca5a5;
}

.more-tools-item-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

/* Core Workflow Progression Tabs */
.nav-tabs {
  gap: 6px;
}

.nav-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.nav-tab.active .nav-step-num {
  background: rgba(229, 124, 60, 0.28);
  color: #ffb88c;
}

.nav-flow-arrow {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  user-select: none;
}

.nav-flow-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  margin: 0 4px;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .more-tools-popover {
    left: 0;
    right: auto;
  }
}

/* =========================================================================
   DAY 2 UX POLISH: 3-STEP DROP SUPPLIER INVOICE FLOW & HANDOFF CALLOUT
   ========================================================================= */
.inv-stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.inv-step-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle);
  min-width: 0;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.inv-step-pill.is-active {
  border-color: rgba(229, 124, 60, 0.65);
  background: rgba(229, 124, 60, 0.12);
}

.inv-step-pill.is-done {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.inv-step-circle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.inv-step-pill.is-active .inv-step-circle {
  background: var(--accent-copper);
  color: #fff;
}

.inv-step-pill.is-done .inv-step-circle {
  background: #10b981;
  color: #052e16;
}

.inv-step-text {
  min-width: 0;
  flex: 1;
}

.inv-step-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.inv-step-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.inv-step-connector {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  user-select: none;
}

.inv-callout-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
}

.inv-callout-banner.inv-callout-warn {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(229, 124, 60, 0.08));
}

.inv-callout-banner.inv-callout-ok {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.55));
}

.inv-callout-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 240px;
}

.inv-callout-eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.inv-callout-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.inv-callout-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

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

.inv-callout-btn-margins {
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  font-weight: 700;
}

.inv-more-tools-drawer {
  position: relative;
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.inv-more-tools-drawer[open] {
  flex: 1 1 100%;
  width: 100%;
}

.inv-more-tools-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.inv-more-tools-summary::-webkit-details-marker {
  display: none;
}

.inv-more-tools-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(15, 23, 42, 0.94);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.inv-more-tools-tray .btn,
.pantry-advanced-tools-tray .btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  box-sizing: border-box;
}

.inv-catch-weight-pill {
  white-space: nowrap;
}

@media (max-width: 960px) {
  .inv-stepper {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .inv-step-connector {
    display: none;
  }
}

/* =========================================================================
   DAY 3 UX POLISH: PANTRY INLINE EDITING & PRICE SPIKES MORNING TRIAGE
   ========================================================================= */
.pantry-advanced-tools-drawer {
  position: relative;
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.pantry-advanced-tools-drawer[open] {
  flex: 1 1 100%;
  width: 100%;
}

.pantry-advanced-tools-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.pantry-advanced-tools-summary::-webkit-details-marker {
  display: none;
}

.pantry-advanced-tools-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(15, 23, 42, 0.96);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.th-sublabel {
  display: block;
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  margin-top: 2px;
}

.pantry-inline-edit-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.pantry-inline-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.72);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pantry-inline-input-wrap:focus-within {
  border-color: var(--accent-copper);
  box-shadow: 0 0 0 2px rgba(229, 124, 60, 0.18);
}

.pantry-inline-prefix,
.pantry-inline-suffix {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
}

.pantry-inline-price-input,
.pantry-inline-yield-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  outline: none;
  padding: 2px 0;
  -moz-appearance: textfield;
}

.pantry-inline-price-input {
  width: 66px;
}

.pantry-inline-yield-input {
  width: 44px;
}

.pantry-inline-price-input::-webkit-outer-spin-button,
.pantry-inline-price-input::-webkit-inner-spin-button,
.pantry-inline-yield-input::-webkit-outer-spin-button,
.pantry-inline-yield-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.spike-empty-state {
  padding: 26px 20px;
  text-align: center;
  background: rgba(16, 185, 129, 0.05);
}

.spike-triage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
}

.spike-triage-card {
  border: 1px solid var(--border-subtle);
  border-left: 4px solid #f87171;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.62);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spike-triage-card.is-spike-down {
  border-left-color: #34d399;
}

.spike-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.spike-card-ident {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

.spike-card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.spike-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.spike-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}

.spike-cause-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.spike-cause-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.spike-erosion-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.spike-price-callout {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.spike-price-shift {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.spike-price-old {
  color: var(--text-muted);
  text-decoration: line-through;
}

.spike-price-arrow {
  color: var(--text-muted);
}

.spike-price-new {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.spike-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.spike-section-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.spike-dishes-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spike-dish-pill {
  padding: 4px 10px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.spike-dish-pill.is-breached {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.spike-breach-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

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

.spike-script-drawer {
  border-top: 1px dashed rgba(148, 163, 184, 0.16);
  padding-top: 8px;
}

.spike-script-summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #7dd3fc;
  user-select: none;
  list-style: none;
}

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

@media (max-width: 720px) {
  .spike-price-callout {
    align-items: flex-start;
  }

  .pantry-inline-price-input {
    width: 58px;
  }
}

/* =========================================================================
   DAY 4 UX POLISH: DISH MARGIN TRIAGE BAR & ZERO-CLUTTER RECIPE BUILDER
   ========================================================================= */
.menu-rescue-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(248, 113, 113, 0.48);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(229, 124, 60, 0.08));
}

.menu-rescue-bar.is-undo {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.65));
}

.menu-rescue-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 220px;
}

.menu-rescue-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.menu-rescue-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

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

.menu-status-pills {
  margin-top: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.menu-pill-breached:not(.active) {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.menu-pill-healthy:not(.active) {
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.mobile-menu-status-pills {
  margin-top: 0;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  gap: 6px;
}

.dish-builder-header > div {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dish-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

.dish-profit-equation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.15fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--border-subtle);
}

.dish-eq-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.14);
  min-width: 0;
}

.dish-eq-card.is-profit {
  border-color: rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.08);
}

.dish-eq-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dish-eq-value {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.dish-eq-pct {
  font-size: 13px;
  font-weight: 700;
  color: #6ee7b7;
}

.dish-eq-sub {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.dish-eq-arrow {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 800;
  user-select: none;
}

.shelf-card-cat-hint {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}

@media (max-width: 780px) {
  .dish-profit-equation {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dish-eq-arrow {
    display: none;
  }
}

/* ============================================================================
   DAY 5: STREAMLINED CUSTOMER QUOTE MODAL & SEARCHABLE 159-PLAYBOOK DRAWER
   ============================================================================ */
#customerQuoteBeatPriceModal .modal-body > * {
  flex-shrink: 0;
}

.quote-top-selector-bar {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quote-exports-tray {
  min-width: 245px;
  right: 0;
  left: auto;
}

.quote-raw-pii-drawer {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding-top: 6px;
}

.quote-raw-pii-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
  font-size: 11.5px;
  font-weight: 700;
  color: #6ee7b7;
  user-select: none;
}

.quote-raw-pii-summary::-webkit-details-marker {
  display: none;
}

.quote-raw-pii-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}

.quote-raw-pii-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-width: 0;
}

.quote-comparison-table-wrap {
  flex-shrink: 0;
  overflow-y: visible;
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.32);
}

.quote-playbooks-drawer {
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(168, 85, 247, 0.34);
  border-radius: 12px;
  overflow: hidden;
}

.quote-playbooks-drawer[open] {
  border-color: rgba(168, 85, 247, 0.52);
}

.quote-playbooks-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.24), rgba(15, 23, 42, 0.88));
  user-select: none;
  transition: background 0.15s ease;
}

.quote-playbooks-summary:hover {
  background: linear-gradient(135deg, rgba(107, 33, 168, 0.34), rgba(15, 23, 42, 0.94));
}

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

.quote-playbooks-summary-title {
  font-size: 13px;
  font-weight: 800;
  color: #e9d5ff;
  letter-spacing: -0.01em;
}

.quote-playbooks-summary-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.quote-playbooks-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(168, 85, 247, 0.22);
}

.quote-playbooks-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.quote-playbooks-search-bar input[type="search"] {
  flex: 1;
  min-width: 240px;
  height: 34px;
  font-size: 12.5px;
}

/* ============================================================================
   DAY 6: PORTION PICKER, PREP BATCHES & HARMONIZED "MORE TOOLS" / VAULT MODALS
   ============================================================================ */
.modal-box .modal-body > * {
  flex-shrink: 0;
}

.portion-picker-modal-card {
  border-color: rgba(217, 119, 6, 0.36);
}

.portion-picker-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portion-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.portion-section-hint {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.portion-picker-modal-card .portion-presets-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0;
}

.portion-picker-modal-card .portion-preset-btn {
  min-height: 106px;
  padding: 12px 10px;
  gap: 5px;
  border-radius: 12px;
}

.portion-preset-visual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portion-preset-thumb {
  width: 24px;
  height: 24px;
  display: inline-flex;
  flex-shrink: 0;
}

.portion-preset-fc {
  font-size: 10.5px;
  font-weight: 700;
}

.portion-preset-fc.is-ok {
  color: #34d399;
}

.portion-preset-fc.is-warn {
  color: #fbbf24;
}

.portion-station-notes-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.portion-notes-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.portion-custom-box {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portion-custom-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.portion-custom-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.portion-custom-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.portion-scale-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.portion-custom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portion-stepper-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.portion-stepper-btn {
  min-width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.portion-qty-input {
  width: 82px;
  height: 36px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
}

.portion-unit-select {
  min-width: 132px;
  height: 36px;
}

.portion-apply-btn {
  height: 36px;
  padding: 0 14px;
  margin-left: auto;
}

.portion-unit-quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.portion-unit-quick-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.portion-live-cost-readout {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--emerald);
}

/* Sub-Recipes & Prep Batches Tab Polish */
.subrecipe-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subrecipe-scale-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.65);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.subrecipe-scale-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 700;
  margin-right: 2px;
}

.subrecipe-quick-starters-bar {
  padding: 12px 18px;
  background: rgba(16, 185, 129, 0.05);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subrecipe-more-templates-drawer > summary {
  cursor: pointer;
  list-style: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.55);
  user-select: none;
}

.subrecipe-more-templates-drawer > summary::-webkit-details-marker {
  display: none;
}

.subrecipe-card-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subrecipe-card-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Harmonized 500-SKU Yield Trap & Benchmark Research Vault */
.vault-modal-overlay {
  z-index: 9999;
}

.vault-modal-box {
  width: min(1280px, 96vw);
  max-width: 1280px;
  max-height: 91vh;
  display: flex;
  flex-direction: column;
  border-color: rgba(56, 189, 248, 0.36);
}

.vault-modal-header {
  flex-wrap: nowrap;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid rgba(56, 189, 248, 0.28);
}

.vault-modal-header > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.vault-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px 20px;
}

.vault-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vault-tab-btn {
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.65);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.vault-tab-btn:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--text-primary);
}

.vault-tab-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.vault-controls-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.vault-controls-bar input[type="search"] {
  flex: 1;
  min-width: 240px;
  height: 36px;
}

.vault-controls-bar select {
  min-width: 220px;
  height: 36px;
}

.vault-result-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.vault-table-wrap {
  overflow: auto;
  max-height: 55vh;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.vault-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f172a;
}

.vault-empty-state {
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================================================
   DAY 7: RENDER SPEED (CONTENT-VISIBILITY) & MOBILE/TABLET KITCHEN ERGONOMICS
   ============================================================================ */
.shelf-item-card {
  content-visibility: auto;
  contain-intrinsic-size: 132px 138px;
}

.subrecipe-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 340px;
}

.spike-triage-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 230px;
}

#quotePackSwapAndCfoSection > div[id] {
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}

.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-btn {
  min-height: 52px;
  touch-action: manipulation;
}

@media (max-width: 820px) {
  .workspace {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .dish-builder-header > div:first-child {
    align-items: flex-start !important;
    flex-wrap: wrap;
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }

  .subrecipe-header-actions,
  .subrecipe-card-footer {
    width: 100%;
  }

  .inv-more-tools-tray,
  .quote-exports-tray {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .portion-picker-modal-card .portion-presets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portion-apply-btn {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .vault-modal-body {
    padding: 12px 14px;
  }

  .vault-controls-bar select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 8px 12px;
  }

  .header-top {
    gap: 8px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 15px;
    gap: 6px;
  }

  .brand-title #activeRestaurantPill,
  .brand-subtitle {
    display: none;
  }

  .workspace-switcher-select {
    max-width: 195px;
    font-size: 11px;
    padding: 3px 6px;
  }

  .header-actions {
    gap: 5px;
  }

  .header-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .nav-kpi-bar {
    margin-top: 6px;
    padding-top: 6px;
  }

  .kpi-mini {
    padding-left: 8px;
  }

  .kpi-mini-label {
    font-size: 9.5px;
  }

  .kpi-mini-val {
    font-size: 13px;
  }

  .more-tools-dropdown {
    position: static;
  }

  .more-tools-popover {
    left: 12px;
    right: 12px;
    top: calc(100% + 4px);
    width: auto;
    max-width: none;
    max-height: 72vh;
    overflow-y: auto;
  }

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

  .quote-raw-pii-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .portion-custom-controls {
    width: 100%;
  }

  .portion-unit-select {
    flex: 1;
    min-width: 110px;
  }
}



