:root {
  --bg: #F6F7F5; --surface: #FFFFFF; --border: #E1E6E3; --text: #1B1F1D; --muted: #56615B;
  --accent: #2F6B4F; --on-accent: #FFFFFF; --chip: #E6EBE8; --ph: #DCE6DF;
  --btn: #FFFFFF; --btn-bd: #CBD2CE; --danger: #9B2C2C;
  --info-bg: #E8F0F7; --info-bd: #B9CFE3; --info-tx: #1F3B57;
  --warn-bg: #FFF8E8; --warn-bd: #E3B866; --warn-tx: #7A4A00;
  --err-bg: #FBEDED; --err-bd: #E2B4B4; --err-tx: #8A2020;
  --radius: 16px;
  color-scheme: light dark;
}
/* Motyw: bez wyboru idzie za systemem (blok w @media), przycisk w belce ustawia data-theme na jasny albo ciemny.
   Kolory ciemne są dwa razy (ręczny wybór i system), bo CSS nie pozwala ich połączyć; test pilnuje, żeby były identyczne. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1A2E; --surface: #16243D; --border: #2B3E5E; --text: #E8EDF7; --muted: #A3B3CE;
  --accent: #7ED6B2; --on-accent: #08241A; --chip: #1D2E4B; --ph: #1B2B47;
  --btn: #16243D; --btn-bd: #3A4F73; --danger: #F29A9A;
  --info-bg: #17304F; --info-bd: #2E5078; --info-tx: #C4DCF5;
  --warn-bg: #332B1A; --warn-bd: #6B5420; --warn-tx: #F0C879;
  --err-bg: #3A2030; --err-bd: #6B3048; --err-tx: #F2B4C4;
}
:root[data-theme="dark"][data-accent="amber"] { --accent: #F2BE74; --on-accent: #2A1B05; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1A2E; --surface: #16243D; --border: #2B3E5E; --text: #E8EDF7; --muted: #A3B3CE;
    --accent: #7ED6B2; --on-accent: #08241A; --chip: #1D2E4B; --ph: #1B2B47;
    --btn: #16243D; --btn-bd: #3A4F73; --danger: #F29A9A;
    --info-bg: #17304F; --info-bd: #2E5078; --info-tx: #C4DCF5;
    --warn-bg: #332B1A; --warn-bd: #6B5420; --warn-tx: #F0C879;
    --err-bg: #3A2030; --err-bd: #6B3048; --err-tx: #F2B4C4;
  }
  :root:not([data-theme="light"])[data-accent="amber"] { --accent: #F2BE74; --on-accent: #2A1B05; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .4em 0 .3em; }
h2 { font-size: 1.15rem; margin: 1.1em 0 .4em; }
h3 { font-size: 1.05rem; margin: .6em 0 .2em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 16px; padding-bottom: 56px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow-col { max-width: 640px; }

/* pasek górny */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .topbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
/* logo i pole szukania zawsze w jednej linii: pole zajmuje całą resztę linii (na telefonie skaluje się z szerokością ekranu),
   a przyciski (.nav) zawijają się do drugiej linii, gdy nie mieszczą się obok */
