@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/baloo2-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/baloo2-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/baloo2-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/baloo2-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/baloo2-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/baloo2-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-heading: "Baloo 2", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;

  --bg-1: #f3fff1;
  --bg-2: #e8fbdc;
  --bg-3: #d4f5c6;
  --surface: #ffffff;
  --surface-soft: #f6fff3;
  --surface-muted: #eff9ea;

  --text-strong: #174227;
  --text-main: #24563a;
  --text-muted: #628171;

  --line: #c8e8c5;
  --line-strong: #91c999;

  --brand: #5ac75a;
  --brand-strong: #37a84d;
  --brand-press: #2f9444;

  --danger: #ef625e;
  --danger-strong: #dd4a48;
  --secondary: #76b8ff;
  --secondary-strong: #5c9bec;

  --ok-bg: #dbf7d9;
  --ok-text: #14502d;
  --ok-line: #8dd89b;

  --warn-bg: #fff0cf;
  --warn-text: #8a5617;
  --warn-line: #f1ca7b;

  --bad-bg: #ffe2e0;
  --bad-text: #8c2528;
  --bad-line: #f6a0a1;

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --shadow-soft: 0 6px 16px rgba(68, 139, 82, 0.1);
  --shadow-pop: 0 6px 0 rgba(48, 132, 61, 0.18);

  --focus-ring: 0 0 0 4px rgba(90, 199, 90, 0.26);
}

body.dark-mode {
  --bg-1: #102215;
  --bg-2: #17311f;
  --bg-3: #22452b;
  --surface: #1f3425;
  --surface-soft: #25402d;
  --surface-muted: #2a4832;

  --text-strong: #efffe9;
  --text-main: #d9f5d0;
  --text-muted: #9bc2a2;

  --line: #3d6547;
  --line-strong: #4c7d56;

  --brand: #69df66;
  --brand-strong: #4dcb53;
  --brand-press: #3fad44;

  --danger: #ee7a74;
  --danger-strong: #de645f;
  --secondary: #84bdff;
  --secondary-strong: #68a9f1;

  --ok-bg: rgba(58, 125, 68, 0.45);
  --ok-text: #b6f8bf;
  --ok-line: #6ac97a;

  --warn-bg: rgba(163, 120, 46, 0.4);
  --warn-text: #ffd88f;
  --warn-line: #d8ac54;

  --bad-bg: rgba(156, 62, 65, 0.46);
  --bad-text: #ffc2c4;
  --bad-line: #e28a8d;

  --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.28);
  --shadow-pop: 0 6px 0 rgba(36, 83, 45, 0.42);
  --focus-ring: 0 0 0 4px rgba(105, 223, 102, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 15% 12%, var(--bg-3) 0%, transparent 26%),
    radial-gradient(
      circle at 85% 8%,
      rgba(159, 236, 155, 0.5) 0%,
      transparent 32%
    ),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  margin: 0;
  padding: 20px 14px;
  min-height: 100vh;
  text-align: center;
  color: var(--text-main);
  overflow-x: hidden;
  transition:
    background 0.35s ease,
    color 0.25s ease;
}

.container {
  max-width: 540px;
  margin: auto;
  background: var(--surface);
  padding: 24px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  overflow: visible;
  position: relative;
}

.container::before {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(97, 216, 101, 0.22),
    transparent 72%
  );
  top: -40px;
  right: -36px;
  pointer-events: none;
}

.app-header {
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  flex: 0 0 auto;
}

#appTitle,
h2 {
  margin: 0 0 18px;
  font-family: var(--font-heading);
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: 0.2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

#appTitle {
  margin: 0;
  line-height: 1.04;
}

#reader {
  width: 100%;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--surface-soft);
}

.btn {
  background: var(--brand);
  color: #ffffff;
  border: 0;
  border-radius: 16px;
  width: 100%;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 13px 18px;
  box-shadow: var(--shadow-pop);
  transition:
    transform 0.12s ease,
    box-shadow 0.18s ease,
    background-color 0.2s ease;
}

.btn:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(48, 132, 61, 0.18);
}

.btn-stop {
  background: var(--danger);
  box-shadow: 0 6px 0 rgba(190, 66, 69, 0.18);
}

.btn-stop:hover {
  background: var(--danger-strong);
}

