/* ===== PantryOS narzędzia (hub + kalkulator) =====
   Loaded after /styles.css and /blog/blog.css. Reuses their tokens + card/head
   classes; adds only tool-card icon banners and the calculator UI. */

/* Badge accent for the tools area (blue-ink), used by the .badge from blog.css */
.cat-narzedzie { --cat: #3f63b8; --cat-soft: rgba(63, 99, 184, .12); }

/* Tool hub cards: an icon banner instead of a photo thumbnail */
.tool-card__icon { aspect-ratio: 16 / 9; background: var(--navy); display: grid; place-items: center; color: var(--cream); }
.tool-card__icon svg { width: 54px; height: 54px; opacity: .95; }

/* ===== Tool page header ===== */
.tool-head { max-width: 720px; margin: 0 auto; text-align: center; padding: 18px 0 8px; }
.tool-head__title { font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.03em; margin: 16px 0 0; }
.tool-head__intro { margin: 16px auto 0; max-width: 46em; color: var(--muted); font-size: 16.5px; line-height: 1.65; }

/* ===== Calculator ===== */
.calc-wrap { max-width: 880px; margin: 0 auto; padding: 8px 0 0; }
.calc { display: grid; gap: 22px; align-items: start; }
@media (min-width: 780px) { .calc { grid-template-columns: 1fr 1fr; } }

.calc__panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm); }
.calc__field { margin-bottom: 24px; }
.calc__field:last-child { margin-bottom: 0; }
.calc__label { display: block; font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--navy); margin-bottom: 12px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.stepper__btn { width: 46px; height: 46px; border: 0; background: var(--card); color: var(--navy); font-size: 22px; line-height: 1; cursor: pointer; }
.stepper__btn:hover { background: var(--blue-soft); }
.stepper__val { width: 66px; height: 46px; text-align: center; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--navy); background: var(--card); -moz-appearance: textfield; }
.stepper__val::-webkit-outer-spin-button, .stepper__val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Dropdown select, matched to the stepper: same height, border, ink and head font */
.calc-select { display: block; width: 100%; height: 46px; padding: 0 42px 0 16px; border: 1px solid var(--border); border-radius: 12px; background-color: var(--card); color: var(--navy); font-family: var(--font-head); font-weight: 700; font-size: 16px; line-height: 46px; cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230A1F44' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.calc-select:hover { border-color: var(--blue-line); }
.calc-select:focus-visible { outline: 2px solid var(--blue-line); outline-offset: 2px; }

.calc__range { width: 100%; accent-color: var(--navy); height: 6px; cursor: pointer; }
.calc__scale { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

.calc__out { background: var(--navy); color: var(--cream); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-md); }
.calc__big { display: grid; gap: 16px; }
@media (min-width: 440px) { .calc__big { grid-template-columns: 1fr 1fr; } }
.calc__num { display: block; font-family: var(--font-head); font-weight: 900; font-size: clamp(28px, 7vw, 40px); letter-spacing: -0.02em; color: var(--cream); line-height: 1.05; }
.calc__num--blue { color: var(--blue); }
.calc__cap { display: block; font-size: 13px; color: rgba(248, 249, 251, .68); margin-top: 5px; }
.calc__compare { margin-top: 20px; font-size: 15.5px; line-height: 1.6; color: rgba(248, 249, 251, .92); }
.calc__compare strong { color: var(--blue); }

.calc__bars { margin-top: 22px; display: grid; gap: 12px; }
.calc__bar-label { display: flex; justify-content: space-between; font-size: 13px; color: rgba(248, 249, 251, .8); margin-bottom: 6px; }
.calc__bar { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.calc__bar-fill { height: 100%; border-radius: 999px; background: var(--blue); transition: width .3s ease; }
.calc__bar-fill--muted { background: rgba(248, 249, 251, .5); }

.calc__save { margin-top: 22px; padding: 16px 18px; background: rgba(147, 181, 255, .14); border-radius: var(--radius-sm); font-size: 14.5px; line-height: 1.6; color: var(--cream); }
.calc__save strong { color: var(--blue); }

.calc__note { max-width: 880px; margin: 22px auto 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* Product breakdown (static, informational) */
.waste-breakdown { max-width: 880px; margin: 46px auto 0; }
.waste-breakdown__title { font-size: clamp(22px, 3.4vw, 28px); letter-spacing: -0.02em; }
.waste-breakdown__sub { margin-top: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.wb-row { margin-top: 18px; }
.wb-row__top { display: flex; justify-content: space-between; font-size: 15px; color: var(--navy); font-weight: 600; margin-bottom: 7px; }
.wb-bar { height: 14px; border-radius: 999px; background: rgba(10, 31, 68, .08); overflow: hidden; }
.wb-bar__fill { height: 100%; border-radius: 999px; background: #C2612E; }

/* ===== Portion calculator extras ===== */
/* Segmented role toggle (danie główne / dodatek) */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; background: var(--card); }
.seg__btn { border: 0; background: transparent; color: var(--muted); font-family: var(--font-body); font-weight: 600; font-size: 13.5px; padding: 9px 16px; border-radius: 999px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.seg__btn.is-active { background: var(--navy); color: var(--cream); }

/* Product chips (multi-select toggles) */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--navy); font-size: 14.5px; font-weight: 500; cursor: pointer; user-select: none; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:has(input:checked) { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.chip:focus-within { outline: 2px solid var(--blue-line); outline-offset: 2px; }
.chip__tick { width: 15px; height: 15px; opacity: 0; margin-right: -3px; }
.chip:has(input:checked) .chip__tick { opacity: 1; }

/* Output list (on the navy panel) */
.portion-head { font-size: 14px; color: rgba(248, 249, 251, .78); margin-bottom: 18px; }
.portion-head strong { color: var(--cream); font-weight: 700; }
.portion-list { display: grid; gap: 14px; }
.portion-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.portion-row:last-child { padding-bottom: 0; border-bottom: 0; }
.portion-row__name { font-family: var(--font-head); font-weight: 700; font-size: 16px; color: var(--cream); }
.portion-row__val { text-align: right; }
.portion-row__amt { display: block; font-family: var(--font-head); font-weight: 900; font-size: 22px; letter-spacing: -0.01em; color: var(--blue); line-height: 1.1; }
.portion-row__hint { display: block; font-size: 12px; color: rgba(248, 249, 251, .6); margin-top: 3px; }
.portion-empty { color: rgba(248, 249, 251, .72); font-size: 15px; line-height: 1.6; }

/* ===== Portion plates visualization ===== */
.plates-wrap { max-width: 880px; margin: 26px auto 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.plates-cap { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 18px; }
.plates-cap strong { color: var(--navy); font-weight: 700; }
.plates { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-end; }
.pcell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pcell svg { display: block; }
.pmult { font-family: var(--font-head); font-size: 15px; font-weight: 900; color: var(--navy); }
.plabel { font-size: 11px; color: var(--muted); }
.legend { margin-top: 22px; display: grid; gap: 10px; }
.lrow { display: flex; align-items: center; gap: 11px; font-size: 14px; flex-wrap: wrap; }
.lsw { width: 16px; height: 16px; border-radius: 5px; flex: none; border: 1px solid rgba(10, 31, 68, .1); }
.lname { font-weight: 600; color: var(--navy); min-width: 150px; }
.lamt { color: var(--navy); font-weight: 700; }
.lchild { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.plates-empty { color: var(--muted); font-size: 15px; }
.plates-note { font-size: 12.5px; color: var(--muted); margin-top: 18px; padding: 12px 14px; background: #eef2fb; border-left: 3px solid var(--blue); border-radius: 8px; line-height: 1.6; }

/* Supporting prose block on the tool page: reuses blog.css .prose (h2/p/table).
   Center it to the tool content column and give the table a mobile scroll wrapper. */
.calc-prose { max-width: 880px; margin: 44px auto 0; }
.calc-prose h2 { margin-top: 40px; }
.calc-prose h2:first-child { margin-top: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== Storage cheat-sheet ===== */
.sheet-picker { padding: 22px 24px; }
.sheet-select { width: 100%; max-width: 460px; height: 48px; border: 1px solid var(--border); border-radius: 12px; padding: 0 42px 0 16px; font-family: var(--font-body); font-size: 15.5px; font-weight: 500; color: var(--navy); background-color: var(--card); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230A1F44' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; }
.sheet-select:focus { outline: 2px solid var(--blue-line); outline-offset: 2px; border-color: var(--blue); }

.sheet-cards { display: grid; gap: 16px; margin-top: 22px; }
@media (min-width: 640px) { .sheet-cards { grid-template-columns: repeat(3, 1fr); } }
.sheet-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow-sm); text-align: center; }
.sheet-card__icon { width: 44px; height: 44px; margin: 0 auto 14px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 13px; }
.sheet-card__icon svg { width: 24px; height: 24px; }
.sheet-card__method { font-family: var(--font-body); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sheet-card__time { font-family: var(--font-head); font-weight: 900; font-size: clamp(19px, 3.2vw, 25px); letter-spacing: -0.02em; color: var(--navy); line-height: 1.18; margin-top: 8px; }
.sheet-card--no { background: rgba(10, 31, 68, .03); border-style: dashed; }
.sheet-card--no .sheet-card__icon { background: rgba(10, 31, 68, .06); color: var(--muted); }
.sheet-card--no .sheet-card__time { color: var(--muted); font-weight: 700; font-size: 17px; }

.sheet-tip { margin-top: 20px; padding: 16px 18px; background: var(--blue-soft); border-radius: var(--radius-sm); font-size: 15px; line-height: 1.6; color: #2c3852; }
.sheet-tip strong { color: var(--navy); font-weight: 600; }
.sheet-tip a { color: var(--blue-ink); text-decoration: underline; text-underline-offset: 2px; }
.sheet-tip a:hover { color: var(--navy); }

/* In-tool CTA reuses .article-cta from blog.css; related uses .related + .post-card.
   Widen it to the calculator content column (880px) so its edges line up with
   .calc-wrap / .waste-breakdown above it. (It already sits inside a .container.) */
.article-cta { max-width: 880px; }

/* ===== "Do kiedy zjeść po otwarciu" tool: date input + status badge + result lines ===== */
.date-input { width: 100%; max-width: 460px; height: 48px; border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; font-family: var(--font-body); font-size: 15.5px; font-weight: 500; color: var(--navy); background-color: var(--card); cursor: pointer; -webkit-appearance: none; appearance: none; }
.date-input:focus { outline: 2px solid var(--blue-line); outline-offset: 2px; border-color: var(--blue); }
.date-input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }

.status-badge { display: inline-block; font-family: var(--font-body); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; line-height: 1.3; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.status-badge--fresh { background: rgba(120, 190, 110, .20); color: #b6e0a8; }
.status-badge--soon { background: rgba(230, 184, 77, .20); color: #f0cf7e; }
.status-badge--over { background: rgba(226, 96, 80, .22); color: #f5ab9f; }

.eat-line { font-family: var(--font-body); font-size: 15px; color: rgba(248, 249, 251, .82); }
.eat-line strong { display: block; font-family: var(--font-head); font-weight: 900; font-size: clamp(24px, 4vw, 32px); color: var(--cream); letter-spacing: -.02em; margin-top: 4px; }
.days-line { margin-top: 18px; font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--blue); }
.rule-line { margin-top: 16px; font-family: var(--font-body); font-size: 13.5px; line-height: 1.6; color: rgba(248, 249, 251, .62); }
