:root {
  color-scheme: light;
  --app-bg: #f5f7fb;
  --sidebar: #111827;
  --sidebar-soft: #202a3a;
  --sidebar-text: #aeb8c7;
  --panel: #ffffff;
  --ink: #17202c;
  --muted: #6b7280;
  --line: #e1e7ef;
  --brand: #42a397;
  --brand-dark: #176f66;
  --brand-soft: #e7f6f3;
  --coral: #e86b5b;
  --coral-soft: #fff0ed;
  --gold: #d39b37;
  --gold-soft: #fff7e6;
  --blue: #3978c4;
  --blue-soft: #eaf3ff;
  --violet: #7b61c8;
  --violet-soft: #f1eeff;
  --green-soft: #edf8ea;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
}

.subscription-lock {
  display: grid;
  place-items: center;
  min-height: 320px;
  border: 1px solid #f0b2a7;
  border-radius: 8px;
  padding: 30px;
  background: #fff5f2;
  color: #8f321f;
}

.tenant-unavailable {
  max-width: 760px;
  margin: clamp(56px, 12vh, 140px) auto;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.tenant-unavailable h1 {
  margin: 10px 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
}

.tenant-unavailable p:last-child {
  margin: 0;
  color: var(--muted);
}

.subscription-lock div {
  max-width: 620px;
  text-align: center;
}

.subscription-lock h1 {
  margin: 8px 0;
  color: #8f321f;
}

body.is-subscription-locked .page-heading,
body.is-subscription-locked .important-notice,
body.is-subscription-locked .workspace-grid,
body.is-subscription-locked .mobile-footer-bar {
  display: none;
}

body.is-subscription-locked .content-shell {
  min-height: calc(100vh - 78px);
  display: grid;
  align-content: center;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--app-bg);
  color: var(--ink);
  font-weight: 400;
}

button,
input {
  font: inherit;
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: var(--sidebar);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 178px;
  padding: 12px 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.12);
}

.sidebar-brand img {
  width: 278px;
  max-width: 100%;
  max-height: 164px;
  object-fit: contain;
  object-position: center;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 52px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.is-active {
  color: white;
  background: var(--sidebar-soft);
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  font-weight: 700;
}

.nav-item:nth-child(2) .nav-icon {
  background: linear-gradient(135deg, var(--gold), var(--coral));
}

.nav-item:nth-child(3) .nav-icon {
  background: linear-gradient(135deg, var(--blue), var(--brand));
}

.nav-item:nth-child(4) .nav-icon {
  background: linear-gradient(135deg, var(--coral), var(--violet));
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-note strong,
.sidebar-note span {
  display: block;
}

.sidebar-note span {
  margin-top: 4px;
  color: var(--sidebar-text);
  font-size: 0.9rem;
}

.main-area {
  min-width: 0;
}

.topbar {
  height: 78px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: white;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(17, 24, 39, 0.04);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.store-switcher {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: #3c4656;
  font-size: 1.05rem;
  font-weight: 600;
}

.store-switcher img {
  width: 156px;
  height: 66px;
  object-fit: contain;
  object-position: left center;
}

.topbar-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 13px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.version-badge {
  width: fit-content;
  margin: 10px 0 14px;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--gold-soft);
  color: #8a5a0b;
  font-size: 0.9rem;
  font-weight: 600;
}

.version-badge[hidden],
.sidebar-version[hidden] {
  display: none !important;
}

.language-toggle {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--sidebar-soft);
}

.lang-option {
  all: unset;
  box-sizing: border-box;
  width: 52px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 0;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
}

.lang-option:hover,
.lang-option:focus-visible,
.lang-option.is-active {
  color: white;
}

.lang-icon {
  width: 52px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
  font-weight: 700;
}

.lang-option:hover .lang-icon,
.lang-option:focus-visible .lang-icon,
.lang-option.is-active .lang-icon {
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--violet));
}

.lang-option[data-lang="en"]:hover .lang-icon,
.lang-option[data-lang="en"]:focus-visible .lang-icon,
.lang-option[data-lang="en"].is-active .lang-icon {
  background: linear-gradient(135deg, var(--blue), var(--coral));
}

.content-shell {
  padding: 44px 46px 52px;
  min-width: 0;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--brand-dark);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-heading .eyebrow {
  font-size: 1.35rem;
  line-height: 1.18;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: 2.15rem;
  line-height: 1.12;
  font-weight: 700;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.2;
  font-weight: 650;
}