.btn-stop:active {
  box-shadow: 0 3px 0 rgba(190, 66, 69, 0.18);
}

.btn-secondary {
  background: var(--secondary);
  box-shadow: 0 6px 0 rgba(83, 136, 200, 0.18);
}

.btn-secondary:hover {
  background: var(--secondary-strong);
}

.btn-secondary:active {
  box-shadow: 0 3px 0 rgba(83, 136, 200, 0.18);
}

#wynik {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  display: none;
  text-align: left;
  line-height: 1.6;
  animation: revealCard 0.34s ease;
}

.bezpieczne {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 2px solid var(--ok-line);
}

.niebezpieczne {
  background: var(--bad-bg);
  color: var(--bad-text);
  border: 2px solid var(--bad-line);
}

.nieznane {
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 2px solid var(--warn-line);
}

.sklad-text {
  font-size: 14px;
  font-weight: 600;
  margin-top: 13px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 12px;
  color: var(--text-main);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-bottom: 14px;
}

.top-bar .theme-switch,
.top-bar .lang-switch,
.top-bar .account-trigger {
  height: 42px;
  box-sizing: border-box;
}

.account-menu {
  position: relative;
}

.theme-switch,
.account-trigger,
.lang-switch {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text-main);
  padding: 0 13px;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.12s ease;
}

.theme-switch {
  font-size: 18px;
}

.theme-switch:hover,
.account-trigger:hover,
.lang-switch:hover {
  background: var(--surface-muted);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.theme-switch:focus-visible,
.account-trigger:focus-visible,
.lang-switch:focus-visible,
.btn:focus-visible,
.account-pref-btn:focus-visible,
.search-bar input:focus-visible,
.guest-preset-select:focus-visible,
.account-grid input:focus-visible,
#missingProductForm input[type="text"]:focus-visible,
#missingProductForm textarea:focus-visible,
.account-pref-search-input:focus-visible,
.account-suggestion-form textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.search-bar {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.search-bar input {
  flex-grow: 1;
  border-radius: 14px;
  border: 2px solid var(--line);
  font-size: 16px;
  padding: 11px 13px;
  font-family: var(--font-body);
  font-weight: 700;
  background: var(--surface-soft);
  color: var(--text-main);
  transition: border-color 0.2s ease;
}

.search-bar .btn {
  width: auto;
  margin-bottom: 0;
  background: var(--brand-strong);
  box-shadow: 0 5px 0 rgba(48, 132, 61, 0.17);
  padding-inline: 18px;
}

.guest-preset-section {
  margin-top: 14px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 12px;
}

.guest-preset-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
}

.guest-preset-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.guest-preset-select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 700;
  padding: 10px 11px;
}

.guest-preset-info-btn {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 800;
  padding: 10px 12px;
  white-space: nowrap;
}

.guest-preset-info-btn:hover {
  background: var(--surface-muted);
}

#guestPresetStatus {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
}

#guestPresetHint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

#guestPresetInfo {
  margin-top: 8px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
}

.account-panel {
  margin-top: 0;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  background: var(--surface-soft);
  text-align: left;
}

.account-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(374px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  box-shadow: 0 8px 20px rgba(26, 82, 42, 0.16);
}

.account-popover.open {
  display: block;
  animation: dropIn 0.2s ease;
}

.account-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.account-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-grid input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 700;
  padding: 10px 12px;
}

.account-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.account-actions .btn {
  margin-bottom: 0;
  padding: 10px 12px;
  font-size: 14px;
}

.account-logged {
  margin-top: 10px;
  font-size: 13px;
  color: var(--brand-press);
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(106, 195, 112, 0.12);
}

#accountStatus,
#accountPrefsStatus,
#accountSuggestionStatus,
#missingStatus {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
}

.account-preferences {
  margin-top: 12px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.account-section {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 10px;
}

.account-auth-card {
  margin-bottom: 10px;
}

.account-section-hint {
  margin: -2px 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.account-pref-title,
.account-pref-search-label,
#missingProductForm .field-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.account-pref-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

.account-pref-tools {
  margin-bottom: 10px;
}

.account-pref-search {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.account-pref-search-input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
}

.account-pref-empty,
.mode-hint,
.photo-selected {
  margin: 6px 2px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.account-pref-btn {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 800;
  padding: 8px 11px;
  transition:
    transform 0.12s ease,
    background-color 0.2s ease;
}

.account-pref-btn:hover {
  background: var(--surface-muted);
  transform: translateY(-1px);
}

#accountPrefsRevertBtn {
  border-color: #d0ad56;
  background: #fff4d8;
  color: #6d5317;
}

#accountPrefsRevertBtn:hover {
  background: #fdebc1;
}

.account-pref-save-btn {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand-strong);
  font-size: 14px;
}

