/* Läderach look for the prebuilt Mobile Dialoge bundle, phone first. Same language as the DF skin
   (branding/laederach.css): white and cream surfaces, ink text, milk-chocolate brown as the action
   colour, gold as the accent, Philosopher for headings, Hanken Grotesk for text, one 6px radius,
   no caps. The app is a minified build, so everything overrides it from outside: CSS-module classes
   are matched on their stable prefix ([class*="_menuBtn_"]), antd on its public class names, and
   inline styles that the bundle sets need !important. Logo and primary colour (#7a4e3b) come from
   the DF app-config at runtime. */

@font-face {
  font-family: "Laederach Display";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./Philosopher-Bold-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Laederach Text";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./HankenGrotesk-latin.woff2") format("woff2");
}

:root {
  --lae-ink: #171717;
  --lae-text-2: #525252;
  --lae-muted: #8a8a8a;
  --lae-line: #e7e1dc;
  --lae-field: #d6cfc9;
  --lae-tile: #f5f5f5;
  --lae-cream: #f7f3ee;
  --lae-hazelnut: #dfd9d5;
  --lae-gold: #d5b375;
  --lae-brown: #7a4e3b;
  --lae-brown-dark: #5c3a2c;
  --lae-radius: 6px;
  --lae-ring: 0 0 0 3px rgba(122, 78, 59, 0.16);
  --lae-display: "Laederach Display", Georgia, serif;
  --font-sans: "Laederach Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  /* codes and quantities: the grotesk with tabular digits instead of a monospace */
  --font-mono: "Laederach Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --primary-text-color: var(--lae-ink);
  --secondary-text-color: var(--lae-text-2);
  --label-font-color: var(--lae-text-2);
  --border-color: var(--lae-field);
  --app-background: var(--lae-cream);
  --login-bg: var(--lae-cream);
}

/* The bundle derives a light tint from the primary colour and writes it inline on <html>; for the
   brown it comes out a muddy grey. !important here takes precedence over that inline value. */