.topline { flex: 1 1 280px; min-width: 0; display: flex; align-items: center; gap: 10px; position: relative; }
.brand { flex: none; font-weight: 700; font-size: 1.5rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.search { flex: 1 1 0; min-width: 0; max-width: 480px; margin: 0; }
.nav { display: flex; gap: 8px; margin-left: auto; align-items: center; flex-wrap: wrap; }
@media (max-width: 699px) {
  .search { max-width: none; }
  .search input::placeholder { font-size: .85rem; }  /* tylko podpowiedź w pustym polu; samo pole zostaje 16 px, więc iOS nie przybliża strony */
}
@media (min-width: 700px) {
  .topline { gap: 16px; position: static; }
  .search { position: relative; }       /* na komputerze lista podpowiedzi ma szerokość pola, na telefonie całej linii (.topline) */
}

/* przyciski i pola */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; min-width: 32px;
  padding: 0 11px; border-radius: 16px; border: 1px solid var(--btn-bd); background: var(--btn); color: var(--text);
  font-family: inherit; font-size: .9rem; font-weight: 500; line-height: 1; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary, .btn.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
/* wypełniony przycisk przy tej samej wysokości wygląda na większy od obrysowanego, więc jest o 2 px niższy */
.btn-primary, .btn.is-on { min-height: 30px; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.round { padding: 0; width: 32px; border-radius: 16px; font-size: 1.2rem; }
/* przyciski z samą ikoną (widok listy/siatki, motyw); aktywny jest o 2 px mniejszy z tego samego powodu co .is-on wyżej */
.btn.icon { padding: 0; width: 32px; height: 32px; }
.btn.icon.is-on { width: 30px; height: 30px; min-width: 30px; margin: 1px; }
.btn.icon svg { display: block; }
.btn.wide { width: 100%; min-height: 40px; font-size: 1rem; border-radius: 20px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--btn-bd); border-radius: 10px; background: var(--surface);
  color: var(--text); padding: 10px 12px; font: inherit; }
textarea { resize: vertical; }
.search input[type=search] { min-height: 32px; padding: 0 14px; border-radius: 16px; }
::placeholder { color: var(--muted); opacity: 1; }
.search input::placeholder { opacity: .7; text-overflow: ellipsis; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.fieldrow { display: flex; gap: 12px; flex-wrap: wrap; }
.field.narrow { width: 130px; } .field.grow { flex: 1; min-width: 180px; }
.field.timefield { min-width: min(230px, 100%); }
.timefield .row { gap: 6px; flex-wrap: wrap; }
.timefield input[type=number] { width: 72px; }
.timefield .row .btn { margin-left: 6px; white-space: nowrap; }
code { background: var(--chip); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
pre.code-sample { background: var(--chip); padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 8px 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.5; white-space: pre; }
progress { width: 100%; height: 10px; accent-color: var(--accent); }

.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg.tabs { margin: 8px 0 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 16px;
  background: var(--chip); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500; }
.chip.is-on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.card > h2:first-child { margin-top: 0; }
.notice { border: 1px solid; border-radius: 12px; padding: 12px 16px; margin: 12px 0; font-size: .95rem; }
.notice.info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-tx); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-tx); }
.notice.err { background: var(--err-bg); border-color: var(--err-bd); color: var(--err-tx); }
.notice a { color: inherit; }
.notice a.btn { color: var(--text); }
.notice a.btn-primary { color: var(--on-accent); }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.empty { text-align: center; padding: 48px 0; }
.facts { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  /* telefon: etykieta zawija się z lewej, wartość (liczba) jest z prawej, a długa wartość (.wide) dostaje własny wiersz */
  .facts { grid-template-columns: minmax(0, 1fr) auto; }
  .facts dd { text-align: right; }
  .facts dd.wide { grid-column: 1 / -1; text-align: left; margin-top: -2px; }
}
.facts + details, .facts + .notice { margin-top: 12px; }

/* lista przepisów */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.rcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none; }
.rcard:hover { border-color: var(--accent); }
.rcard img, .rcard-ph { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--ph); display: block; }
.rcard-body { padding: 12px 14px 14px; }
.rcard-body h2 { margin: 0 0 4px; font-size: 1.05rem; line-height: 1.25; }
.rcard-body p { margin: 2px 0 0; }

