.bam-app {
  --bam-ink: #171714;
  --bam-muted: #6f6d66;
  --bam-paper: #f4ecda;
  --bam-card: #fff;
  --bam-accent: #e94f22;
  --bam-green: #164c3d;
  --bam-red: #a92e20;
  --bam-amber: #9a6515;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: clamp(16px, 2vw, 32px);
  color: var(--bam-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.bam-app * { box-sizing: border-box; }
.bam-theme-title-hidden { display: none !important; }
body.bam-has-app .wp-block-post-content { margin-block-start: 0 !important; }
.bam-lang-en { display: none !important; }
.bam-app.bam-is-en .bam-lang-de { display: none !important; }
.bam-app.bam-is-en .bam-lang-en { display: initial !important; }
.bam-app.bam-is-en h1.bam-lang-en,
.bam-app.bam-is-en h2.bam-lang-en,
.bam-app.bam-is-en h3.bam-lang-en,
.bam-app.bam-is-en p.bam-lang-en,
.bam-app.bam-is-en span.bam-lang-en { display: block !important; }

.bam-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(22px, 3vw, 38px); border-radius: 20px; background: var(--bam-green); color: #fff; }
.bam-eyebrow { margin: 0 0 7px; font-size: 13px; font-weight: 800; letter-spacing: .18em; }
.bam-hero h1 { margin: 0; font-size: clamp(38px, 4vw, 64px) !important; line-height: 1; text-transform: uppercase; letter-spacing: -.04em; }
.bam-hero > div > p:last-child { max-width: 650px; margin: 10px 0 0; font-size: clamp(16px, 1.5vw, 20px); }
.bam-language { display: flex; flex: 0 0 auto; padding: 4px; border-radius: 999px; background: #fff; }
.bam-language-button { min-width: 46px; min-height: 42px; border: 0; border-radius: 999px; background: transparent; color: var(--bam-green); font-size: 15px; font-weight: 800; cursor: pointer; }
.bam-language-button.is-active { background: var(--bam-accent); color: #fff; }

.bam-warning { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0 18px; padding: 14px 16px; border: 2px solid #e7b95e; border-radius: 15px; background: #fff7e7; }
.bam-warning-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 50%; background: #e7b95e; font-weight: 900; }
.bam-warning strong { font-size: 16px; }
.bam-warning p { margin: 4px 0 0; font-size: 15px; line-height: 1.45; }

.bam-layout { display: grid; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); gap: 22px; align-items: start; }
.bam-filter { position: sticky; top: 22px; overflow: hidden; border: 1px solid #ded9cb; border-radius: 17px; background: #fff; box-shadow: 0 8px 30px rgba(28, 27, 22, .08); }
.bam-filter-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 54px; padding: 15px 17px; border: 0; background: var(--bam-green); color: #fff; font-size: 16px; font-weight: 800; text-align: left; cursor: pointer; }
.bam-filter-body { padding: 16px; }
.bam-filter-help { margin: 0 0 12px; color: var(--bam-muted); font-size: 15px; line-height: 1.45; }
.bam-filter-legend { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #e0dbcf; border-radius: 12px; background: #faf8f2; }
.bam-filter-legend p { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--bam-muted); font-size: 13px; line-height: 1.35; }
.bam-filter-legend p + p { margin-top: 8px; }
.bam-legend-dot { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; }
.bam-legend-confirmed { background: var(--bam-red); }
.bam-legend-possible { background: var(--bam-amber); }
.bam-legend-unknown { display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bam-amber); background: #fff; color: #7a5200; font-size: 10px; font-weight: 900; }
.bam-allergen-options { display: grid; gap: 7px; max-height: min(42vh, 410px); overflow: auto; padding-right: 5px; }
.bam-allergen-option { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 10px; border: 1px solid #ddd7c8; border-radius: 10px; cursor: pointer; }
.bam-allergen-option:has(input:checked) { border-color: var(--bam-accent); background: #fff0e9; }
.bam-allergen-option input { width: 20px; height: 20px; accent-color: var(--bam-accent); }
.bam-allergen-option span { font-size: 15px; font-weight: 700; }
.bam-hide-option { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: 14px; font-weight: 700; line-height: 1.35; }
.bam-hide-option input { flex: 0 0 20px; width: 20px; height: 20px; accent-color: var(--bam-accent); }
.bam-reset,
.bam-print { min-height: 42px; padding: 8px 15px; border: 1px solid var(--bam-green); border-radius: 999px; background: #fff; color: var(--bam-green); font-size: 14px; font-weight: 800; cursor: pointer; }
.bam-reset { width: 100%; margin-top: 13px; }

.bam-summary { position: sticky; top: 10px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 10px 13px; border: 1px solid #ded6c4; border-radius: 14px; background: rgba(244, 236, 218, .96); backdrop-filter: blur(9px); font-size: 15px; font-weight: 800; }
.bam-category-nav { display: flex; gap: 8px; margin: 0 0 24px; padding: 2px 1px 8px; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; }
.bam-category-button { flex: 0 0 auto; min-height: 42px; padding: 8px 16px; border: 1px solid #d6cebd; border-radius: 999px; background: #fff; color: var(--bam-ink); font-size: 14px; font-weight: 800; white-space: nowrap; cursor: pointer; scroll-snap-align: start; }
.bam-category-button:hover { border-color: var(--bam-green); }
.bam-category-button.is-active { border-color: var(--bam-green); background: var(--bam-green); color: #fff; }
.bam-category { margin-bottom: 30px; }
.bam-category.is-empty { display: none; }
.bam-category h2 { margin: 0 0 12px; font-size: clamp(28px, 3vw, 44px) !important; text-transform: uppercase; letter-spacing: -.03em; }
.bam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.bam-card { padding: 17px; border: 2px solid transparent; border-radius: 16px; background: var(--bam-card); box-shadow: 0 6px 24px rgba(28, 27, 22, .07); transition: transform .2s, border-color .2s, background-color .2s, box-shadow .2s; }
.bam-card.is-hidden,
.bam-card.is-category-hidden { display: none; }
.bam-card.is-confirmed-match { border-color: #b5281c; background: #f7d9d4; box-shadow: inset 7px 0 0 #b5281c, 0 8px 26px rgba(115, 24, 14, .15); opacity: 1; }
.bam-card.is-possible-match { border-color: #d69b31; background: #fff4d7; box-shadow: inset 6px 0 0 #d69b31, 0 8px 24px rgba(110, 75, 13, .10); }
.bam-card-head { display: flex; justify-content: space-between; gap: 12px; }
.bam-card h3 { margin: 0; color: var(--bam-ink); font-size: 21px !important; line-height: 1.2; }
.bam-description { margin: 7px 0 0; color: var(--bam-muted); font-size: 15px; line-height: 1.45; }
.is-confirmed-match .bam-description { color: #4e3935; }
.bam-state-badge { height: max-content; padding: 5px 9px; border-radius: 999px; background: transparent; color: #fff; font-size: 11px; font-weight: 900; line-height: 1.3; text-align: center; text-transform: uppercase; }
.is-confirmed-match .bam-state-badge { background: #a51f15; }
.is-possible-match .bam-state-badge { background: #9b620c; }
.bam-allergen-line { margin-top: 14px; }
.bam-allergen-line > strong { display: block; margin-bottom: 7px; color: var(--bam-muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.bam-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bam-chip { padding: 5px 9px; border-radius: 999px; background: #f0e5df; color: #6e241a; font-size: 13px; font-weight: 800; }
.is-confirmed-match .bam-chip { border: 1px solid rgba(121, 27, 18, .22); background: #fff1ee; color: #681c14; }
.bam-chip-possible { background: #fff0c9; color: #72500f; }
.bam-no-listed { margin: 13px 0 0; color: var(--bam-green); font-size: 14px; line-height: 1.45; }
.bam-open-check { margin-top: 13px; padding: 9px 11px; border-left: 4px solid var(--bam-amber); background: #fff8e8; font-size: 14px; line-height: 1.4; }
.bam-open-check strong,
.bam-open-check span { display: block; }
.bam-details { margin-top: 13px; color: var(--bam-muted); font-size: 14px; }
.bam-details summary { color: var(--bam-green); font-weight: 800; cursor: pointer; }
.bam-details p { line-height: 1.45; }
.bam-updated { color: var(--bam-muted); font-size: 13px; text-align: right; }

@media (max-width: 900px) {
  .bam-app { padding: 12px; }
  .bam-hero { display: block; padding: 22px 20px; border-radius: 17px; }
  .bam-hero h1 { font-size: clamp(32px, 9vw, 48px) !important; }
  .bam-language { width: max-content; margin-top: 16px; }
  .bam-warning { margin-bottom: 14px; }
  .bam-layout { display: block; }
  .bam-filter { position: relative; top: auto; margin-bottom: 14px; }
  .bam-filter-body { padding: 14px; }
  .bam-allergen-options { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .bam-summary { top: 6px; }
  .bam-category-nav { margin-bottom: 18px; }
  .bam-grid { grid-template-columns: 1fr; }
  .bam-card { padding: 15px; }
  .bam-category h2 { margin-top: 20px; }
}

@media (max-width: 520px) {
  .bam-app { padding: 8px; }
  .bam-hero { padding: 19px 16px; }
  .bam-warning { padding: 12px; }
  .bam-warning p { font-size: 14px; }
  .bam-allergen-options { grid-template-columns: 1fr; }
  .bam-summary { font-size: 13px; }
  .bam-print { display: none; }
  .bam-card-head { display: block; }
  .bam-state-badge { display: inline-block; margin-top: 9px; }
  .bam-filter-toggle,
  .bam-allergen-option,
  .bam-language-button,
  .bam-reset,
  .bam-category-button { min-height: 48px; }
}

@media print {
  .bam-app { max-width: none; padding: 0; }
  .bam-hero { padding: 20px; border-radius: 0; }
  .bam-filter,
  .bam-language,
  .bam-print,
  .bam-category-nav { display: none !important; }
  .bam-layout { display: block; }
  .bam-summary { position: static; background: #fff; }
  .bam-grid { grid-template-columns: repeat(2, 1fr); }
  .bam-card { break-inside: avoid; border: 1px solid #bbb; box-shadow: none; }
  .bam-warning { break-inside: avoid; }
  .bam-details { display: block; }
  .bam-details > summary { display: none; }
}
