:root {
  color-scheme: light;
  --ink: #16352e;
  --muted: #6b7b76;
  --green: #1f6b56;
  --green-dark: #173f35;
  --mint: #dff3e8;
  --mint-strong: #bde5d1;
  --cream: #f7f5ed;
  --paper: rgba(255, 255, 252, 0.92);
  --line: #dfe6e1;
  --danger: #b94c42;
  --shadow: 0 24px 60px rgba(23, 63, 53, 0.12);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(189, 229, 209, 0.55), transparent 28rem),
    radial-gradient(circle at 90% 90%, rgba(237, 213, 161, 0.25), transparent 30rem),
    var(--cream);
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.35;
  pointer-events: none;
}
.ambient-one { top: -8rem; right: 5vw; background: #a7d8c0; }
.ambient-two { bottom: -10rem; left: -5rem; background: #efd69f; }

.app-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 72px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 6px 0 38px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; color: white; background: var(--green-dark); box-shadow: 0 10px 24px rgba(23, 63, 53, 0.2); }
.brand-mark svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; letter-spacing: -0.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 0.75rem; }

.profile-button { display: flex; align-items: center; gap: 10px; min-width: 190px; padding: 8px 12px 8px 8px; border: 1px solid rgba(31, 107, 86, 0.12); border-radius: 18px; background: rgba(255, 255, 252, 0.72); box-shadow: 0 8px 24px rgba(23, 63, 53, 0.06); }
.profile-button:hover { border-color: var(--mint-strong); background: #fff; }
.profile-button > svg { width: 18px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 2; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 13px; color: white; background: var(--green); font-weight: 800; }
.profile-copy { text-align: left; }
.profile-copy small, .profile-copy strong { display: block; }
.profile-copy small { margin-bottom: 1px; color: var(--muted); font-size: 0.68rem; }
.profile-copy strong { max-width: 110px; overflow: hidden; font-size: 0.86rem; text-overflow: ellipsis; white-space: nowrap; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 30px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.hero h1 { max-width: 740px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.65rem, 7vw, 5.4rem); font-weight: 500; letter-spacing: -0.065em; line-height: 0.96; }
.hero > div > p:last-child { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.summary { display: flex; gap: 6px; padding: 8px; border: 1px solid rgba(31, 107, 86, 0.1); border-radius: 20px; background: rgba(255, 255, 252, 0.7); }
.summary div { min-width: 108px; padding: 14px 16px; border-radius: 14px; text-align: center; }
.summary div:first-child { background: var(--mint); }
.summary strong, .summary span { display: block; }
.summary strong { font-family: Georgia, serif; font-size: 1.85rem; font-weight: 500; }
.summary span { margin-top: 2px; color: var(--muted); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }

.view-tabs { display: flex; gap: 6px; width: fit-content; margin-bottom: 18px; padding: 5px; border: 1px solid rgba(31, 107, 86, 0.1); border-radius: 17px; background: rgba(255, 255, 252, 0.65); }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 0.86rem; font-weight: 750; }
.tab svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: white; background: var(--green-dark); box-shadow: 0 7px 18px rgba(23, 63, 53, 0.18); }

.view { display: none; }
.view.is-active { display: block; }
#list-view, #inventory-view { padding: 20px; border: 1px solid rgba(31, 107, 86, 0.1); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); backdrop-filter: blur(12px); }