.heading-copy {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.55;
}

.important-notice {
  max-width: 920px;
  margin: 8px 0 18px;
  padding: 11px 14px;
  border: 1px solid #f0d3d0;
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  background: #fffafa;
  color: #1f2937;
  font-size: 0.86rem;
  line-height: 1.42;
}

.important-notice strong {
  color: #d71919;
  font-style: italic;
  text-decoration: underline;
}

.important-notice b {
  color: #111827;
}

.product-description,
.ingredient-notes {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfdfc;
}

.product-description h3,
.ingredient-notes h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.product-description p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.ingredient-notes {
  border-color: #f2d7a4;
  background: #fffbf2;
}

.ingredient-notes ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ingredient-notes li {
  color: #8a5a0b;
  font-size: 0.9rem;
  line-height: 1.45;
}

.cross-contact-warning {
  margin: 16px 0 0;
  border: 1px solid #f3b0aa;
  border-left: 4px solid #c81e1e;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff7f6;
  color: #c81e1e;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
}

.stat-card {
  min-width: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(66, 163, 151, 0.12), transparent 62%),
    white;
  box-shadow: var(--shadow);
}

.stat-card span,
.stat-card strong {
  display: block;
}

.stat-card span {
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 1.15rem;
}

.stat-card strong {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.78fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.lookup-panel {
  padding: 24px;
}

.quick-list {
  padding: 22px;
  max-height: calc(100vh - 166px);
  overflow: auto;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.search-card {
  position: relative;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(66, 163, 151, 0.09), rgba(255, 255, 255, 0) 52%),
    #fbfdfc;
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 600;
}

.search-box {
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(66, 163, 151, 0.15);
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 17px;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}

input::placeholder {
  color: #8c96a6;
}

#clear-search {
  width: 38px;
  height: 38px;
  margin-right: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 1.42rem;
  line-height: 1;
}

#clear-search:hover,
#clear-search:focus-visible {
  background: var(--brand);
  color: white;
}

#search-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.45;
}

.suggestions {
  display: none;
  position: absolute;
  z-index: 20;
  left: 18px;
  right: 18px;
  top: 108px;
  max-height: min(420px, 52vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.14);
}

.suggestions.is-open {
  display: grid;
}

.suggestion-item {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item:focus-visible {
  background: var(--brand-soft);
}

.suggestion-item strong,
.suggestion-item span {
  display: block;
}

.suggestion-item strong {
  line-height: 1.25;
  font-weight: 600;
}

.suggestion-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
  max-width: 100%;
}

.filter-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 13px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 0.91rem;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.filter-button:nth-child(3n + 2) {
  background: var(--gold-soft);
  color: #8a5d10;
}

.filter-button:nth-child(3n + 3) {
  background: var(--blue-soft);
  color: #17518d;
}

.filter-button:nth-child(3n + 4) {
  background: var(--violet-soft);
  color: #523b9f;
}

.filter-button:hover,
.filter-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.1);
}

.filter-button.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  box-shadow: 0 12px 24px rgba(23, 111, 102, 0.24);
}

.result-panel {
  min-height: 230px;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 247, 230, 0.78), transparent 48%),
    #ffffff;
}

.empty-title,
.product-title {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 650;
  line-height: 1.22;
}

.empty-copy,
.product-meta,
.note {
  color: var(--muted);
  line-height: 1.55;
}

.product-meta {
  margin: 8px 0 0;
  color: var(--brand-dark);
  font-weight: 600;
}

.allergen-groups {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.allergen-group h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.96rem;
  font-weight: 600;
}

.allergen-group h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--coral);
}

.allergen-group.is-may h3::before {
  background: var(--blue);
}

.allergen-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.allergen-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--coral-soft);
  color: #8f321f;
  border: 1px solid #f0b2a7;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.may-chip {
  background: var(--blue-soft);
  color: #17518d;
  border-color: #b7d6f5;
}

.safe-chip {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: #addfd8;
}

