/* «Каталог → Тони» й «Назви зразків» — стилі (етап 3 меню; public/library.js); лише під html.v8.
   Плитки тонів — як викраски у «Відправці зразків» (public/v8.css, .sh-tn): на телефоні по 3 в рядку, назви цілі, перенос лише після двокрапки. */
html.v8 .lb { --sm-ink: #1E2A4A; --sm-ink2: #586B82; --sm-mute: #8A9BB3; --sm-well: #E4E8EE; --sm-shadow: 0 8px 24px rgba(30, 42, 74, .08); display: flex; flex-direction: column; gap: 12px; min-width: 0; color: var(--ink); }
html.v8 .lb .sm-sub { max-width: 720px; }
html.v8 .lb-results, html.v8 .lb-slot { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* пошук: на всю ширину на телефоні, 16 px — щоб iPhone не збільшував сторінку */
html.v8 .lb .sm-srch.lb-srch { flex: none; width: 100%; max-width: 520px; min-width: 0; height: 44px; margin: 0; padding: 0 16px; border-radius: 22px; color: var(--ink-3); }
html.v8 .lb .sm-srch.lb-srch input.sm-search:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { font-size: 15px; color: var(--ink); }
html.v8 .lb-i { flex: none; }

html.v8 .lb-cap { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
html.v8 .lb-cap.lb-warn { color: #9A4B00; font-weight: 600; }
html.v8 .lb-hint { margin: 0; padding: 2px 4px; font-size: 13px; line-height: 1.5; color: var(--ink-2); max-width: 720px; }
html.v8 .lb-empty { padding: 4px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
html.v8 .lb-a { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
html.v8 .lb-a:hover { text-decoration: underline; }
html.v8 .lb-a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- «Тони» ---------- */
html.v8 .lb-group { display: flex; flex-direction: column; gap: 10px; }
html.v8 .lb-gh { display: flex; align-items: baseline; gap: 8px; }
html.v8 .lb-gh h3 { margin: 0; font-size: 16px; font-weight: 700; }
html.v8 .lb-n { font-size: 13px; font-weight: 600; color: var(--ink-3); }
html.v8 .lb-lead { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); max-width: 720px; }
html.v8 .lb-tones { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
html.v8 .lb-tn { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; min-height: 104px; box-sizing: border-box; padding: 12px 6px 10px; border: 0; border-radius: 14px; background: var(--surface-2); font: inherit; font-size: 13px; line-height: 1.25; color: var(--ink); text-align: center; cursor: pointer; }
html.v8 .lb-tn:hover { background: var(--v8-well); }
html.v8 .lb-tn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.v8 .lb-sws { display: flex; justify-content: center; gap: 6px; margin-bottom: 2px; }
html.v8 .lb-sw { position: relative; display: inline-flex; flex: none; box-sizing: border-box; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: #E4E8EE; border: 1px solid rgba(30, 42, 74, .18); }
html.v8 .lb-sw img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.v8 .lb-sw.big { width: 96px; height: 96px; }
html.v8 .lb-tn-c { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); }
html.v8 .lb-tn-l { display: block; max-width: 100%; font-weight: 600; overflow-wrap: normal; word-break: normal; hyphens: manual; }
html.v8 .lb-tn-l.long { font-size: 12px; letter-spacing: -.02em; }
html.v8 .lb-tn-w { font-size: 11px; color: var(--ink-3); }

/* тон крупно: шторка знизу на телефоні, вікно посередині на планшеті й ПК */
html.v8 .lb-sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
html.v8 .lb-dim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(30, 42, 74, .45); }
html.v8 .lb-sheet .lb-card { position: relative; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; margin: 0; box-shadow: 0 24px 60px rgba(30, 42, 74, .28); }
html.v8 .lb-sh-top { display: flex; align-items: flex-start; gap: 12px; }
html.v8 .lb-sh-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html.v8 .lb-sh-f { font-size: 12px; font-weight: 600; color: var(--ink-3); }
html.v8 .lb-sh-t h3 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; }
html.v8 .lb-x { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 20px; background: #fff; color: var(--ink-2); box-shadow: var(--shadow); cursor: pointer; }
html.v8 .lb-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.v8 .lb-big { display: flex; flex-wrap: wrap; gap: 16px 24px; }
html.v8 .lb-fig { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; min-width: 96px; }
html.v8 .lb-fig figcaption { font-size: 13px; font-weight: 600; color: var(--ink-2); }
html.v8 .lb-full { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; font-size: 13px; }

/* ---------- «Назви зразків» ---------- */
html.v8 .lb-sum { display: flex; flex-direction: column; gap: 10px; }
html.v8 .lb-sum-n { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
html.v8 .lb-sum-n b { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
html.v8 .lb-sum-n span { font-size: 14px; color: var(--ink-2); }
html.v8 .lb-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
html.v8 .lb-sum .lb-cap { max-width: 720px; }
html.v8 .lb-kind { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--v8-well); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
html.v8 .lb-list { display: flex; flex-direction: column; padding: 4px 0; }
html.v8 .lb-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 18px; border-top: 1px solid var(--line); }
html.v8 .lb-row:first-child { border-top: 0; }
html.v8 .lb-row-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
html.v8 .lb-row-t b { font-weight: 700; }
html.v8 .lb-row-c { font-size: 12px; color: var(--ink-3); }

@media (min-width: 768px) {
  html.v8 .lb-sheet { align-items: center; }
}
@media (min-width: 1180px) {
  html.v8 .lb-tones { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; }
  html.v8 .lb-sw { width: 48px; height: 48px; }
  html.v8 .lb-sw.big { width: 96px; height: 96px; }
}
@media (max-width: 767px) {
  html.v8 .lb .sm-srch.lb-srch { max-width: none; }
  html.v8 .lb .sm-srch.lb-srch input.sm-search:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { font-size: 16px; }
  html.v8 .lb-group { padding: 14px 12px 14px; }
  html.v8 .lb-gh, html.v8 .lb-lead { padding: 0 4px; }
  html.v8 .lb-tones { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  html.v8 .lb-tn { min-height: 96px; padding: 10px 2px 8px; font-size: 12px; }
  html.v8 .lb-tn-l.long { font-size: 11px; }
  html.v8 .lb-sw { width: 40px; height: 40px; }
  html.v8 .lb-sw.big { width: 88px; height: 88px; }
  html.v8 .lb-row { padding: 10px 16px; }
}