.list-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.list-actions { display: flex; align-items: end; gap: 8px; }
.select-wrap { display: grid; gap: 5px; min-width: min(390px, 70%); }
.select-wrap span, .dialog-input span, .details-grid label { color: var(--muted); font-size: 0.72rem; font-weight: 750; }
.select-wrap select, .dialog-input input, .dialog-input select, .details-grid input { width: 100%; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; outline: none; }
.select-wrap select { height: 45px; padding: 0 42px 0 13px; font-weight: 750; }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 13px; font-weight: 800; transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease; }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.primary-button { min-height: 44px; padding: 0 20px; border: 0; color: white; background: var(--green); box-shadow: 0 8px 18px rgba(31, 107, 86, 0.2); }
.primary-button:hover { background: #195b49; }
.primary-button:disabled { cursor: wait; opacity: 0.6; }
.secondary-button { min-height: 45px; padding: 0 15px; border: 1px solid var(--line); background: #fff; }
.secondary-button:hover { border-color: var(--mint-strong); background: var(--mint); }
.secondary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.full-width { width: 100%; }

.quick-add { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.quick-add:focus-within { border-color: #96cbb2; box-shadow: 0 0 0 4px rgba(31, 107, 86, 0.08); }
.quick-add-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; }
.quick-add-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--green); background: var(--mint); }
.quick-add-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.quick-add-main label { min-width: 0; }
.quick-add-main input { width: 100%; height: 44px; padding: 0 5px; border: 0; color: var(--ink); background: transparent; outline: none; font-size: 1rem; }
.quick-add-main input::placeholder { color: #98a39f; }
.quick-add details { border-top: 1px solid #edf0ee; }
.quick-add summary { width: fit-content; padding: 9px 14px; color: var(--muted); font-size: 0.73rem; font-weight: 700; cursor: pointer; }
.details-grid { display: grid; grid-template-columns: 0.7fr 1fr 1.5fr; gap: 10px; padding: 0 14px 14px; }
.details-grid label { display: grid; gap: 5px; }
.details-grid input { height: 40px; padding: 0 10px; font-size: 0.86rem; }

.status-row { display: flex; justify-content: space-between; padding: 13px 4px 8px; color: var(--muted); font-size: 0.72rem; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #43a479; box-shadow: 0 0 0 3px rgba(67, 164, 121, 0.12); }
.status-row.is-syncing .status-dot { background: #d99a34; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: inherit; font-weight: 800; }

.item-group { margin-top: 14px; }
.group-title { display: flex; align-items: center; gap: 9px; margin: 0 6px 8px; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.group-title span { display: grid; place-items: center; min-width: 23px; height: 23px; padding: 0 6px; border-radius: 99px; color: var(--green-dark); background: var(--mint); font-size: 0.68rem; }
.items-list { display: grid; gap: 7px; }
.shopping-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 66px; padding: 10px 12px; border: 1px solid #e6ebe7; border-radius: 16px; background: #fff; transition: border 120ms ease, transform 120ms ease, opacity 120ms ease; }
.shopping-item:hover { border-color: var(--mint-strong); transform: translateY(-1px); }
.shopping-item.is-purchased { opacity: 0.64; background: #fafbf9; }
.shopping-item.is-purchased .item-copy strong { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.check-button { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #a9bab4; border-radius: 10px; background: white; }
.check-button svg { width: 16px; fill: none; stroke: white; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.check-button:disabled { cursor: not-allowed; border-style: dashed; opacity: .45; }
.is-purchased .check-button { border-color: var(--green); background: var(--green); }
.is-purchased .check-button svg { opacity: 1; }
.item-copy { min-width: 0; }
.item-copy strong { display: block; overflow: hidden; font-size: 0.96rem; text-overflow: ellipsis; white-space: nowrap; }
.item-copy small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.quantity-badge { padding: 6px 9px; border-radius: 9px; color: var(--green-dark); background: var(--mint); font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.delete-button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; color: #96a29e; background: transparent; }
.delete-button:hover { color: var(--danger); background: #fff0ee; }
.delete-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.empty-state { padding: 50px 20px 42px; text-align: center; }
.empty-state.is-hidden { display: none; }
.empty-illustration { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 20px; color: var(--green); background: var(--mint); font-family: Georgia, serif; font-size: 1.6rem; }
.empty-illustration.box { font-size: 2rem; }
.empty-state h2 { margin: 0 0 7px; font-family: Georgia, serif; font-weight: 500; }
.empty-state p { max-width: 440px; margin: 0 auto; color: var(--muted); line-height: 1.55; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading h2, .ai-card h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 500; letter-spacing: -0.035em; }
.count-pill { padding: 7px 10px; border-radius: 99px; color: var(--green-dark); background: var(--mint); font-size: 0.72rem; font-weight: 800; }
.inventory-add { margin-bottom: 20px; }
.inventory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inventory-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 16px; border: 1px solid #e5ebe7; border-radius: 17px; background: #fff; }
.inventory-card.is-missing { border-color: #edc9a6; background: #fffaf4; }
.inventory-card h3 { margin: 0 0 5px; font-size: 0.96rem; }
.inventory-card p { margin: 0; color: var(--muted); font-size: 0.74rem; }
.inventory-actions { display: flex; grid-column: 1 / -1; gap: 7px; margin-top: 7px; }
.inventory-actions button { flex: 1; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 0.72rem; font-weight: 800; }
.inventory-actions button:hover { border-color: var(--mint-strong); background: var(--mint); }
.inventory-actions .add-missing { color: white; border-color: var(--green); background: var(--green); }
.inventory-actions .inventory-delete { color: var(--danger); }
.inventory-actions .inventory-delete:hover { border-color: #e3aaa4; background: #fff0ee; }

.ai-card { position: relative; overflow: hidden; padding: clamp(28px, 6vw, 72px); border-radius: 28px; color: #f6fff9; background: linear-gradient(145deg, #173f35, #1f6b56); box-shadow: var(--shadow); }
.ai-card::after { content: ""; position: absolute; right: -10%; bottom: -50%; width: 27rem; height: 27rem; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); pointer-events: none; }
.ai-card .eyebrow { color: #bde5d1; }
.ai-card > p:not(.eyebrow) { max-width: 690px; margin: 18px 0 0; color: rgba(246,255,249,.75); line-height: 1.7; }
.ai-orbit { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 28px; border: 1px solid rgba(255,255,255,.25); border-radius: 22px; background: rgba(255,255,255,.08); font-size: 1.6rem; }
.ai-flow { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 32px; }
.ai-flow span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; background: rgba(255,255,255,.08); font-size: 0.75rem; font-weight: 750; }
.ai-flow b { color: #bde5d1; }
.ai-form { position: relative; z-index: 1; display: grid; gap: 12px; max-width: 760px; margin-top: 30px; padding: 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: rgba(255,255,255,.08); }
.ai-form > label { display: grid; gap: 8px; }
.ai-form > label > span { color: #d9f0e4; font-size: .74rem; font-weight: 800; }
.ai-form textarea { width: 100%; resize: vertical; min-height: 102px; padding: 13px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; color: #f6fff9; background: rgba(0,0,0,.15); outline: none; line-height: 1.5; }
.ai-form textarea::placeholder { color: rgba(246,255,249,.48); }
.ai-form textarea:focus { border-color: #bde5d1; box-shadow: 0 0 0 3px rgba(189,229,209,.12); }
.ai-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.image-picker, .ai-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 12px; font-size: .78rem; font-weight: 800; cursor: pointer; }
.image-picker { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); }
.image-picker:hover { background: rgba(255,255,255,.12); }
.image-picker svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.image-picker.has-image { color: #173f35; background: #bde5d1; }
.ai-submit { border: 0; color: #173f35; background: #dff3e8; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.ai-submit:hover { background: #fff; }
.ai-submit:disabled { cursor: wait; opacity: .62; }
.ai-result { position: relative; z-index: 1; max-width: 760px; margin-top: 14px; padding: 18px; border-radius: 18px; color: var(--ink); background: #fffef9; }
.ai-result-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.ai-result h3 { margin: 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.ai-result-head span { padding: 5px 8px; border-radius: 99px; color: var(--green-dark); background: var(--mint); font-size: .65rem; font-weight: 800; }
.ai-result > p { margin: 7px 0 14px; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.ai-proposals { display: grid; gap: 6px; }
.ai-proposal { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; }
.ai-proposal input { width: 18px; height: 18px; accent-color: var(--green); }
.ai-proposal strong { display: block; font-size: .84rem; }
.ai-proposal small { display: block; margin-top: 2px; color: var(--muted); font-size: .66rem; }
.ai-proposal > span { color: var(--green-dark); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.ai-home-note, .ai-warnings { margin-top: 12px; padding: 10px 11px; border-radius: 11px; font-size: .72rem; line-height: 1.5; }
.ai-home-note { color: #315e50; background: var(--mint); }
.ai-warnings { color: #76552e; background: #fff3dd; }
.ai-apply { width: 100%; min-height: 43px; margin-top: 13px; border: 0; border-radius: 12px; color: white; background: var(--green); font-weight: 800; }
.ai-apply:disabled { cursor: wait; opacity: .6; }

.leaflets-card { padding: clamp(22px, 5vw, 52px); border: 1px solid rgba(31, 107, 86, .1); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }
.leaflets-lead { max-width: 680px; margin: 0 0 22px; color: var(--muted); line-height: 1.65; }
.leaflets-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.leaflet-store { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 126px; padding: 13px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; text-align: left; text-decoration: none; font: inherit; cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease, border 120ms ease; }
.leaflet-store:hover { transform: translateY(-2px); border-color: var(--mint-strong); box-shadow: 0 14px 30px rgba(23,63,53,.09); }
.store-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: white; font-family: Georgia, serif; font-size: 1.6rem; font-weight: 700; }
.leaflet-store.biedronka .store-mark { color: #231f20; background: #ffd500; }
.leaflet-store.lidl .store-mark { color: #0050aa; background: #fff000; box-shadow: inset 0 0 0 4px #0050aa; }
.leaflet-cover { width: 82px; height: 100px; border-radius: 11px; object-fit: cover; object-position: top; background: #f1f3ef; }
.leaflet-copy { min-width: 0; }
.leaflet-store strong, .leaflet-store small, .leaflet-store .leaflet-copy span { display: block; }
.leaflet-store small { margin-bottom: 5px; color: var(--green); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.leaflet-store strong { display: -webkit-box; overflow: hidden; font-size: .9rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.leaflet-store .leaflet-copy span { margin-top: 7px; color: var(--muted); font-size: .68rem; }
.leaflet-store b { color: var(--green); font-size: .75rem; }
.leaflet-ai-box { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 20px; border-radius: 18px; background: var(--mint); }
.leaflet-ai-box strong { display: block; }
.leaflet-ai-box p { max-width: 670px; margin: 6px 0 0; color: #496a60; font-size: .78rem; line-height: 1.55; }
.source-note { margin: 15px 2px 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.promotion-status { margin: -8px 0 14px; color: var(--green); font-size: .74rem; font-weight: 800; }
.store-source-badge { flex: 0 0 auto; padding: 9px 12px; border-radius: 99px; color: var(--green-dark); background: #fff; font-size: .72rem; font-weight: 850; }

.leaflet-dialog { width: min(1040px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 24px; background: transparent; box-shadow: 0 30px 90px rgba(13, 38, 31, .35); }
.leaflet-dialog::backdrop { background: rgba(12, 29, 25, .68); backdrop-filter: blur(5px); }
.leaflet-dialog-card { position: relative; padding: 22px; border-radius: 24px; background: #fffef9; }
.leaflet-dialog-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-right: 42px; }
.leaflet-dialog-head h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 500; }
.leaflet-dialog-head p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: .72rem; }
.leaflet-dialog-head > span { color: var(--green); font-size: .76rem; font-weight: 850; }
.leaflet-stage { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 10px; margin-top: 15px; }
.leaflet-image-wrap { position: relative; display: grid; place-items: center; overflow: auto; height: min(62dvh, 720px); padding: 8px; border-radius: 16px; background: #e9ece8; }
.leaflet-image-wrap img { display: block; width: auto; max-width: 100%; height: auto; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 35px rgba(13,38,31,.18); cursor: crosshair; }
.leaflet-click-hint { position: absolute; left: 50%; bottom: 17px; padding: 7px 11px; border-radius: 99px; color: white; background: rgba(23,63,53,.88); font-size: .68rem; font-weight: 800; transform: translateX(-50%); pointer-events: none; white-space: nowrap; }
.leaflet-target { position: absolute; width: 30px; height: 30px; border: 3px solid white; border-radius: 50%; background: rgba(31,107,86,.48); box-shadow: 0 0 0 3px var(--green), 0 4px 14px rgba(0,0,0,.3); transform: translate(-50%, -50%); pointer-events: none; }
.leaflet-nav { display: grid; place-items: center; width: 42px; height: 56px; border: 1px solid var(--line); border-radius: 13px; color: var(--green); background: #fff; font-size: 2rem; line-height: 1; }
.leaflet-nav:hover:not(:disabled) { border-color: var(--mint-strong); background: var(--mint); }
.leaflet-nav:disabled { opacity: .28; }
.leaflet-thumbnails { display: flex; justify-content: center; gap: 6px; overflow-x: auto; margin: 12px 54px 0; padding-bottom: 2px; }
.leaflet-thumbnail { position: relative; flex: 0 0 48px; height: 65px; padding: 2px; overflow: hidden; border: 2px solid transparent; border-radius: 9px; background: #f0f2ee; }
.leaflet-thumbnail.is-active { border-color: var(--green); }
.leaflet-thumbnail img { width: 100%; height: 100%; border-radius: 5px; object-fit: cover; object-position: top; }
.leaflet-thumbnail span { position: absolute; right: 3px; bottom: 3px; min-width: 17px; padding: 2px 4px; border-radius: 6px; color: white; background: rgba(23,63,53,.86); font-size: .58rem; font-weight: 800; }
.promotion-pick { display: grid; gap: 9px; margin: 13px 54px 0; padding: 14px; border: 1px solid var(--mint-strong); border-radius: 15px; background: var(--mint); }
.promotion-pick-head { display: flex; justify-content: space-between; gap: 12px; }
.promotion-pick-head span { color: var(--muted); font-size: .62rem; }
.promotion-pick label { display: grid; gap: 4px; color: var(--muted); font-size: .66rem; font-weight: 800; }
.promotion-pick input { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.promotion-pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.promotion-pick p { margin: 0; color: #76552e; font-size: .7rem; }
.promotion-pick-loading { display: flex; align-items: center; gap: 12px; min-height: 45px; color: var(--green-dark); font-size: .76rem; }
.promotion-pick-loading .loader { width: 24px; height: 24px; }

.dialog { width: min(460px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: transparent; box-shadow: 0 30px 80px rgba(13, 38, 31, 0.28); }
.dialog::backdrop { background: rgba(18, 38, 33, 0.48); backdrop-filter: blur(4px); }
.dialog-card { position: relative; padding: 28px; border-radius: 24px; background: #fffef9; }
.dialog-card h2 { margin: 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; letter-spacing: -0.04em; }
.dialog-lead { margin: 8px 0 20px; color: var(--muted); font-size: 0.86rem; }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 11px; color: var(--muted); background: #f3f4ef; font-size: 1.35rem; }
.profile-list { display: grid; gap: 7px; }
.profile-choice { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; text-align: left; }
.profile-choice:hover { border-color: var(--mint-strong); background: var(--mint); }
.profile-choice .avatar { width: 36px; height: 36px; border-radius: 11px; }
.profile-choice strong { display: block; font-size: 0.88rem; }
.profile-choice small { color: var(--muted); font-size: 0.7rem; }
.dialog-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: #99a39f; font-size: 0.68rem; text-transform: uppercase; }
.dialog-divider::before, .dialog-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.dialog-input { display: grid; gap: 6px; margin-bottom: 13px; }
.dialog-input input, .dialog-input select { height: 45px; padding: 0 12px; }
.share-actions { display: grid; gap: 8px; }
.share-link-wrap input { padding-right: 12px; color: #36564e; background: #f7f8f4; font-size: .75rem; }
.share-note { margin: 16px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.danger-button { min-height: 44px; padding: 0 16px; border: 1px solid #efc6c1; border-radius: 13px; color: var(--danger); background: #fff7f5; font-weight: 800; }
.danger-button:hover { border-color: #db9189; background: #fff0ee; }
.danger-button:disabled { cursor: wait; opacity: .6; }
.recipes-card { padding: 26px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.76); box-shadow: var(--shadow); }
.recipes-lead { margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.recipes-grid { display: grid; gap: 14px; }
.recipe-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.recipe-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.recipe-card h3 { margin: 0 0 5px; color: var(--green-dark); }
.recipe-meta, .recipe-summary { color: var(--muted); font-size: .78rem; line-height: 1.55; }
.recipe-columns { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 18px; margin-top: 14px; }
.recipe-columns h4 { margin: 0 0 7px; }
.recipe-columns ul, .recipe-columns ol { margin: 0; padding-left: 20px; }
.recipe-columns li { margin-bottom: 6px; line-height: 1.45; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.ai-save-recipe { min-height: 42px; margin-top: 10px; padding: 0 15px; border: 0; border-radius: 12px; color: white; background: var(--green); font-weight: 800; }

.guest-mode .profile-button,
.guest-mode .view-tabs,
.guest-mode .list-toolbar,
.guest-mode #inventory-view,
.guest-mode #ai-view,
.guest-mode #recipes-view,
.guest-mode #promotions-view { display: none !important; }
.guest-mode .topbar { justify-content: flex-start; }
.guest-mode #list-view { max-width: 820px; margin: 0 auto; }

.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: min(430px, calc(100% - 32px)); padding: 13px 16px; border-radius: 13px; color: white; background: var(--green-dark); box-shadow: 0 16px 40px rgba(13, 38, 31, 0.25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #8e3f38; }

.loading-screen { position: fixed; z-index: 100; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--green-dark); background: var(--cream); transition: opacity 200ms ease, visibility 200ms ease; }
.loading-screen.is-hidden { opacity: 0; visibility: hidden; }
.loader { width: 34px; height: 34px; border: 3px solid var(--mint-strong); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.is-hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 20px, 1120px); padding-top: 12px; }
  .topbar { padding-bottom: 26px; }
  .brand small, .profile-copy small { display: none; }
  .profile-button { min-width: 0; padding-right: 8px; }
  .profile-button > svg { display: none; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero h1 { font-size: clamp(2.6rem, 14vw, 4.3rem); }
  .summary { width: 100%; }
  .summary div { flex: 1; }
  .view-tabs { width: 100%; flex-wrap: wrap; }
  .tab { flex: 1 1 calc(50% - 3px); justify-content: center; padding-inline: 8px; font-size: 0.77rem; }
  #list-view, #inventory-view { padding: 13px; border-radius: 22px; }
  .list-toolbar { align-items: stretch; }
  .select-wrap { min-width: 0; flex: 1; }
  .list-actions .secondary-button { align-self: end; width: 45px; padding: 0; font-size: 0; }
  .list-actions .secondary-button svg { margin: 0; }
  .quick-add-main { grid-template-columns: minmax(0, 1fr) auto; }
  .quick-add-icon { display: none; }
  .details-grid { grid-template-columns: 1fr 1fr; }
  .details-grid label:last-child { grid-column: 1 / -1; }
  .shopping-item { grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; }
  .quantity-badge { grid-column: 2; width: fit-content; margin-top: -5px; }
  .delete-button { grid-column: 3; grid-row: 1 / 3; }
  .inventory-grid { grid-template-columns: 1fr; }
  .leaflets-grid { grid-template-columns: 1fr; }
  .leaflet-ai-box { align-items: stretch; flex-direction: column; }
  .ai-card { border-radius: 22px; }
  .recipes-card { padding: 14px; border-radius: 22px; }
  .recipe-columns { grid-template-columns: 1fr; }
  .ai-flow b { display: none; }
  .ai-form-actions { align-items: stretch; flex-direction: column; }
  .image-picker, .ai-submit { width: 100%; }
  .leaflet-dialog { width: calc(100% - 10px); max-height: calc(100dvh - 10px); }
  .leaflet-dialog-card { padding: 14px 10px 12px; }
  .leaflet-stage { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 4px; }
  .leaflet-image-wrap { height: 58dvh; padding: 4px; }
  .leaflet-nav { width: 33px; height: 50px; }
  .leaflet-thumbnails, .promotion-pick { margin-inline: 38px; }
  .leaflet-click-hint { max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; }
  .toast { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* V1.4.0: EAN, guest mode and list management */
.inventory-heading-actions, .status-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.scan-ean-button, .delete-list-button { min-height:42px; padding:0 15px; border:1px solid var(--mint-strong); border-radius:13px; background:white; color:var(--green-dark); font:inherit; font-weight:800; cursor:pointer; }
.delete-list-button { border-color:#e0b0aa; color:#93443b; background:#fffaf8; }
.ean-dialog-card { width:min(560px, calc(100vw - 24px)); }
.ean-camera-wrap { position:relative; overflow:hidden; min-height:250px; border-radius:18px; background:#0c1714; }
.ean-camera-wrap video { display:block; width:100%; min-height:250px; max-height:48vh; object-fit:cover; }
.ean-target { position:absolute; inset:50% 8% auto; height:86px; transform:translateY(-50%); border:3px solid rgba(255,255,255,.9); border-radius:14px; box-shadow:0 0 0 999px rgba(0,0,0,.25); }
.ean-manual { display:grid; gap:10px; margin-top:14px; }
.ean-result { display:grid; grid-template-columns:110px minmax(0,1fr); gap:14px; margin-top:14px; padding:12px; border:1px solid var(--mint-strong); border-radius:16px; background:#fbfffd; }
.ean-result > img { width:110px; height:110px; object-fit:contain; border-radius:12px; background:white; }
.ean-result-copy { display:grid; gap:9px; }
.ean-result-meta { color:var(--muted); font-size:.78rem; }
.inventory-product-image, .inventory-product-placeholder { width:52px; height:52px; object-fit:contain; border-radius:12px; background:white; }
.inventory-product-placeholder { display:grid; place-items:center; color:var(--muted); font-size:1.4rem; }
.inventory-card small { display:block; margin-top:3px; color:var(--muted); font-size:.68rem; }
.guest-mode .brand { pointer-events:none; }
.guest-mode main { width:100%; }
.guest-mode .hero { max-width:820px; margin-inline:auto; }
.guest-mode #list-view { box-shadow:0 18px 60px rgba(20,64,51,.08); }
@media(max-width:760px){
  .inventory-heading-actions { width:100%; justify-content:space-between; }
  .scan-ean-button { min-height:44px; }
  .ean-result { grid-template-columns:1fr; }
  .ean-result > img { width:100%; height:150px; }
  .status-actions { width:100%; justify-content:space-between; }
}

/* V1.4.1 — stabilny skaner EAN */
.ean-camera-wrap { position: relative; overflow: hidden; min-height: 260px; border-radius: 18px; background: #10231d; }
.ean-camera-wrap video { display: block; width: 100%; min-height: 260px; max-height: 48vh; object-fit: cover; }
.ean-target { position: absolute; left: 8%; right: 8%; top: 50%; height: 120px; transform: translateY(-50%); border: 3px solid #79d4a8; border-radius: 16px; box-shadow: 0 0 0 999px rgba(3, 20, 14, .28); pointer-events: none; }
#ean-retry-camera-button { margin-top: 10px; }
@media (max-width: 760px) { .ean-dialog-card { width: min(100%, 560px); } .ean-camera-wrap, .ean-camera-wrap video { min-height: 300px; } }


/* V1.5.1 — rozmowa o przepisie i profile gotowania (mobile fix) */
.ai-preferences { display:grid; grid-template-columns:120px 160px minmax(0,1fr); gap:12px; align-items:end; margin:14px 0; }
.ai-preferences > label { display:grid; gap:6px; color:var(--muted); font-size:.76rem; font-weight:700; }
.ai-preferences > label input,
.ai-preferences > label select,
.ai-refine-form input {
  width:100%;
  min-height:42px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:0 12px;
  background:white;
  color:var(--text);
  font:inherit;
}
.ai-preferences fieldset { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; min-width:0; margin:0; padding:10px 12px 12px; border:1px solid var(--line); border-radius:12px; }
.ai-preferences legend { padding:0 5px; color:var(--muted); font-size:.72rem; font-weight:800; }
.ai-preferences fieldset label { display:flex; align-items:center; gap:8px; min-height:42px; padding:0 10px; border:1px solid var(--line); border-radius:12px; background:#fff; font-size:.78rem; font-weight:700; cursor:pointer; }
.ai-preferences fieldset input[type="checkbox"] {
  appearance:auto;
  -webkit-appearance:checkbox;
  flex:0 0 22px;
  width:22px;
  height:22px;
  min-height:0;
  margin:0;
  padding:0;
  border:0;
  border-radius:4px;
  accent-color:var(--green);
}

.ai-preferences fieldset label {
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
}

.ai-preferences fieldset label:has(input:checked) {
  border-color:var(--mint-strong);
  background:rgba(255,255,255,.13);
}
.ai-recipe-preview { margin-top:14px; padding:14px; border:1px solid var(--mint-strong); border-radius:18px; background:#fbfffd; }
.ai-refine-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:end; margin-top:16px; }
.ai-refine-form label { display:grid; gap:6px; color:var(--muted); font-size:.76rem; font-weight:800; }

@media(max-width:760px){
  .ai-preferences { grid-template-columns:1fr 1fr; align-items:start; }
  .ai-preferences > label { min-width:0; }
  .ai-preferences fieldset { grid-column:1/-1; grid-template-columns:1fr 1fr; }
  .ai-preferences fieldset label { min-height:46px; font-size:.82rem; }
  .ai-refine-form { grid-template-columns:1fr; }
}

@media(max-width:430px){
  .ai-preferences { grid-template-columns:1fr; }
  .ai-preferences fieldset { grid-template-columns:1fr 1fr; }
}

/* V1.5.3 — poprawny wygląd wyboru sprzętu */
.ai-preferences fieldset {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) !important;
  gap: 8px !important;
  align-items: stretch;
}

.ai-preferences fieldset label {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 8px 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: inherit !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  cursor: pointer;
}

.ai-preferences fieldset input[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  display: inline-block !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: transparent !important;
  box-shadow: none !important;
  accent-color: var(--green);
}

.ai-preferences fieldset label:has(input:checked) {
  border-color: var(--mint-strong) !important;
  background: rgba(255, 255, 255, 0.16) !important;
}

@media (max-width: 760px) {
  .ai-preferences fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ai-preferences fieldset label {
    min-height: 46px !important;
    font-size: 0.8rem !important;
  }
}



/* V1.5.4 — zwinięte kafelki przepisów i osobne okno przepisu */

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.recipe-title-card {
  min-width: 0;
}

.recipe-title-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--green-dark);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.recipe-title-button:hover {
  border-color: var(--mint-strong);
  background: #fbfffd;
}

.recipe-title-button:active {
  transform: translateY(1px);
}

.recipe-dialog {
  width: min(760px, calc(100% - 20px));
}

.recipe-dialog-card {
  width: 100%;
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
}

.recipe-full {
  display: grid;
  gap: 16px;
}

.recipe-full h2 {
  margin: 0;
  padding-right: 42px;
  color: var(--green-dark);
}

.recipe-full-summary,
.recipe-full-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.recipe-full-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfffd;
}

.recipe-full-section h3 {
  margin: 0 0 10px;
  color: var(--green-dark);
}

.recipe-full-section ul,
.recipe-full-section ol {
  margin: 0;
  padding-left: 22px;
}

.recipe-full-section li {
  margin-bottom: 9px;
  line-height: 1.5;
}

.recipe-full-section li:last-child {
  margin-bottom: 0;
}

.recipe-dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 4px;
}

.recipe-dialog-actions button {
  min-height: 46px;
}

@media (max-width: 760px) {
  .recipes-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .recipe-title-button {
    min-height: 58px;
    padding: 13px 15px;
    border-radius: 14px;
  }

  .recipe-dialog {
    width: calc(100% - 10px);
    max-height: calc(100dvh - 10px);
  }

  .recipe-dialog-card {
    padding: 18px 14px 14px;
    max-height: calc(100dvh - 10px);
  }

  .recipe-dialog-actions {
    grid-template-columns: 1fr;
  }

  .recipe-dialog-actions button {
    width: 100%;
  }
}


/* V1.6.0 — bezpieczne listy wyjazdowe */
.share-dialog-card { width:min(560px, calc(100vw - 24px)); }
.share-state-row { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:8px 0 12px; }
.share-state-badge { display:inline-flex; align-items:center; min-height:30px; padding:0 10px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:#fff; font-size:.76rem; font-weight:800; }
.share-state-badge::before { content:""; width:8px; height:8px; margin-right:7px; border-radius:50%; background:#aaa; }
.share-state-badge.is-active { border-color:var(--mint-strong); color:var(--green-dark); background:#f3fff9; }
.share-state-badge.is-active::before { background:var(--green); }
.share-expiry { color:var(--muted); font-size:.76rem; font-weight:700; }
.share-actions { display:grid; gap:9px; }
.share-note strong { color:var(--green-dark); }
.guest-mode .ambient { opacity:.45; }
.guest-mode .app-shell { width:min(100% - 20px, 860px); }
.guest-mode .hero { padding-top:18px; }
.guest-mode .hero h1 { max-width:100%; }
.guest-mode .status-actions #refresh-app-button { display:none !important; }
.guest-error #add-item-form, .guest-error .status-row, .guest-error #items-container, .guest-error #list-empty { display:none !important; }
@media(max-width:760px){
  .share-dialog-card { width:100%; }
  .share-state-row { align-items:flex-start; flex-direction:column; gap:6px; }
  .guest-mode .topbar { padding-bottom:12px; }
  .guest-mode .hero { padding-top:8px; }
  .guest-mode .hero h1 { font-size:clamp(2.2rem, 12vw, 3.5rem); }
}


/* V1.7.0 — menu zarządzania listą */
.list-menu-button svg circle { fill: currentColor; stroke: none; }
.list-manage-card { width:min(520px, calc(100vw - 24px)); }
.list-rename-form { display:grid; gap:10px; }
.list-manage-actions { display:grid; gap:9px; }
.list-manage-note { margin:12px 0 0; color:var(--muted); font-size:.76rem; line-height:1.5; }
@media(max-width:760px){
  .list-menu-button { width:45px !important; padding:0 !important; font-size:0 !important; }
  .list-menu-button svg { margin:0 !important; }
  .list-manage-card { width:100%; }
}


/* V1.8.0 — sklepy i kolejność kategorii */
.active-store-label { display:block; margin-top:4px; color:var(--green); font-size:.7rem; font-weight:800; }
.store-layout-card { width:min(620px, calc(100vw - 24px)); }
.category-order-list { display:grid; gap:8px; max-height:42vh; overflow:auto; margin:12px 0; }
.category-order-row { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:46px; padding:8px 10px 8px 14px; border:1px solid var(--line); border-radius:13px; background:#fbfffd; font-weight:750; }
.category-order-row > div { display:flex; gap:5px; }
.category-order-row button { width:36px; height:34px; border:1px solid var(--line); border-radius:9px; background:white; color:var(--green-dark); font:inherit; font-weight:900; cursor:pointer; }
.category-order-row button:disabled { opacity:.35; cursor:default; }
.category-order-row button[data-category-remove] { color:#93443b; }
.category-add-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; align-items:end; margin:12px 0 16px; }
.category-add-form button { min-height:42px; }
.category-order-empty { margin:0; padding:14px; color:var(--muted); text-align:center; border:1px dashed var(--line); border-radius:13px; }
@media(max-width:760px){ .store-layout-card { width:calc(100% - 10px); } .category-add-form { grid-template-columns:1fr; } .category-add-form button { width:100%; } .category-order-row { font-size:.84rem; } }


/* V1.9.0 — historia cen */
.price-dialog-card { width:min(620px, calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow-y:auto; }
.price-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin:12px 0 16px; }
.price-summary > div { padding:12px; border:1px solid var(--line); border-radius:13px; background:#fbfffd; }
.price-summary small { display:block; color:var(--muted); font-size:.7rem; margin-bottom:4px; }
.price-summary strong { color:var(--green-dark); }
.price-form { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:14px; border:1px solid var(--line); border-radius:16px; }
.price-form label:nth-child(4), .price-form button { grid-column:1/-1; }
.price-history-list { display:grid; gap:8px; margin-top:16px; }
.price-history-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 12px; border:1px solid var(--line); border-radius:13px; background:white; }
.price-history-row small { display:block; color:var(--muted); margin-top:3px; }
.price-history-row button { width:34px; height:34px; border:0; border-radius:10px; background:#fff0ed; color:#93443b; font-weight:900; cursor:pointer; }
.empty-price-history { padding:14px; color:var(--muted); text-align:center; }
@media(max-width:760px){ .price-form { grid-template-columns:1fr; } .price-form label, .price-form label:nth-child(4), .price-form button { grid-column:1; } .price-summary { grid-template-columns:1fr 1fr; } .price-summary > div:last-child { grid-column:1/-1; } }


/* V2.0.0 — skanowanie paragonów */
.receipt-dialog-card{width:min(720px,calc(100vw - 20px));max-height:calc(100dvh - 20px);overflow:auto}
.receipt-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}
.receipt-image-picker{grid-column:1/-1;justify-content:center;min-height:50px}
.receipt-status{margin:10px 0;color:var(--muted);font-size:.82rem}
.receipt-lines{display:grid;gap:8px;margin:12px 0}
.receipt-line{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:13px;background:white}
.receipt-line input{width:20px;height:20px;accent-color:var(--green)}
.receipt-line span{display:grid;gap:3px;min-width:0}
.receipt-line small{color:var(--muted)}
.receipt-warnings{padding:10px 12px;border-radius:12px;background:#fff7e6;color:#6b4e18}
.receipt-warnings ul{margin:6px 0 0;padding-left:18px}
@media(max-width:760px){.receipt-controls{grid-template-columns:1fr}.receipt-image-picker{grid-column:auto}.inventory-heading-actions{align-items:stretch}.inventory-heading-actions .scan-ean-button{flex:1 1 140px}}


/* V2.0.5 — bezpośredni aparat paragonu i stabilny ponowny skan EAN */
.receipt-direct-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#receipt-dialog .receipt-camera-actions {
  display: none !important;
}

/* V2.1.0 — zapis ceny z gazetki */
.promotion-save-price { display:flex !important; align-items:center; gap:9px; margin:10px 0; font-weight:700; }
.promotion-save-price input { width:20px !important; height:20px !important; min-height:0 !important; flex:0 0 20px; accent-color:var(--green); }


/* V2.2.0 — edycja pozycji paragonu i czytelne dopasowanie */
.receipt-edit-row { display:grid; gap:10px; padding:13px; border:1px solid var(--line); border-radius:16px; background:#fbfffd; }
.receipt-edit-row > label { display:grid; gap:5px; color:var(--muted); font-size:.74rem; font-weight:800; }
.receipt-edit-row input, .receipt-edit-row select { width:100%; min-height:42px; border:1px solid var(--line); border-radius:11px; padding:0 10px; background:white; color:var(--text); font:inherit; }
.receipt-edit-row .receipt-use { display:flex; align-items:center; gap:8px; color:var(--green-dark); }
.receipt-edit-row .receipt-use input { width:20px; min-height:20px; }
.receipt-edit-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.receipt-match-status { color:var(--green); font-weight:700; }
@media(max-width:760px){ .receipt-edit-grid { grid-template-columns:1fr 1fr; } .receipt-edit-grid label:last-child { grid-column:1/-1; } }


/* V2.3.0 — sterowanie stanem Domu i auto-uzupełnianie */
.inventory-quantity-control { display:flex; align-items:center; justify-content:center; gap:8px; }
.inventory-quantity-control button { width:38px; height:38px; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--green-dark); font-size:1.35rem; font-weight:800; cursor:pointer; }
.inventory-quantity-control strong { min-width:72px; text-align:center; font-size:.86rem; }
.inventory-auto-note { color:var(--green) !important; font-weight:750; }
.inventory-replenish-settings { grid-column:1/-1; padding:8px 10px; border:1px dashed var(--line); border-radius:13px; background:#fbfffd; }
.inventory-replenish-settings summary { cursor:pointer; color:var(--green-dark); font-size:.76rem; font-weight:800; }
.inventory-replenish-grid { display:grid; grid-template-columns:1.2fr .8fr 1fr auto; gap:9px; align-items:end; margin-top:10px; }
.inventory-replenish-grid label { display:grid; gap:5px; color:var(--muted); font-size:.7rem; font-weight:750; }
.inventory-replenish-grid input[type="number"], .inventory-replenish-grid select { width:100%; min-height:40px; border:1px solid var(--line); border-radius:10px; padding:0 9px; background:#fff; color:var(--text); font:inherit; }
.inventory-auto-check { display:flex !important; grid-auto-flow:column; justify-content:start; align-items:center; gap:7px !important; min-height:40px; color:var(--text) !important; }
.inventory-auto-check input { width:18px; height:18px; }
@media(max-width:760px){
  .inventory-quantity-control { grid-column:2/4; justify-content:flex-start; }
  .inventory-replenish-grid { grid-template-columns:1fr 1fr; }
  .inventory-auto-check { grid-column:1/-1; }
  .inventory-replenish-grid .secondary-button { width:100%; }
}


/* V2.4.1 — wybór listy z gazetki; Action ukryty */
.leaflet-store.action { border-color: rgba(0, 82, 47, .22); }
.leaflet-store.action small { color: #00522f; }
.promotion-pick select { width:100%; min-height:42px; padding:9px 10px; border:1px solid var(--line); border-radius:11px; background:#fff; color:var(--ink); font:inherit; }
.promotion-list-hint { display:block; margin:-2px 0 8px; color:var(--muted); font-size:.68rem; line-height:1.45; }