.account-pref-save-main {
  width: 100%;
  padding-top: 10px;
  padding-bottom: 10px;
}

.account-pref-save-main.dirty {
  box-shadow: 0 0 0 3px rgba(87, 194, 91, 0.2);
}

.account-pref-dirty {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid #8ad194;
  background: #e8f9e6;
  color: #1f6e3f;
  font-size: 12px;
  font-weight: 800;
  animation: accountDirtyEnter 0.34s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.mobile-unsaved-sticky {
  display: none;
}

.account-pref-save-btn:hover {
  background: var(--brand-strong);
}

.account-pref-list {
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px;
}

.account-pref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  min-height: 24px;
}

.account-pref-item input {
  margin: 0;
}

.account-presets {
  margin-top: 8px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px;
}

.account-presets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-preset-tools {
  margin: 8px 0 10px;
}

.account-preset-chip {
  border: 2px solid #7ecb88;
  border-radius: 999px;
  background: #e5fbe0;
  color: #226842;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 800;
  padding: 6px 10px;
}

.account-preset-chip:hover {
  background: #d4f7cd;
}

.account-preset-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-preset-chip-delete {
  border: 2px solid #f3b3b8;
  background: #fff0f1;
  color: #9f1239;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.account-preset-chip-delete:hover {
  background: #ffdfe2;
}

.site-footer {
  max-width: 520px;
  margin: 14px auto 0;
  padding: 12px 8px 4px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  font-weight: 700;
}

.site-footer strong {
  color: var(--text-main);
}

.site-footer-links {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.site-footer-links a {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.preset-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(20, 62, 33, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.preset-modal-card {
  width: min(430px, calc(100vw - 24px));
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  padding: 15px;
  box-shadow: var(--shadow-soft);
}

.preset-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
}

.preset-modal-text {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.preset-modal-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-suggestion-form {
  margin-top: 10px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px;
}

.account-suggestion-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 700;
  background: var(--surface-soft);
  color: var(--text-main);
}

.account-suggestion-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

#missingProductForm {
  display: none;
  margin-top: 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: left;
  background: var(--surface-soft);
}

#missingProductForm input[type="text"],
#missingProductForm textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 700;
  padding: 12px 13px;
  background: var(--surface);
  color: var(--text-main);
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 700;
}

.mode-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.hidden {
  display: none;
}

.mobile-boot-overlay {
  display: none;
}

.mobile-boot-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.mobile-boot-overlay__spinner {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: mobileBootSpin 0.8s linear infinite;
}

.mobile-boot-overlay__text {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

@keyframes mobileBootSpin {
  to {
    transform: rotate(360deg);
  }
}

.photo-trigger {
  margin-bottom: 8px;
  padding-top: 12px;
  padding-bottom: 12px;
}

#autoBarcodePhotoInfo {
  font-size: 13px;
  color: #1e5f8a;
  font-weight: 800;
  background: #e8f6ff;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 2px solid #b6dcf6;
}

#missingSuccessInfo {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ok-bg);
  border: 2px solid var(--ok-line);
  color: var(--ok-text);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