/* widok przepisu */
.rhead { display: flex; gap: 12px 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.rhead-main { flex: 1; min-width: 260px; }
.rhead-main p { margin: 4px 0 0; }
.rhead-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.layout { display: grid; gap: 16px; }
.hero { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; display: block; background: var(--ph); }
.panel-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.panel-row > span:first-child { flex: 1; font-size: .95rem; }
.srv { min-width: 26px; text-align: center; font-size: 1rem; font-weight: 600; }
.sidetime { margin: 12px 0 4px; }
.sidetime strong { font-weight: 600; }
/* panel sterowania przy zdjęciu: niższe przyciski niż w reszcie aplikacji */
.ctrl .btn { min-height: 28px; min-width: 28px; padding: 0 10px; font-size: .85rem; }
.ctrl .btn.is-on { min-height: 26px; }
.ctrl .btn.round { width: 28px; padding: 0; font-size: 1.05rem; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.preview-bar form { margin: 0; }
.nowrap { white-space: nowrap; }
.meta > span:not(:last-child)::after { content: " ·"; margin: 0 .35em 0 .1em; }   /* kropka na końcu wiersza, nie na początku */
time[title] { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; line-height: 1.45; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li, .step { border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.check:not(.opt) input:checked + .txt { color: var(--muted); text-decoration: line-through; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.step { counter-increment: s; padding-bottom: 6px; }
.step .txt { font-size: 1.05rem; }
.step .txt::before { content: counter(s) ". "; font-weight: 700; }
.step-head h3 { margin: 18px 0 4px; }
.stepimg { display: block; width: 100%; max-width: 640px; border-radius: 12px; margin: 4px 0 12px; background: var(--ph); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery img { width: 100%; border-radius: 10px; display: block; }
.tools { margin-top: 14px; }
.owner-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
#recipe[data-lang="orig"] #ctrl-scale { display: none; }
.nosleep-video { position: fixed; bottom: 0; left: 0; width: 2px; height: 2px; opacity: .01; pointer-events: none; }

/* edycja */
.editgrid { display: grid; gap: 16px; }
.erow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.num { width: 28px; height: 28px; border-radius: 14px; background: var(--chip); font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none; margin-top: 8px; }
.erow .grow { min-width: 0; }
.erow.is-head { background: var(--chip); border-radius: 10px; padding: 8px 8px; margin: 6px 0; border-bottom: 0; }
.erow.is-head .num { background: var(--surface); }
.headinput, .erow.is-head textarea { font-weight: 700; }
.erow.is-new { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
.erow.dragging { opacity: .75; background: var(--surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); position: relative; z-index: 2; }
/* przyciski przesuwania: 24 px (wariant B z makiety), a pole dotyku ma 28 px dzięki niewidocznemu marginesowi */
.rowctl { display: grid; grid-template-columns: repeat(2, 24px); grid-template-areas: "up down" "grip del"; gap: 3px;
  align-items: center; justify-items: center; flex: none; }
.rowctl .btn.round { position: relative; width: 24px; height: 24px; min-height: 0; min-width: 0; padding: 0; }
.rowctl .btn.round::after, .grip::after { content: ""; position: absolute; inset: -2px; }
.rowctl .btn.round svg, .grip svg { width: 12px; height: 12px; display: block; }
.rowctl [data-move="-1"] { grid-area: up; } .rowctl [data-move="1"] { grid-area: down; }
.rowctl .grip { grid-area: grip; } .rowctl [data-remove] { grid-area: del; color: var(--danger, #b3261e); }
@media (min-width: 700px) { .rowctl { grid-template-columns: repeat(4, 24px); grid-template-areas: "grip up down del"; } }
.grip { position: relative; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 12px; cursor: grab;
  color: var(--muted); touch-action: none; user-select: none; -webkit-user-select: none; }
.grip:hover { background: var(--chip); }
.dragging .grip { cursor: grabbing; }
.addrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.addrow .btn { min-height: 24px; height: 24px; padding: 0 9px; font-size: .75rem; border-radius: 12px; gap: 5px; }
.site-foot { padding-top: 8px; padding-bottom: 24px; font-size: .8rem; color: var(--muted); text-align: center; }
.checklist li.ing-head { padding: 14px 0 2px; border-bottom: 0; }
.checklist li.ing-head:first-child { padding-top: 0; }
.ing-head h3 { margin: 0; }
.imggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.imgtile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--ph); display: block; }
.imgtile .check { min-height: 40px; padding: 6px 0; }
.actionbar { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-top: 16px; }
.items { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 14px; min-height: 64px; }
.item.is-warn { background: var(--warn-bg); border-color: var(--warn-bd); }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
/* numer szkicu po lewej, na środku wysokości karty; mniejszy niż adres i data (.small = .875rem) */
.item-num { flex: none; min-width: 26px; font-size: .75rem; line-height: 16px; font-weight: 600; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; color: var(--muted); }
/* na telefonie numer nie może zabrać miejsca tytułowi: ciaśniejsze odstępy i przyciski oddają mu tyle samo szerokości */
@media (max-width: 699px) {
  .drafts-list .item { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .drafts-list .item-num { min-width: 0; }
  .drafts-list .item .btn { padding: 0 9px; }
}

@media (min-width: 900px) {
  .wrap { padding: 0 32px; }
  h1 { font-size: 2.1rem; }
  .layout { grid-template-columns: 360px 1fr; align-items: start; }
  .side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
  .main { padding: 24px 28px; }
  .editgrid { grid-template-columns: 1fr 360px; align-items: start; }
  .side-col { position: sticky; top: 76px; }
}
@media print {
  .topbar, .rhead-actions, .owner-bar, .tools, .ctrl, .back, .site-foot { display: none !important; }
  .card { border: 0; padding: 0; }
  .side { position: static; max-height: none; }
}

/* filtry i sortowanie na liście */
.listing { display: block; }
.filters { display: none; }
.toolbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 4px 0 12px; }
.rtotal { font-size: 1.25rem; margin: 0; flex: 1; min-width: 120px; }
.sortbox { display: flex; align-items: center; gap: 8px; }
.sortbox select { width: auto; min-width: 160px; min-height: 32px; padding: 0 10px; border-radius: 16px; font-size: .9rem; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 700; }
.fhead { display: flex; align-items: center; gap: 8px; }
.fhead h2 { flex: 1; margin: 0; }
.fgroup { margin: 14px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.check.opt { align-items: center; min-height: 40px; padding: 4px 0; }
.check.opt .txt { flex: 1; }
.cnt { color: var(--muted); font-size: .85rem; }

/* suwak czasu: dwa uchwyty na wspólnej osi; same uchwyty łapią dotyk, oś jest tylko tłem */
.tlabel { display: block; margin: 2px 0 4px; font-weight: 600; }
/* Uchwyt ma 24 px (tyle łapie dotyk), ale narysowane kółko ma 18 px: tarcza z obwódką i lekki cień pod spodem. */
.range2 { position: relative; height: 32px;
  --thumb: radial-gradient(circle at 50% 50%, var(--surface) 0 6.5px, var(--accent) 7.5px 8.5px, transparent 9.5px),
           radial-gradient(circle at 50% 58%, rgba(0, 0, 0, .28) 7px, transparent 11.5px); }
.rtrack { position: absolute; left: 12px; right: 12px; top: 14px; height: 4px; border-radius: 2px; background: var(--chip); }
.rtrack::after { content: ""; position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--accent);
  left: calc(100% * var(--a, 0)); width: calc(100% * (var(--b, 1) - var(--a, 0))); }
.range2 input[type=range] { position: absolute; left: 0; top: 0; width: 100%; height: 32px; margin: 0; padding: 0;
  background: transparent; border: 0; min-height: 0; -webkit-appearance: none; appearance: none; pointer-events: none; }
.range2 input[type=range]::-webkit-slider-runnable-track { height: 32px; background: transparent; border: 0; }
.range2 input[type=range]::-moz-range-track { height: 32px; background: transparent; border: 0; }
.range2 input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
  width: 24px; height: 24px; margin-top: 4px; border: 0; border-radius: 50%; background: var(--thumb); }
.range2 input[type=range]::-moz-range-thumb { pointer-events: auto; cursor: grab; box-sizing: border-box;
  width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--thumb); }
.range2 input[type=range]:focus { outline: none; }
.range2 input[type=range]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent); outline-offset: 0; }
.range2 input[type=range]:focus-visible::-moz-range-thumb { outline: 3px solid var(--accent); outline-offset: 0; }
.range2 #tmax { z-index: 1; }
.range2.top-min #tmin { z-index: 2; }
.rscale { position: relative; height: 18px; color: var(--muted); font-size: .75rem; }
.rscale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; left: calc(12px + (100% - 24px) * var(--p, 0)); }
.rscale span:nth-child(2) { --p: .25; } .rscale span:nth-child(3) { --p: .5; } .rscale span:nth-child(4) { --p: .75; }
.rscale span:nth-child(5) { --p: 1; transform: translateX(-70%); }
.rscale span:nth-child(1) { transform: translateX(-30%); }
.tslider p { margin: 6px 0 0; }
.filters details summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; color: var(--accent); font-size: .9rem; }
.tagline { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.tag { background: var(--chip); border-radius: 10px; padding: 1px 9px; font-size: .78rem; }
.only-small { display: inline-flex; }
#f-close { display: none; }
body.filters-open { overflow: hidden; }
body.filters-open .filters { display: block; position: fixed; inset: 0; z-index: 30; background: var(--bg);
  overflow-y: auto; padding: 16px 16px 96px; }
body.filters-open .filters #f-close { display: inline-flex; }
body.filters-open #f-show { position: fixed; left: 16px; right: 16px; bottom: 16px; width: auto; z-index: 31; }
@media (min-width: 900px) {
  .listing { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
  .filters { display: block; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; padding-right: 6px; }
  .only-small, #f-show { display: none; }
  .active-chips .chip { min-height: 30px; }
}

/* ustawienia wyglądu */
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.swatch input { accent-color: var(--accent); }
.dot { width: 18px; height: 18px; border-radius: 9px; display: inline-block; }

/* odświeżanie przepisu, tagi w edycji, akcent */
.dot-mint { background: #7ED6B2; }
.dot-amber { background: #F2BE74; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.diffs .diff { display: block; }
.diff .check { align-items: flex-start; }
.diff .was, .diff .will { display: block; overflow-wrap: anywhere; }
.diff .was { color: var(--muted); text-decoration: line-through; }
.diff .cols { display: grid; gap: 10px; grid-template-columns: 1fr; margin-top: 6px; }
.difflist { margin: 4px 0 0; padding-left: 20px; font-size: .92rem; }
@media (min-width: 700px) { .diff .cols { grid-template-columns: 1fr 1fr; } }
ul.plain { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.row > .tagbox { position: relative; flex: 1 1 120px; min-width: 0; }
.cat-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 12px 0 0; }
.cat-hint .btn { min-height: 32px; padding: 0 11px; font-size: .85rem; }
/* podpowiedzi własnych tagów pod polem (ten sam wygląd co podpowiedzi wyszukiwarki). Lista jest „fixed”, żeby nie ucinały jej
   przewijane kolumny strony ani nie zasłaniał dolny pasek akcji; położenie (pod polem albo nad nim) liczy edit.js */
.sugg.tagsugg { position: fixed; z-index: 60; top: 0; left: 0; right: auto; margin: 0; padding: 4px; list-style: none; max-height: 260px; }
.tagsugg-item { display: block; width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.tagsugg-item:hover, .tagsugg-item.is-active { background: var(--chip); }
.tagsugg-item:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.tagsugg mark { background: transparent; color: var(--accent); font-weight: 800; }

/* zdjęcia kroku: siatka miniaturek i powiększenie nad stroną */
.stepgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 640px; margin: 6px 0 14px; }
.zoomlink { display: block; border-radius: 12px; overflow: hidden; background: var(--ph); line-height: 0; cursor: zoom-in; }
.zoomlink img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.zoomlink:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .zoomlink img { transition: transform .18s ease; }
  .zoomlink:hover img { transform: scale(1.04); }
}
.lb { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 11, 22, .94); }
.lb[hidden] { display: none; }
.lb-img { max-width: 96vw; max-height: 92vh; max-height: 92dvh; object-fit: contain; border-radius: 6px; display: block;
  background: transparent; }
.lb.is-loading .lb-img { opacity: .25; }
.lb-btn { position: fixed; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border-radius: 24px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(16, 26, 46, .8); color: #fff;
  font: 600 1.6rem/1 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; cursor: pointer; padding: 0; }
.lb-btn:hover { background: rgba(40, 58, 96, .95); }
.lb-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lb-close { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.lb-prev, .lb-next { top: 50%; margin-top: -24px; }
.lb-prev { left: max(10px, env(safe-area-inset-left)); }
.lb-next { right: max(10px, env(safe-area-inset-right)); }
.lb-count { position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .8); font-size: .9rem; pointer-events: none; }
.lb-single .lb-prev, .lb-single .lb-next, .lb-single .lb-count { display: none; }
body.lb-open { overflow: hidden; }
@media print { .lb { display: none !important; } .stepgrid { grid-template-columns: repeat(3, 1fr); } }

/* widok listy na stronie głównej */
.rlist { display: flex; flex-direction: column; gap: 8px; }
.rrow { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "img main" "img src"; column-gap: 12px;
  row-gap: 0; align-items: center; padding: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; color: inherit; text-decoration: none; }
.rrow:hover { border-color: var(--accent); }
.rrow > img, .rrow-ph { grid-area: img; width: 96px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--ph); display: block; }
.rrow-main { grid-area: main; min-width: 0; align-self: end; }
.rrow-main h2 { margin: 0 0 2px; font-size: 1.02rem; line-height: 1.25; overflow-wrap: anywhere; }
.rrow-main p { margin: 2px 0 0; }
.rrow-src { grid-area: src; margin: 2px 0 0; align-self: start; }
/* adres strony i data w osobnych kawałkach: przy braku miejsca data schodzi do następnej linii w całości, bez osieroconej kropki */
.srcline { display: flex; flex-wrap: wrap; column-gap: 10px; }
.srcline .src-host { overflow-wrap: anywhere; min-width: 0; }
.srcline .src-date { white-space: nowrap; }
@media (min-width: 700px) {
  .rrow { grid-template-columns: 120px minmax(0, 1fr) fit-content(290px); grid-template-areas: "img main src"; column-gap: 16px; }
  .rrow-src { min-width: 200px; }
  .rrow > img, .rrow-ph { width: 120px; height: 80px; }
  .rrow-main { align-self: center; }
  .rrow-src { align-self: center; text-align: right; flex-direction: column; align-items: flex-end; row-gap: 0; }
}

/* podpowiedzi pod polem szukania */
.sugg { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; background: var(--surface);
  border: 1px solid var(--btn-bd); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); overflow: auto;
  max-height: min(72vh, 560px); padding: 6px; }
.sugg[hidden] { display: none; }
.sugg-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 8px; border-radius: 10px;
  color: var(--text); text-decoration: none; }