html {
  --primary-color-light: #f3ebe4 !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--lae-ink);
  background: var(--lae-cream);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* antd sets its font through low-specificity :where() rules; this outranks them */
html body [class*="ant-"]:not(.anticon) {
  font-family: var(--font-sans);
}

.mono,
.mono-tabular {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* No caps anywhere, as on laderach.com */
#root *,
.ant-modal *,
.ant-select-dropdown * {
  text-transform: none !important;
}

button,
a,
input,
[role="button"],
.ant-select-selector {
  touch-action: manipulation;
}

/* ---------- Shell ---------- */

[class*="_shell_"] {
  background: var(--lae-cream);
  overflow-x: hidden;
}

[class*="_content_"] {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

[class*="_footer_"] {
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: #fff;
  border-top: 1px solid var(--lae-line);
}

/* ---------- App bar ---------- */

[class*="_appbar_"] {
  height: calc(64px + env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
  gap: 12px;
  background: #fff;
  box-shadow: none;
  border-bottom: 1px solid var(--lae-line);
}

[class*="_appbarLogoBtn_"] {
  flex: none;
  min-height: 44px;
  padding: 0;
}

[class*="_appbarLogoTenant_"] {
  height: 24px;
}

[class*="_appbarTitle_"] {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid var(--lae-hazelnut);
  font-family: var(--lae-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--lae-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[class*="_appbarRight_"] {
  flex: none;
  gap: 2px;
}

/* Language toggle: one quiet square chip with the current language; 44px hit area */
[class*="_appbarLang_"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 36px;
  margin: 4px 2px;
  padding: 0 10px;
  border: 1px solid var(--lae-field);
  border-radius: var(--lae-radius);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--lae-ink);
}

[class*="_appbarLang_"]::after {
  content: "";
  position: absolute;
  inset: -5px -3px;
}

[class*="_appbarLang_"] span {
  display: none;
}

[class*="_appbarLang_"]:active {
  background: var(--lae-cream);
  border-color: var(--lae-brown);
}

[class*="_appbarUser_"] {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--lae-text-2);
  gap: 0;
}

[class*="_appbarLogout_"] {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--lae-radius);
  font-size: 18px;
  color: var(--lae-ink);
}

[class*="_appbarLogout_"]:active {
  background: var(--lae-cream);
}

/* Phones: the user's name is the first thing to give way; logout keeps its accessible label */
@media (max-width: 479px) {
  [class*="_appbarUser_"] {
    font-size: 0;
  }
}

/* ---------- Section labels & lists ---------- */

[class*="_sectionLabel_"] {
  padding: 22px 20px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--lae-text-2);
}

[class*="_menuList_"] {
  gap: 8px;
  padding: 0 16px 8px;
}

[class*="_menuBtn_"] {
  gap: 14px;
  min-height: 68px;
  padding: 10px 14px 10px 12px;
  border: 1px solid var(--lae-line);
  border-radius: var(--lae-radius);
  background: #fff;
  box-shadow: none;
  font-family: var(--font-sans);
  color: var(--lae-ink);
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

[class*="_menuBtn_"]:not(:disabled):active {
  background: var(--lae-cream);
  border-color: var(--lae-brown);
}

[class*="_menuBtn_"]:focus-visible {
  outline: none;
  border-color: var(--lae-brown);
  box-shadow: var(--lae-ring);
}

[class*="_menuLabel_"] b {
  font-size: 16px;
  font-weight: 600;
  color: var(--lae-ink);
  line-height: 1.3;
}

[class*="_menuLabel_"] span {
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--lae-text-2);
}

[class*="_iconTile_"] {
  border-radius: var(--lae-radius);
  background: var(--lae-cream);
  color: var(--lae-brown);
}

[class*="_chev_"] {
  color: var(--lae-brown);
}

/* ---------- Start screen ("Was möchtest du tun?") ----------
   The two entry cards are the only menu buttons the bundle renders with min-height 96px. */

[class*="_sectionLabel_"]:has(+ [class*="_menuList_"] > [class*="_menuBtn_"][style*="min-height: 96px"]) {
  position: relative;
  padding: 34px 20px 30px;
  font-family: var(--lae-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.15;
  color: var(--lae-ink);
}

/* Eyebrow over the question, and a short gold rule under it */
[class*="_sectionLabel_"]:has(+ [class*="_menuList_"] > [class*="_menuBtn_"][style*="min-height: 96px"])::before {
  content: "Läderach Bilten · Schokoladenfabrik";
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--lae-brown);
}

[class*="_sectionLabel_"]:has(+ [class*="_menuList_"] > [class*="_menuBtn_"][style*="min-height: 96px"])::after {
  content: "";
  position: absolute;
  left: 20px;
  bottom: 16px;
  width: 40px;
  height: 2px;
  background: var(--lae-gold);
}

[class*="_menuList_"]:has(> [class*="_menuBtn_"][style*="min-height: 96px"]) {
  gap: 12px;
  padding: 0 16px 24px;
}

[class*="_menuBtn_"][style*="min-height: 96px"] {
  position: relative;
  min-height: 128px !important;
  padding: 20px 16px 20px 18px;
  gap: 16px;
  border: 1px solid var(--lae-line);
  border-radius: var(--lae-radius);
  background: #fff;
  overflow: hidden;
}

/* A gold edge on the left, like a ribbon on a Läderach box */
[class*="_menuBtn_"][style*="min-height: 96px"]::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--lae-gold);
}

[class*="_menuBtn_"][style*="min-height: 96px"] > [class*="_iconTile_"] {
  width: 56px !important;
  height: 56px !important;
  font-size: 23px !important;
  border-radius: var(--lae-radius);
  color: var(--lae-gold);
  background: var(--lae-brown);
}

[class*="_menuBtn_"][style*="min-height: 96px"] [class*="_menuLabel_"] b {
  font-family: var(--lae-display);
  font-size: 21px !important;
  font-weight: 700;
  line-height: 1.15;
  color: var(--lae-ink);
}

[class*="_menuBtn_"][style*="min-height: 96px"] [class*="_menuLabel_"] span {
  margin-top: 6px;
  font-size: 14.5px;
  line-height: 1.45;
}