.product-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.product-button {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 12px;
  text-align: left;
  background: linear-gradient(135deg, #ffffff, #f9fbfd);
  color: var(--ink);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(225, 231, 239, 0.94);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-button:hover,
.product-button:focus-visible,
.product-button.is-selected {
  border-color: rgba(66, 163, 151, 0.45);
  background: white;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
  transform: translateY(-1px);
}

.product-initial {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.tone-1 .product-initial {
  background: var(--gold-soft);
  color: #8a5d10;
}

.tone-2 .product-initial {
  background: var(--blue-soft);
  color: #17518d;
}

.tone-3 .product-initial {
  background: var(--violet-soft);
  color: #523b9f;
}

.tone-4 .product-initial {
  background: var(--coral-soft);
  color: #8f321f;
}

.tone-5 .product-initial {
  background: var(--green-soft);
  color: #2d7135;
}

.product-text {
  min-width: 0;
}

.product-text strong {
  display: block;
  line-height: 1.25;
  font-weight: 600;
}

.product-text > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.no-results {
  padding: 16px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  line-height: 1.45;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .sidebar-brand {
    min-height: 138px;
  }

  .side-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-bottom: 2px;
  }

  .nav-item {
    min-width: 0;
  }

  .sidebar-note {
    display: none;
  }

  .topbar {
    padding: 0 18px;
  }

  .content-shell {
    padding: 26px 18px 34px;
  }

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

  .quick-list {
    max-height: min(620px, 62vh);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 620px) {
  body {
    background: #f3f6fa;
  }

  .sidebar {
    padding: 8px 10px 10px;
    gap: 10px;
  }

  .sidebar-brand {
    min-height: 96px;
    padding: 9px 10px;
  }

  .sidebar-brand img {
    width: 218px;
    max-height: 86px;
  }

  .side-nav {
    padding-bottom: 0;
  }

  .nav-item {
    min-height: 42px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 9px;
    font-size: 0.9rem;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .topbar {
    height: 62px;
    padding: 0 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .store-switcher img {
    width: 132px;
    height: 58px;
  }

  .language-toggle {
    min-height: 42px;
    gap: 7px;
    padding: 6px 9px;
  }

  .lang-option {
    width: 42px;
    min-width: 42px;
    height: 30px;
  }

  .lang-icon {
    width: 42px;
    height: 30px;
    font-size: 0.76rem;
  }

  .topbar-pill {
    display: none;
  }

  .page-heading {
    display: block;
    margin-bottom: 18px;
  }

  .page-heading .eyebrow {
    font-size: 1.05rem;
  }

  .important-notice {
    max-height: 122px;
    overflow: auto;
    margin: 7px 0 14px;
    padding: 9px 10px;
    font-size: 0.73rem;
    line-height: 1.34;
  }

  .stat-card {
    margin-top: 16px;
    padding: 12px;
  }

  h1 {
    font-size: 1.68rem;
  }

  .lookup-panel,
  .quick-list {
    padding: 13px;
  }

  .quick-list {
    max-height: 54vh;
  }

  .search-card,
  .result-panel {
    padding: 13px;
  }

  .suggestions {
    left: 13px;
    right: 13px;
    top: 104px;
    max-height: 54vh;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
    scrollbar-width: thin;
  }

  .filter-button {
    flex: 0 0 auto;
  }

  .product-button {
    min-height: 58px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .product-initial {
    width: 36px;
    height: 36px;
  }

  .product-text > span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .allergen-chip {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.86rem;
  }
}

.public-app {
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.public-app h1,
.public-app h2,
.public-app h3,
.public-app .empty-title,
.public-app .product-title {
  font-weight: 600;
  letter-spacing: 0;
}

.public-app p,
.public-app span,
.public-app li,
.public-app input,
.public-app button {
  font-weight: 400;
}

.public-app .eyebrow {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.public-app .page-heading .eyebrow {
  font-weight: 600;
}

.public-app .heading-copy,
.public-app .important-notice,
.public-app .product-description p,
.public-app .ingredient-notes li,
.public-app .empty-copy,
.public-app .product-meta,
.public-app .note,
.public-app #search-help,
.public-app .product-text > span,
.public-app .suggestion-item span {
  font-weight: 400;
}

.public-app .nav-item,
.public-app .nav-item span,
.public-app .nav-icon,
.public-app .topbar-pill,
.public-app .version-badge,
.public-app .lang-option,
.public-app .lang-icon,
.public-app label,
.public-app .filter-button,
.public-app .suggestion-item strong,
.public-app .product-description h3,
.public-app .ingredient-notes h3,
.public-app .allergen-group h3,
.public-app .allergen-chip,
.public-app .product-initial,
.public-app .product-text strong,
.public-app .stat-card span,
.public-app .stat-card strong {
  font-weight: 500;
}

.public-app .important-notice strong,
.public-app .important-notice b {
  font-weight: 500;
}

.public-app .cross-contact-warning {
  font-weight: 400;
}