@media (max-width: 640px) {
  .mobile-unsaved-sticky {
    display: block;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 3600;
    margin: 0;
    box-shadow: 0 8px 18px rgba(24, 94, 52, 0.26);
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition:
      opacity 0.24s ease,
      transform 0.26s cubic-bezier(0.22, 0.8, 0.3, 1),
      visibility 0.24s ease;
  }

  .mobile-unsaved-sticky.hidden {
    opacity: 0;
    transform: translateY(14px);
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(
        circle at 50% 24%,
        rgba(177, 243, 159, 0.42),
        transparent 36%
      ),
      linear-gradient(160deg, #2fa44a, #1f8038);
    transition:
      opacity 0.24s ease,
      visibility 0.24s ease;
  }

  .mobile-boot-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body {
    padding: 14px 10px;
  }

  .container {
    padding: 16px 14px;
    border-radius: 20px;
  }

  #appTitle,
  h2 {
    font-size: 29px;
  }

  .app-logo {
    width: 52px;
    height: 52px;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar .btn {
    width: 100%;
  }

  .drawer {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    background: var(--surface-soft);
    border-left: 0;
  }

  .account-popover {
    right: -4px;
    width: min(350px, calc(100vw - 14px));
    max-width: calc(100vw - 14px);
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .guest-preset-row {
    grid-template-columns: 1fr;
  }

  .guest-preset-info-btn {
    width: 100%;
  }

  .account-pref-dirty {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-color: #54b861;
    background: #dff6d9;
    color: #134f2c;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.1px;
    box-shadow: 0 2px 0 rgba(52, 122, 67, 0.2);
    animation:
      accountDirtyEnter 0.34s cubic-bezier(0.22, 0.8, 0.3, 1) both,
      accountDirtyPulse 1.8s ease-in-out 0.36s infinite;
  }

  .account-pref-save-main.dirty {
    box-shadow:
      0 0 0 4px rgba(87, 194, 91, 0.28),
      0 4px 0 rgba(48, 132, 61, 0.25);
  }
}

@keyframes accountDirtyEnter {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  70% {
    opacity: 1;
    transform: translateY(1px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes accountDirtyPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes revealCard {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Keep this override at the end so it wins over base drawer rules above. */
@media (max-width: 640px) {
  .drawer {
    width: 100vw;
    max-width: none;
    border-radius: 0;
    border-left: 0;
    right: -100vw;
  }

  .drawer.open {
    right: 0;
  }
}

/* ---------------------------------
         Nowe komponenty UI (Rewolucja UX)
         --------------------------------- */

/* Lucide Icons aligment */
.lucide {
  vertical-align: middle;
  margin-right: 6px;
}
button .lucide {
  margin-right: 0;
}
.btn .lucide,
.account-trigger .lucide {
  margin-right: 8px;
  width: 18px;
  height: 18px;
}
.theme-switch .lucide {
  margin-right: 0; /* Icon-only button */
  width: 20px;
  height: 20px;
}

/* Toasts (Powiadomienia) */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-pop);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid var(--line);
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.toast-success {
  border-color: var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok-text);
}
.toast.toast-error {
  border-color: var(--bad-line);
  background: var(--bad-bg);
  color: var(--bad-text);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Drawer (Boczny panel konta) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 34, 21, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.drawer {
  position: fixed;
  top: 0;
  right: -100%;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  z-index: 1001;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
  transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--line);
}
.drawer.open {
  right: 0;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 2px solid var(--line);
  background: var(--surface-soft);
  position: relative;
}
.drawer-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--text-strong);
}
.drawer-close {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--line);
  color: var(--text-strong);
  cursor: pointer;
  padding: 0;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.12s ease;
}
.drawer-close:hover {
  background: var(--surface-muted);
  color: var(--danger-strong);
  transform: translateY(-50%) scale(1.04);
}
.drawer-content {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Form Wizard (Kroki formularza brakującego produktu) */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
}
.wizard-steps::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
  z-index: 1;
}
.wizard-step {
  position: relative;
  z-index: 2;
  background: var(--surface-soft);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  font-weight: 800;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.3s ease;
}
.wizard-step.active {
  background: var(--brand);
  border-color: var(--brand-strong);
  color: white;
  box-shadow: 0 0 0 4px rgba(90, 199, 90, 0.2);
}
.wizard-step.completed {
  background: var(--ok-line);
  border-color: var(--brand-strong);
  color: white;
}
.wizard-panel {
  display: none;
}
.wizard-panel.active {
  display: block;
  animation: revealCard 0.3s ease;
}
.wizard-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  border-top: 2px solid var(--line);
  padding-top: 16px;
}
.wizard-actions .btn {
  margin-bottom: 0;
}

/* Final iOS/mobile drawer fix: keep at end to win cascade. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 640px) {
  .drawer-overlay {
    width: 100dvw;
  }

  .drawer {
    left: 0 !important;
    right: auto !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1) !important;
  }

  .drawer.open {
    transform: translateX(0);
  }
}