[class*="_menuBtn_"][style*="min-height: 96px"] > [class*="_chev_"] {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 1px solid var(--lae-hazelnut);
  border-radius: var(--lae-radius);
  font-size: 13px;
  color: var(--lae-ink);
  background: #fff;
}

[class*="_menuBtn_"][style*="min-height: 96px"]:not(:disabled):active > [class*="_chev_"] {
  background: var(--lae-brown);
  border-color: var(--lae-brown);
  color: #fff;
}

/* ---------- Dialog header ---------- */

[class*="_dialogHeader_"] {
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--lae-line);
}

[class*="_backBtn_"] {
  width: 44px;
  height: 44px;
  border-color: var(--lae-field);
  border-radius: var(--lae-radius);
  font-size: 16px;
  color: var(--lae-ink);
}

[class*="_backBtn_"]:active {
  background: var(--lae-cream);
  border-color: var(--lae-brown);
}

[class*="_dialogTitle_"] {
  font-family: var(--lae-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--lae-ink);
}

[class*="_dialogSub_"] {
  margin-top: 2px;
  font-size: 13px;
  color: var(--lae-text-2);
}

/* ---------- Buttons ---------- */

[class*="_primaryBtn_"] {
  height: 54px;
  border-radius: var(--lae-radius);
  background: var(--lae-brown);
  font-family: var(--font-sans);
  font-size: 16.5px;
  font-weight: 600;
  box-shadow: none;
}

[class*="_primaryBtn_"]:not(:disabled):active {
  background: var(--lae-brown-dark);
}

[class*="_outlineBtn_"] {
  min-height: 52px;
  height: auto;
  border-color: var(--lae-field);
  border-radius: var(--lae-radius);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--lae-ink);
}

[class*="_outlineBtn_"]:active {
  background: var(--lae-cream);
  border-color: var(--lae-brown);
}

/* ---------- Scan screen ---------- */

[class*="_scanWrap_"] {
  justify-content: flex-start;
  padding: 32px max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left));
}

[class*="_scanWrap_"] > [class*="_iconTileLg_"] {
  width: 84px;
  height: 84px;
  font-size: 36px;
  border-radius: var(--lae-radius);
  margin-bottom: 20px !important;
  background: var(--lae-brown);
  color: var(--lae-gold);
}

[class*="_scanWrap_"] > h3 {
  font-family: var(--lae-display);
  font-size: 25px !important;
  font-weight: 700 !important;
  color: var(--lae-ink);
}

[class*="_scanHint_"] {
  max-width: 34ch;
  font-size: 15px;
  color: var(--lae-text-2);
  margin-bottom: 24px;
}

/* The scan field is an unclassed div holding the barcode icon and the input */
[class*="_scanWrap_"] > div:has(> input) {
  height: 56px !important;
  border-radius: var(--lae-radius) !important;
  border-color: var(--lae-field) !important;
  background: #fff !important;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

[class*="_scanWrap_"] > div:has(> input:focus) {
  border-color: var(--lae-brown) !important;
  box-shadow: var(--lae-ring);
}

[class*="_scanWrap_"] > div > input {
  min-width: 0;
  height: 100%;
  font-size: 18px !important;
}

/* "Beispiele aus dem Lager" chips */
[class*="_scanWrap_"] button[style*="border-radius: var(--radius-full)"] {
  min-height: 44px;
  padding: 0 14px !important;
  border-radius: var(--lae-radius) !important;
  border-color: var(--lae-field) !important;
  background: #fff !important;
  color: var(--lae-ink) !important;
}

[class*="_scanWrap_"] button[style*="border-radius: var(--radius-full)"]:active {
  border-color: var(--lae-brown) !important;
  color: var(--lae-brown) !important;
}

/* ---------- Info blocks, notes ---------- */

[class*="_infoBlock_"] {
  border-color: var(--lae-line);
  border-radius: var(--lae-radius);
  box-shadow: none;
}

[class*="_infoKey_"] {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--lae-text-2);
}

[class*="_infoVal_"] {
  min-width: 0;
  overflow-wrap: anywhere;
}

