/* «Фото виробів» — стилі екрана менеджерки (public/photos.js; макет — docs/plans/zbirka-foto-maket.jpg); лише класи .ph-, лише під html.v8.
   Старий Safari (iPad на iPadOS 14, старі iPhone): без gap у flex — відступи полями; inset — чотирма сторонами;
   sticky — з -webkit-sticky перед собою; пропорції фото — через padding-top, не aspect-ratio. */
html.v8 .ph { display: block; min-width: 0; color: var(--ink); }
html.v8 .ph > * + * { margin-top: 12px; }
html.v8 .ph.has-bar { padding-bottom: 96px; }
html.v8 .ph.has-done { padding-bottom: 190px; }
html.v8 .ph-i { flex: none; display: block; }

/* ---------- заголовок ---------- */
html.v8 .ph-head { display: block; }
html.v8 .ph-eyebrow { display: block; margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
html.v8 .ph-head .ph-h { margin: 0; }
html.v8 .ph-head .ph-lead { margin: 6px 0 0; max-width: 620px; }

/* ---------- поля пошуку: на телефоні — рядки картки, на ПК — три поля поруч ---------- */
html.v8 .card.ph-filters { padding: 4px 16px 14px; }
html.v8 .ph-fields { display: block; }
html.v8 .ph-frow { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
html.v8 .ph-field { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; min-height: 50px; margin: 0; padding: 6px 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html.v8 .ph-fl { flex: 0 0 72px; font-size: 13px; color: var(--ink-2); }
html.v8 .ph-fv { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; font-size: 15px; font-weight: 600; }
html.v8 .ph-fv-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.v8 .ph-field:not(.set) .ph-fv { font-weight: 400; color: var(--ink-3); }
html.v8 .ph-fv-c { flex: none; margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
html.v8 .ph-fn { flex: none; margin-left: 8px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
html.v8 .ph-field > .ph-i { margin-left: 4px; color: var(--ink-3); }
html.v8 .ph-field:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
html.v8 .ph-fx { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0 0 0 6px; padding: 0; border: 0; border-radius: 15px; background: var(--v8-well); color: var(--ink-2); cursor: pointer; }
html.v8 .ph-fx:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* кружечок тону: справжній шматочок зразка (public/img/tones/), поки вантажиться — колір із бібліотеки */
html.v8 .ph-dot { position: relative; display: inline-block; flex: none; box-sizing: border-box; width: 14px; height: 14px; margin-right: 6px; border-radius: 50%; overflow: hidden; background: #E4E8EE; border: 1px solid rgba(30, 42, 74, .16); vertical-align: -2px; }
html.v8 .ph-dot img, html.v8 .ph-sw img { display: block; width: 100%; height: 100%; object-fit: cover; }
html.v8 .ph-fdot { width: 20px; height: 20px; margin-right: 8px; }
html.v8 .ph-dot.none, html.v8 .ph-sw.none { background: #fff; border: 1.5px dashed rgba(30, 42, 74, .3); }

/* дерево — чипи */
html.v8 .ph-wood { display: flex; align-items: flex-start; padding-top: 12px; }
html.v8 .ph-wood > .ph-fl { padding-top: 7px; }
html.v8 .ph-chips { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; margin: 0 -6px -6px 0; }
html.v8 .ph-chip { flex: none; display: inline-flex; align-items: center; min-height: 32px; margin: 0 6px 6px 0; padding: 0 12px; border: 0; border-radius: 16px; background: var(--v8-well); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
html.v8 .ph-chip[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent-strong); }
html.v8 .ph-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- підказка, стани ---------- */
html.v8 .ph-hint { display: block; padding: 22px 18px 20px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: center; }
html.v8 .ph-hint > b { display: block; font-size: 16px; font-weight: 700; }
html.v8 .ph-hint-t { display: block; max-width: 460px; margin: 4px auto 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
html.v8 .ph-pop { display: flex; flex-wrap: wrap; justify-content: center; margin: 14px -6px -6px 0; }
html.v8 .ph-pop + .ph-pop { margin-top: 12px; }
html.v8 .ph-chip-tone .ph-dot { width: 16px; height: 16px; margin-right: 7px; }
html.v8 .ph-status { margin: 0; padding: 12px 4px; font-size: 13px; color: var(--ink-2); }
html.v8 .ph-cap { margin: 0; padding: 0 4px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
html.v8 .ph-bad { color: var(--bad); font-weight: 600; }
html.v8 .ph-errbox p { margin: 0 0 8px; }
html.v8 .ph-results { display: block; transition: opacity .15s; }
html.v8 .ph-results > * + * { margin-top: 18px; }
html.v8 .ph-results.ph-wait { opacity: .5; }

/* ---------- групи ---------- */
html.v8 .ph-group > * + * { margin-top: 10px; }
html.v8 .ph-gh { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
html.v8 .ph-gh h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-2); }
html.v8 .ph-gn { flex: none; margin-left: 8px; font-size: 15px; font-weight: 700; color: var(--accent-strong); }
html.v8 .ph-more { display: block; width: 100%; min-height: 44px; margin-top: 12px; border: 0; border-radius: 14px; background: var(--accent-wash); color: var(--accent-strong); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
html.v8 .ph-more[disabled] { opacity: .6; cursor: default; }

/* обкладинка: фото на всю площу, обрізане за меншою стороною */
html.v8 .ph-cov { position: relative; display: block; overflow: hidden; background: var(--v8-well); }
html.v8 .ph-cov img, html.v8 .ph-cov .ph-noimg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
html.v8 .ph-noimg { display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
html.v8 img.ph-broken { visibility: hidden; }
html.v8 .ph-badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 10px; background: var(--accent-strong); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.3; }

html.v8 .ph-title { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--ink); }
html.v8 .ph-sub { display: flex; align-items: center; min-width: 0; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--ink-2); }
html.v8 .ph-sub > span:last-child { min-width: 0; }
html.v8 .ph-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-2); }
html.v8 .ph-order { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); }

/* «Точно» — великі картки: на телефоні фото зліва, текст справа */
html.v8 .ph-bigs { display: flex; flex-wrap: wrap; margin: 0 -10px -10px 0; }
/* картка — обгортка .ph-cw: усередині кнопка «відкрити альбом» і кнопка «Обрати всі» (кнопка в кнопці не працює) */
html.v8 .ph-cw { position: relative; flex: 0 0 auto; display: block; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
html.v8 .ph-cw-big { width: calc(100% - 10px); margin: 0 10px 10px 0; border-radius: 18px; }
html.v8 .ph-cw-sm { width: calc(50% - 8px); margin: 0 8px 8px 0; border-radius: 14px; }
html.v8 .ph-big { display: flex; align-items: stretch; width: 100%; min-height: 150px; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
html.v8 .ph-big > .ph-cov { flex: 0 0 44%; width: 44%; }
html.v8 .ph-big-t { flex: 1 1 auto; min-width: 0; display: block; padding: 12px 14px; }
html.v8 .ph-big .ph-title { font-size: 16px; }
html.v8 .ph-big .ph-sub, html.v8 .ph-big .ph-meta { font-size: 13px; margin-top: 4px; }
html.v8 .ph-big .ph-order { margin-top: 6px; font-size: 12px; }

/* інші групи — менші картки сіткою: фото зверху */
html.v8 .ph-smalls { display: flex; flex-wrap: wrap; margin: 0 -8px -8px 0; }
html.v8 .ph-sm { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
html.v8 .ph-sm > .ph-cov { height: 0; padding-top: 80%; }
html.v8 .ph-sm-t { display: block; padding: 7px 9px 9px; }
html.v8 .ph-sm .ph-title { font-size: 13px; }
html.v8 .ph-sm .ph-sub { align-items: flex-start; }
html.v8 .ph-sm .ph-sub .ph-dot { margin-top: 1px; }
html.v8 .ph-big:focus-visible, html.v8 .ph-sm:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* «Обрати всі»: м'який голубий (повторювана дія на картці); усі обрані — заливка й галочка. Велика картка — у правому нижньому куті тексту, мала — рядком унизу */
/* кнопка рядка: на телефоні — «Посилання», ширше — «Отримати посилання» */
html.v8 .ph-send .ph-send-l { display: none; }
html.v8 .ph-allc { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 34px; margin: 0; padding: 0 12px; border: 0; border-radius: 10px; background: var(--accent-wash); color: var(--accent-strong); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html.v8 .ph-allc.on { background: var(--accent-strong); color: #fff; }
html.v8 .ph-allc .ph-i { margin-right: 5px; }
html.v8 .ph-allc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.v8 .ph-cw-big .ph-allc { position: absolute; right: 12px; bottom: 12px; }
html.v8 .ph-cw-big .ph-big-t { padding-bottom: 54px; }   /* телефон: картка горизонтальна, кнопці — місце внизу тексту */
html.v8 .ph-cw-sm .ph-allc { display: flex; width: calc(100% - 18px); margin: 0 9px 9px; }

/* ---------- альбом ---------- */
html.v8 .ph-ah { display: flex; align-items: flex-start; }
html.v8 .ph-back { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -4px 6px 0 -8px; padding: 0; border: 0; border-radius: 20px; background: none; color: var(--accent-strong); cursor: pointer; }
html.v8 .ph-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.v8 .ph-ah-t { flex: 1 1 auto; min-width: 0; }
html.v8 .ph-ah-t h2 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; overflow-wrap: break-word; }
html.v8 .ph-ah-t p { margin: 3px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
html.v8 .ph-ah-t p.ph-note { font-size: 12px; color: var(--ink-3); }
html.v8 .ph-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 8px; }
html.v8 .ph-link { min-height: 36px; margin: 0; padding: 0 2px; border: 0; background: none; color: var(--accent-strong); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
html.v8 .ph-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
html.v8 .ph-saved { flex: 1 1 auto; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--good); text-align: center; }

/* фото альбому: вертикальні 3:4, галочка справа вгорі, «роздивитись» — зліва внизу */
html.v8 .ph-photos { display: flex; flex-wrap: wrap; margin: 0 -8px -8px 0; }
html.v8 .ph-ph { flex: 0 0 auto; width: calc(50% - 8px); margin: 0 8px 8px 0; }
html.v8 .ph-ar { position: relative; height: 0; padding-top: 133.333%; }
html.v8 .ph-ph-b { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: 14px; background: var(--v8-well); overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html.v8 .ph-ph-b img, html.v8 .ph-ph-b .ph-noimg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
html.v8 .ph-ph-b::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 14px; box-shadow: inset 0 0 0 0 transparent; transition: box-shadow .12s; pointer-events: none; }
html.v8 .ph-ph.on .ph-ph-b::after { box-shadow: inset 0 0 0 3px var(--accent-strong); }
html.v8 .ph-ph-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.v8 .ph-chk { position: absolute; top: 8px; right: 8px; z-index: 1; display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 28px; height: 28px; border-radius: 14px; border: 2px solid #fff; background: rgba(30, 42, 74, .28); color: transparent; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
html.v8 .ph-ph.on .ph-chk { background: var(--accent-strong); color: #fff; }
html.v8 .ph-zoom { position: absolute; left: 8px; bottom: 8px; z-index: 1; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 18px; background: rgba(20, 28, 48, .55); color: #fff; cursor: pointer; }
html.v8 .ph-zoom:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* «Виправити позначки» */
html.v8 .card.ph-fix { display: block; padding: 16px; }
html.v8 .ph-fix > * + * { margin-top: 10px; }
html.v8 .ph-fix h3 { margin: 0; font-size: 16px; font-weight: 700; }
html.v8 .ph-fix .ph-cap { padding: 0; }
html.v8 .ph-fix-grid { display: flex; flex-wrap: wrap; margin: 0 -12px -10px 0; }
html.v8 .ph-lab { display: block; flex: 0 0 auto; width: calc(100% - 12px); margin: 0 12px 10px 0; }
html.v8 .ph-lab > span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
html.v8 .ph-fix .ph-in { display: block; width: 100%; box-sizing: border-box; min-height: 42px; }
html.v8 .ph-fix select.ph-in { padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: none; font-weight: 400; color: var(--ink); }
html.v8 .ph-err { margin: 0; font-size: 13px; font-weight: 600; color: var(--bad); }
html.v8 .ph-fix-btns { display: flex; flex-wrap: wrap; }
html.v8 .ph-fix-btns > * + * { margin-left: 8px; }
html.v8 .ph-fix-btns .btn { min-height: 44px; padding: 0 18px; }

/* ---------- рядок «Обрано N фото · Надіслати»: над панеллю знизу (телефон, планшет), на ПК — липкий унизу робочої частини ---------- */
html.v8 .ph-bar-slot { position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 45; max-width: 720px; margin: 0 auto; }
html.v8 .ph-bar-slot:empty { display: none; }
html.v8 .ph-bar { display: flex; align-items: center; box-sizing: border-box; min-height: 64px; padding: 10px 10px 10px 16px; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(30, 42, 74, .22); }
html.v8 .ph-bar-t { flex: 1 1 auto; min-width: 0; }
html.v8 .ph-bar-t b { display: block; font-size: 15px; font-weight: 700; }
html.v8 .ph-bar-t span { display: block; margin-top: 1px; font-size: 12px; line-height: 1.35; color: var(--ink-2); }
html.v8 .ph-bar.note .ph-bar-t span { color: #9A4B00; font-weight: 600; }
html.v8 .ph-bar.err .ph-bar-t span { color: var(--bad); font-weight: 600; }
html.v8 .ph-clr { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0 8px; padding: 0; border: 0; border-radius: 18px; background: var(--v8-well); color: var(--ink-2); cursor: pointer; }
html.v8 .ph-clr:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.v8 .btn.ph-send { flex: none; min-height: 46px; padding: 0 20px; border-radius: 14px; font-size: 15px; }
html.v8 .ph-done { display: block; padding: 12px 12px 10px 16px; }
html.v8 .ph-done-h { display: flex; align-items: center; }
html.v8 .ph-done-h b { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; }
html.v8 .ph-done-h .ph-clr { margin-right: 0; }
html.v8 .ph-ok { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 12px; background: var(--good); color: #fff; font-size: 14px; font-weight: 700; }
html.v8 .ph-done-p { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
html.v8 .ph-done-l { display: flex; align-items: center; margin-top: 8px; }
html.v8 .ph-done .ph-url { flex: 1 1 auto; min-width: 0; min-height: 40px; margin-right: 8px; font-size: 13px; color: var(--ink); }
html.v8 .ph-copy { flex: none; min-height: 40px; margin: 0; padding: 0 14px; border: 0; border-radius: 12px; background: var(--accent-wash); color: var(--accent-strong); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
html.v8 .ph-copy.is-done { background: var(--good); color: #fff; }
html.v8 .ph-done .ph-open { margin-top: 2px; font-size: 13px; }

/* ---------- шторка вибору: знизу на телефоні, вікном посередині з 768 px ---------- */
html.v8 .ph-sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
html.v8 .ph-dim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(30, 42, 74, .45); }
html.v8 .ph-pick { position: relative; display: flex; flex-direction: column; box-sizing: border-box; width: 100%; max-width: 560px; max-height: 86vh; padding: 8px 0 calc(14px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 -8px 30px rgba(30, 42, 74, .22); }
html.v8 .ph-pick-h { flex: none; display: flex; align-items: flex-start; padding: 8px 12px 8px 20px; }
html.v8 .ph-pick-tt { flex: 1 1 auto; min-width: 0; }
html.v8 .ph-pick-tt h3 { margin: 0; font-size: 18px; font-weight: 700; }
html.v8 .ph-pick-tt span { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
html.v8 .ph-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 18px; background: var(--v8-well); color: var(--ink-2); cursor: pointer; }
html.v8 .ph-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.v8 .ph-pick-q { flex: none; display: flex; align-items: center; height: 42px; margin: 2px 16px 8px; padding: 0 14px; border-radius: 21px; background: var(--v8-well); color: var(--ink-3); }
html.v8 .ph-pick-q .ph-i { margin-right: 8px; }
html.v8 .ph-pick-q input.ph-q:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { flex: 1 1 auto; min-width: 0; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 16px; color: var(--ink); -webkit-appearance: none; }
html.v8 .ph-pick-q input.ph-q:focus-visible { outline: 0; }
html.v8 .ph-pick-q:focus-within { box-shadow: 0 0 0 2px var(--accent); }
html.v8 .ph-pick-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 8px; }
html.v8 .ph-opt { display: flex; align-items: center; width: 100%; min-height: 48px; margin: 0; padding: 0 12px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer; }
html.v8 .ph-opt.on { font-weight: 700; color: var(--accent-strong); background: var(--accent-wash); }
html.v8 .ph-opt-t { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
html.v8 .ph-opt-n { flex: none; margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--ink-3); }
html.v8 .ph-opt-s { flex: none; display: inline-flex; width: 16px; margin-left: 10px; color: var(--accent-strong); }
html.v8 .ph-opt:focus-visible, html.v8 .ph-tn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
html.v8 .ph-tgh { margin: 14px 12px 6px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
html.v8 .ph-tones { display: flex; flex-wrap: wrap; margin: 0 -6px -6px 4px; }
html.v8 .ph-tn { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; box-sizing: border-box; width: calc(33.333% - 6px); min-height: 104px; margin: 0 6px 6px 0; padding: 10px 4px 8px; border: 0; border-radius: 14px; background: var(--surface-2); font: inherit; font-size: 12px; line-height: 1.25; color: var(--ink); text-align: center; cursor: pointer; }
html.v8 .ph-tn.on { background: var(--accent-wash); box-shadow: inset 0 0 0 2px var(--accent-strong); }
html.v8 .ph-sw { position: relative; display: block; flex: none; box-sizing: border-box; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 50%; overflow: hidden; background: #E4E8EE; border: 1px solid rgba(30, 42, 74, .18); }
html.v8 .ph-tn-l { display: block; max-width: 100%; font-weight: 600; overflow-wrap: normal; word-break: normal; }
html.v8 .ph-tn-c { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); }

/* ---------- фото на весь екран ---------- */
html.v8 .ph-view { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 90; background: rgba(10, 14, 24, .95); color: #fff; }
html.v8 .ph-v-stage { position: absolute; top: 56px; right: 0; bottom: 80px; left: 0; display: flex; align-items: center; justify-content: center; }
html.v8 .ph-v-img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
html.v8 .ph-v-top { position: absolute; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 8px 0 18px; }
html.v8 .ph-v-n { font-size: 14px; font-weight: 600; }
html.v8 .ph-v-x, html.v8 .ph-v-nav { display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
html.v8 .ph-v-x { width: 40px; height: 40px; border-radius: 20px; }
html.v8 .ph-v-nav { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 22px; }
html.v8 .ph-v-nav.prev { left: 10px; }
html.v8 .ph-v-nav.next { right: 10px; }
html.v8 .ph-v-bot { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
html.v8 .ph-v-pick { display: inline-flex; align-items: center; min-height: 46px; margin: 0; padding: 0 20px 0 12px; border: 0; border-radius: 23px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
html.v8 .ph-v-pick .ph-chk { position: static; margin-right: 10px; border-color: rgba(30, 42, 74, .35); background: #fff; box-shadow: none; }
html.v8 .ph-v-pick.on { background: var(--accent-strong); color: #fff; }
html.v8 .ph-v-pick.on .ph-chk { border-color: #fff; background: #fff; color: var(--accent-strong); }
html.v8 .ph-v-x:focus-visible, html.v8 .ph-v-nav:focus-visible, html.v8 .ph-v-pick:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- наведення — лише там, де є миша (на телефоні «залипає» після дотику) ---------- */
@media (hover: hover) {
  html.v8 .ph-cw:hover { box-shadow: 0 10px 28px rgba(30, 42, 74, .14); }
  html.v8 .ph-allc:hover { background: #cfe2fb; }
  html.v8 .ph-allc.on:hover { background: var(--accent-strong); }
  html.v8 .ph-chip:hover { background: #DADFE6; }
  html.v8 .ph-chip[aria-pressed="true"]:hover { background: var(--v8-act-soft-hover); }
  html.v8 .ph-more:not([disabled]):hover, html.v8 .ph-copy:not(.is-done):hover { background: var(--v8-act-soft-hover); }
  html.v8 .ph-opt:hover { background: var(--surface-2); }
  html.v8 .ph-opt.on:hover { background: var(--v8-act-soft-hover); }
  html.v8 .ph-tn:hover { background: var(--v8-well); }
  html.v8 .ph-link:hover { text-decoration: underline; }
  html.v8 .ph-v-x:hover, html.v8 .ph-v-nav:hover { background: rgba(255, 255, 255, .26); }
}

/* ---------- ширше: планшет і ПК (на телефоні малі картки — по дві: фото більші, назви кольорів цілі) ---------- */
@media (min-width: 600px) {
  html.v8 .ph-send .ph-send-l { display: inline; }
  html.v8 .ph-send .ph-send-s { display: none; }
  html.v8 .ph-cw-big { width: calc(50% - 10px); }
  html.v8 .ph-cw-sm { width: calc(33.333% - 8px); }
  html.v8 .ph-ph { width: calc(33.333% - 8px); }
  html.v8 .ph-lab { width: calc(50% - 12px); }
  html.v8 .ph-tn { width: calc(25% - 6px); }
}
@media (min-width: 768px) {
  html.v8 .ph-sheet { align-items: center; padding: 24px; }
  html.v8 .ph-pick { max-height: 80vh; padding-bottom: 12px; border-radius: 20px; box-shadow: 0 24px 60px rgba(30, 42, 74, .28); }
  html.v8 .ph-v-nav { width: 52px; height: 52px; margin-top: -26px; border-radius: 26px; }
  html.v8 .ph-v-nav.prev { left: 20px; }
  html.v8 .ph-v-nav.next { right: 20px; }
}
@media (min-width: 900px) {
  /* три поля поруч, підпис над значенням */
  html.v8 .card.ph-filters { padding: 14px 16px 12px; }
  html.v8 .ph-fields { display: flex; margin-right: -10px; }
  html.v8 .ph-frow { flex: 1 1 0%; min-width: 0; margin-right: 10px; padding: 0 8px 0 14px; border: 0; border-radius: 14px; background: var(--surface-2); }
  html.v8 .ph-field { flex-wrap: wrap; align-content: center; min-height: 60px; padding: 8px 0; }
  html.v8 .ph-field > .ph-fl { flex: 0 0 100%; margin-bottom: 2px; font-size: 12px; }
  html.v8 .ph-wood { padding-top: 14px; }
  html.v8 .ph-cw-big { width: calc(33.333% - 10px); }
  html.v8 .ph-big { flex-direction: column; min-height: 0; }
  html.v8 .ph-big > .ph-cov { flex: none; width: 100%; height: 0; padding-top: 75%; }
  html.v8 .ph-big-t { padding: 12px 14px 14px; }
  /* ПК: «Обрати всі» — праворуч від рядків місяця й номера (Микола показав стрілками), без окремого рядка */
  html.v8 .ph-cw-big .ph-big-t { padding-bottom: 14px; }
  html.v8 .ph-cw-big .ph-sub, html.v8 .ph-cw-big .ph-meta, html.v8 .ph-cw-big .ph-order { padding-right: 112px; }
  html.v8 .ph-cw-sm { width: calc(25% - 8px); }
  html.v8 .ph-ph { width: calc(25% - 8px); }
  html.v8 .ph-ah-t h2 { font-size: 24px; }
  html.v8 .ph-lab { width: calc(25% - 12px); }
}
@media (min-width: 1180px) {
  /* ПК: панелі знизу немає — рядок липне до низу робочої частини */
  html.v8 .ph.has-bar, html.v8 .ph.has-done { padding-bottom: 0; }
  html.v8 .ph-bar-slot { position: -webkit-sticky; position: sticky; left: auto; right: auto; bottom: 16px; max-width: none; margin: 16px 0 0; }
  html.v8 .ph-bar { max-width: 760px; margin: 0 auto; }
  html.v8 .ph-head .ph-h { font-size: 34px; }
}
@media (min-width: 1400px) {
  html.v8 .ph-cw-sm { width: calc(20% - 8px); }
  html.v8 .ph-ph { width: calc(20% - 8px); }
}
@media (min-width: 1700px) {
  html.v8 .ph-cw-big { width: calc(25% - 10px); }
}
/* телефон: поля від 16 px — інакше iPhone збільшує сторінку, щойно торкнулись поля */
@media (max-width: 767px) {
  html.v8 .ph-fix input.ph-in:not([type="checkbox"]):not([type="radio"]):not([type="file"]), html.v8 .ph-fix select.ph-in, html.v8 .ph-done input.ph-url:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html.v8 .ph-results, html.v8 .ph-ph-b::after { transition: none; }
}