.sugg-item:hover, .sugg-item.is-active { background: var(--chip); }
.sugg-item:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.sugg-thumb { flex: none; width: 56px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--ph); display: block; }
.sugg-text { min-width: 0; flex: 1; line-height: 1.3; }
.sugg-title { font-weight: 600; overflow-wrap: anywhere; }
.sugg-sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.sugg mark { background: transparent; color: var(--accent); font-weight: 800; }
.sugg-empty { padding: 14px 10px; color: var(--muted); }
.sugg-all { justify-content: center; color: var(--accent); font-weight: 600; min-height: 48px; }
@media print { .sugg { display: none !important; } }

/* własne zdjęcia w edycji */
.uploader { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 10px; }
.uploader label.btn { cursor: pointer; }
.uploader input.sr:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.upload-errors { margin: 0 0 10px; padding-left: 18px; color: var(--err-tx); }
.imgtile.is-new img { outline: 2px solid var(--accent); outline-offset: -2px; }
.imgtile select { margin-top: 2px; min-height: 36px; padding: 4px 8px; font-size: .9rem; }
.own-check { margin-bottom: 4px; }
.drafts-bar { margin: 0 0 12px; }
.imgtile { min-width: 0; }

/* link z linii składnika albo kroku do innego przepisu */
.rlink { display: block; margin: -6px 0 8px 34px; font-size: .88rem; }
.usedin { margin: 0 0 12px; padding-left: 20px; }
.rlink-edit { margin-top: 4px; }
.rlink-edit summary { cursor: pointer; font-size: .82rem; color: var(--muted, #6b7280); }
.rlink-edit input[name$="_rt"] { margin-top: 4px; }