[class*="_note_"] {
  border-radius: var(--lae-radius);
  font-size: 14.5px;
}

[class*="_noteInfo_"] {
  background: #fff !important;
  border-color: var(--lae-hazelnut) !important;
}

/* ---------- Text and quantity fields ---------- */

div:has(> input[inputmode="decimal"]) {
  border-radius: var(--lae-radius) !important;
  background: #fff;
}

div:has(> input[inputmode="decimal"]:focus) {
  border-color: var(--lae-brown) !important;
  box-shadow: var(--lae-ring);
}

input[inputmode="decimal"] {
  min-width: 0;
  height: 100%;
}

html body .ant-input-affix-wrapper,
html body .ant-input {
  border-radius: var(--lae-radius);
}

html body .ant-input-affix-wrapper-lg {
  min-height: 52px;
  font-size: 16px;
}

html body .ant-input-affix-wrapper:focus-within,
html body .ant-input:focus {
  border-color: var(--lae-brown);
  box-shadow: var(--lae-ring);
}

/* ---------- Komponentenzugabe ---------- */

/* Workcenter picker: 56px trigger, 52px rows, 16px text. antd 5 puts the height on the root. */
html body .ant-select-lg.ant-select-single {
  height: 56px;
  font-size: 16px;
}

/* antd's own rules here are (0,4,0) :where() chains, so the sizes need !important */
html body .ant-select-lg.ant-select-single .ant-select-selector {
  height: 56px;
  padding: 0 16px !important;
  border-color: var(--lae-field) !important;
  border-radius: var(--lae-radius) !important;
  background: #fff !important;
  font-size: 16px;
}

html body .ant-select-lg.ant-select-single.ant-select-focused .ant-select-selector,
html body .ant-select-lg.ant-select-single.ant-select-open .ant-select-selector {
  border-color: var(--lae-brown) !important;
  box-shadow: var(--lae-ring) !important;
}

html body .ant-select-lg.ant-select-single .ant-select-selection-search-input,
html body .ant-select-lg.ant-select-single .ant-select-selection-item,
html body .ant-select-lg.ant-select-single .ant-select-selection-placeholder {
  height: 54px !important;
  line-height: 54px !important;
  font-size: 16px !important;
}

html body .ant-select-lg.ant-select-single .ant-select-selection-item {
  font-weight: 600;
  color: var(--lae-ink);
}

html body .ant-select-lg.ant-select-single .ant-select-selection-placeholder {
  color: var(--lae-muted);
}

html body .ant-select-lg .ant-select-arrow {
  inset-inline-end: 16px;
  font-size: 14px;
  color: var(--lae-ink);
}

html body .ant-select-dropdown {
  padding: 6px;
  border: 1px solid var(--lae-line);
  border-radius: var(--lae-radius);
  box-shadow: 0 14px 34px rgba(23, 23, 23, 0.14), 0 2px 6px rgba(23, 23, 23, 0.06);
}

html body .ant-select-dropdown .ant-select-item {
  min-height: 52px;
  padding: 14px 14px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 24px;
  color: var(--lae-ink);
}

html body .ant-select-dropdown .ant-select-item + .ant-select-item {
  margin-top: 2px;
}

html body .ant-select-dropdown .ant-select-item-option-content {
  white-space: normal;
}

html body .ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled) {
  background: var(--lae-tile);
}

html body .ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
  font-weight: 600;
  color: var(--lae-brown);
  background: var(--lae-cream);
}

/* Intro and hint lines are set inline at 12-13px; lift them to phone-readable sizes */
[class*="_content_"] p[style*="font-size: 13px"] {
  font-size: 15px !important;
  color: var(--lae-text-2) !important;
}

[class*="_content_"] p[style*="font-size: 12px"] {
  font-size: 14px !important;
}

/* Component rows: the bundle renders their icon tile at 30px */
[class*="_menuBtn_"] > [class*="_iconTile_"][style*="width: 30px"] {
  width: 40px !important;
  height: 40px !important;
  font-size: 15px !important;
}

[class*="_menuBtn_"] .ant-tag {
  flex: none;
}

/* ---------- Tags ---------- */

html body .ant-tag {
  border-radius: 4px;
  font-weight: 600;
}

/* ---------- Booking confirmation (antd modal.confirm) ---------- */

html body .ant-modal-root .ant-modal {
  max-width: calc(100vw - 32px);
}

html body .ant-modal .ant-modal-content {
  padding: 24px 20px 20px;
  border-radius: var(--lae-radius);
}

html body .ant-modal-confirm .ant-modal-confirm-title {
  font-family: var(--lae-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--lae-ink);
}

html body .ant-modal-confirm .ant-modal-confirm-content {
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

html body .ant-modal-confirm .ant-modal-confirm-btns {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

html body .ant-modal-confirm .ant-modal-confirm-btns .ant-btn {
  flex: 1 1 0;
  height: 52px;
  margin: 0;
  border-radius: var(--lae-radius);
  box-shadow: none;
  font-size: 16px;
  font-weight: 600;
}

html body .ant-modal-confirm .ant-modal-confirm-btns .ant-btn-default {
  border-color: var(--lae-field);
  color: var(--lae-ink);
}

html body .ant-btn-primary:not(:disabled):not(.ant-btn-dangerous) {
  background: var(--lae-brown);
  border-color: var(--lae-brown);
}

/* ---------- Toasts clear the notch ---------- */

html body .ant-message {
  top: calc(8px + env(safe-area-inset-top)) !important;
}

html body .ant-message .ant-message-notice-content {
  border-radius: var(--lae-radius);
  font-size: 15px;
}

/* Narrow phones (360px class) */
@media (max-width: 374px) {
  [class*="_appbar_"] {
    gap: 8px;
  }
  [class*="_appbarLogoTenant_"] {
    height: 20px;
  }
  [class*="_appbarTitle_"] {
    padding-left: 8px;
    font-size: 14.5px;
  }
  [class*="_sectionLabel_"]:has(+ [class*="_menuList_"] > [class*="_menuBtn_"][style*="min-height: 96px"]) {
    font-size: 27px;
  }
  [class*="_menuBtn_"] > [class*="_iconTile_"][style*="width: 30px"] {
    width: 34px !important;
    height: 34px !important;
  }
}

/* ---------- Login card (inline-styled by the bundle) ---------- */

[style*="background: var(--login-bg)"] > div[style*="max-width: 360px"] {
  border: 1px solid var(--lae-line);
  border-radius: var(--lae-radius) !important;
  box-shadow: 0 18px 40px rgba(60, 38, 28, 0.08) !important;
}

[style*="background: var(--login-bg)"] h4.ant-typography {
  margin-top: 4px !important;
  font-family: var(--lae-display) !important;
  font-size: 25px !important;
  font-weight: 700 !important;
  color: var(--lae-ink);
}

/* The logo button carries the app-bar background; on the white card it needs none */
[style*="background: var(--login-bg)"] button[style*="background: var(--appbar-bg)"] {
  background: transparent !important;
}

html body .ant-btn {
  border-radius: var(--lae-radius) !important;
  box-shadow: none !important;
}

html body .ant-btn-lg {
  height: 52px;
  font-size: 16px;
  font-weight: 600;
}

/* Status tags in the brand palette: running = cream/brown instead of antd blue, booked = a muted green */
html body .ant-tag.ant-tag-processing,
html body .ant-tag.ant-tag-blue {
  color: var(--lae-brown) !important;
  background: var(--lae-cream) !important;
  border-color: var(--lae-hazelnut) !important;
}

html body .ant-tag.ant-tag-success,
html body .ant-tag.ant-tag-green {
  color: #3f6b2a !important;
  background: #f1f6ec !important;
  border-color: #cfe0c2 !important;
}

/* The booked check tile next to a component */
[class*="_menuBtn_"] > [class*="_iconTile_"][style*="success"] {
  color: #3f6b2a !important;
  background: #f1f6ec !important;
}

html body .ant-modal-confirm-confirm .ant-modal-confirm-body > .anticon {
  color: var(--lae-gold);
}
