/* Макет: шапка з пошуком, на головній список категорій (колір = категорія), далі бренди та сітка товарів, окремий режим керування. */
:root {
  color-scheme: light;
  --page: #ffffff;
  --soft: #f3f5f9;
  --card: #ffffff;
  --ink: #151b2e;
  --muted: #565f7a;
  --line: #e1e5ee;
  --btn: #151b2e;
  --btn-ink: #ffffff;
  --focus: #2b50e3;
  --danger: #b82233;
  --danger-ink: #ffffff;
  --danger-soft: #fdebed;
  --backdrop: rgba(14, 18, 34, .55);
  --on-tint: #151b2e;
  --c0: #2b50e3; --c0-ink: #ffffff; --c0-tint: #e8edff;
  --c1: #ffb21c; --c1-ink: #241700; --c1-tint: #fff0cf;
  --c2: #c4215b; --c2-ink: #ffffff; --c2-tint: #fce6ef;
  --c3: #127246; --c3-ink: #ffffff; --c3-tint: #e0f2e8;
  --c4: #6239bb; --c4-ink: #ffffff; --c4-tint: #ede7fb;
  --c5: #07747d; --c5-ink: #ffffff; --c5-tint: #dcf1f3;
  --cn: #586179; --cn-ink: #ffffff; --cn-tint: #eef0f5;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* підкладка під темним значком: лише в темній темі, щоб його було видно */
  --plate: transparent; --plate-pad: 0px; --plate-radius: 0px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0e1222; --soft: #181d33; --card: #1a2037; --ink: #eef1fb; --muted: #a8b0ca; --line: #2d3456;
    --btn: #eef1fb; --btn-ink: #12172a; --focus: #96adff; --danger: #ff808b; --danger-ink: #2b070c; --danger-soft: #3c1a25;
    --backdrop: rgba(2, 4, 10, .72); --plate: #ffffff; --plate-pad: 4px; --plate-radius: 10px;
    --c0: #3557e6; --c0-tint: #d9e1fb; --c1: #f2a812; --c1-tint: #f6e3ba; --c2: #c92b64; --c2-tint: #f2d5e0; --c3: #177d52; --c3-tint: #cde7d9; --c4: #6f48c8; --c4-tint: #ddd4f3; --c5: #0b808a; --c5-tint: #c7e5e8; --cn: #5f6881; --cn-tint: #d8dce6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0e1222; --soft: #181d33; --card: #1a2037; --ink: #eef1fb; --muted: #a8b0ca; --line: #2d3456;
  --btn: #eef1fb; --btn-ink: #12172a; --focus: #96adff; --danger: #ff808b; --danger-ink: #2b070c; --danger-soft: #3c1a25;
  --backdrop: rgba(2, 4, 10, .72); --plate: #ffffff; --plate-pad: 4px; --plate-radius: 10px;
  --c0: #3557e6; --c0-tint: #d9e1fb; --c1: #f2a812; --c1-tint: #f6e3ba; --c2: #c92b64; --c2-tint: #f2d5e0; --c3: #177d52; --c3-tint: #cde7d9; --c4: #6f48c8; --c4-tint: #ddd4f3; --c5: #0b808a; --c5-tint: #c7e5e8; --cn: #5f6881; --cn-tint: #d8dce6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
img { max-width: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--page); z-index: 40; }
html:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1160px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) { .wrap { padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); } }
.muted { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* кольори категорій */
.k0 { --dept: var(--c0); --dept-ink: var(--c0-ink); --tint: var(--c0-tint); }
.k1 { --dept: var(--c1); --dept-ink: var(--c1-ink); --tint: var(--c1-tint); }
.k2 { --dept: var(--c2); --dept-ink: var(--c2-ink); --tint: var(--c2-tint); }
.k3 { --dept: var(--c3); --dept-ink: var(--c3-ink); --tint: var(--c3-tint); }
.k4 { --dept: var(--c4); --dept-ink: var(--c4-ink); --tint: var(--c4-tint); }
.k5 { --dept: var(--c5); --dept-ink: var(--c5-ink); --tint: var(--c5-tint); }
.kn { --dept: var(--cn); --dept-ink: var(--cn-ink); --tint: var(--cn-tint); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dept); flex: none; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--btn); color: var(--btn-ink); font-weight: 600; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--soft); }
.btn.danger { background: var(--danger); color: var(--danger-ink); }
.btn.warn { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.warn:hover:not(:disabled) { background: var(--danger-soft); }
.btn.small { min-height: 38px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0; flex: none; }
a.btn { text-decoration: none; }

/* шапка */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--page); border-bottom: 1px solid var(--line); }
.top-row { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; grid-template-areas: "brand search tools"; align-items: center; gap: 10px 24px; padding-block: 12px; }
.brand { grid-area: brand; display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.mark { display: grid; grid-template-columns: repeat(2, 13px); gap: 3px; flex: none; }
.mark i { width: 13px; height: 13px; border-radius: 4px; background: var(--dept); }
/* власний значок у своїх пропорціях: квадратний 40×40, широкий логотип ширший */
.brand-icon { height: 40px; width: auto; max-width: 180px; flex: none; object-fit: contain; }
.brand-icon.boxed { border-radius: 10px; }
.brand-icon.plated, .icon-preview img.plated, .logo-art.plated { background: var(--plate); padding: var(--plate-pad); border-radius: var(--plate-radius); }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { grid-area: search; position: relative; justify-self: end; width: min(100%, 420px); }
.search input { width: 100%; height: 44px; border-radius: 999px; border: 1px solid transparent; background: var(--soft); padding: 0 16px 0 44px; }
.search svg { position: absolute; left: 16px; top: 12px; color: var(--muted); pointer-events: none; }
.tools { grid-area: tools; justify-self: end; }
@media (max-width: 719px) {
  .top-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand tools" "search search"; column-gap: 12px; padding-block: 10px; }
  .search { width: 100%; }
  .brand-icon { height: 36px; max-width: 150px; flex: 0 1 auto; min-width: 0; }
  .brand-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
}
/* поруч із широким логотипом назві та пошуку тісно: на вузькому екрані назву читає лише екранний диктор */
@media (max-width: 799px) {
  .brand.wide .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* вітрина */
.notice { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.intro { padding-top: 36px; }
.intro h1 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 4.2vw, 44px); line-height: 1.16; letter-spacing: -.01em; margin: 0; max-width: 22ch; text-wrap: balance; overflow-wrap: anywhere; }
.intro p { margin: 14px 0 0; color: var(--muted); font-size: 17px; max-width: 60ch; }
.catalog { padding-block: 32px 64px; }
.crumbs { margin: -6px 0 14px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 9px; list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 14px; }
.crumbs li { display: flex; align-items: center; gap: 9px; min-width: 0; }
.crumbs li + li::before { content: "›"; }
.crumbs a { display: inline-block; padding-block: 6px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 20px; }
.bar h2 { font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.3; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sortbar { display: flex; max-width: 100%; min-width: 0; }
.sortbar .inline-field { flex-wrap: wrap; row-gap: 6px; }
.sortbar .inline-field .input { flex: 0 1 auto; max-width: 100%; min-height: 40px; padding-block: 0; border-radius: 999px; }

/* головна: категорії списком, рядок у кольорі категорії */
.catlist { display: flex; flex-direction: column; gap: 10px; max-width: 720px; list-style: none; margin: 0; padding: 0; }
.catrow { display: flex; align-items: center; gap: 16px; min-height: 76px; padding: 12px 18px 12px 24px; border-radius: 20px; background: var(--tint); text-decoration: none; }
.cat-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.cat-name { font-size: 19px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.cat-count { color: var(--muted); font-size: 14px; }
.cat-go { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--dept); color: var(--dept-ink); transition: transform .2s ease; }
.catrow:hover .cat-go { transform: translateX(4px); }
/* у темній темі рядок приглушений: колір категорії, змішаний із тлом сторінки */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .catrow { background: var(--soft); background: color-mix(in srgb, var(--dept) 22%, var(--page)); }
}
:root[data-theme="dark"] .catrow { background: var(--soft); background: color-mix(in srgb, var(--dept) 22%, var(--page)); }
@media (max-width: 599px) {
  .catrow { gap: 12px; min-height: 68px; padding: 10px 12px 10px 18px; border-radius: 16px; }
  .cat-name { font-size: 17px; }
  .cat-go { width: 34px; height: 34px; }
}

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 20px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 899px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; } }
@media (max-width: 339px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.grid li { min-width: 0; }
.card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; border-radius: 22px; }
.shot { display: grid; place-items: center; position: relative; overflow: hidden; aspect-ratio: 1; max-width: 100%; border-radius: 22px; color: var(--on-tint); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.card .shot img { transition: transform .25s ease; }
.card:hover .shot img { transform: scale(1.03); }
.card-text { display: flex; flex-direction: column; gap: 4px; padding-inline: 4px; }
.card-name { font-size: 17px; font-weight: 600; line-height: 1.32; overflow-wrap: anywhere; }
.card-price { font-size: 18px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card-sum { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 599px) { .card-name { font-size: 15px; } .card-price { font-size: 16px; } .card-sum { font-size: 13px; } .shot { border-radius: 18px; } }
/* тло лишається тільки там, де без нього нічого не видно: «Без фото» та прозорі картинки (темний товар губиться) */
.no-photo { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--tint); font-size: 13px; font-weight: 500; }
.no-photo > * { opacity: .5; }
.shot img.cutout, .thumb img.cutout { background: var(--tint); }

/* бренди категорії: логотип без рамки, під ним назва та кількість товарів */
.brandlist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 20px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 899px) { .brandlist { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 14px; } }
@media (max-width: 599px) { .brandlist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; } }
.brandlist li { min-width: 0; }
.maker { display: flex; flex-direction: column; gap: 4px; text-decoration: none; border-radius: 18px; }
.maker-logo { display: block; position: relative; overflow: hidden; aspect-ratio: 3 / 2; margin-bottom: 6px; border-radius: 18px; color: var(--on-tint); }
.maker-logo img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; transition: transform .25s ease; }
.maker:hover .maker-logo img { transform: scale(1.04); }
.maker-logo img.boxed { background: var(--plate); padding: var(--plate-pad); border-radius: 10px; }
/* без фото бренду замість логотипа перша літера назви */
.maker-letter { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; background: var(--tint); font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1; }
.maker-letter > * { opacity: .5; }
.maker-name { padding-inline: 4px; font-size: 17px; font-weight: 600; line-height: 1.32; overflow-wrap: anywhere; }
.maker:hover .maker-name { text-decoration: underline; text-underline-offset: 3px; }
.maker-count { padding-inline: 4px; color: var(--muted); font-size: 14px; }
@media (max-width: 599px) { .maker-name { font-size: 15px; } .maker-count { font-size: 13px; } .maker-logo { border-radius: 14px; } }
.more { display: flex; justify-content: center; margin: 34px 0 0; }
.more .btn { max-width: 100%; white-space: normal; text-align: center; padding-block: 8px; }

.skel { aspect-ratio: 1; border-radius: 22px; background: var(--soft); animation: pulse 1.2s ease-in-out infinite alternate; }
.catlist .skel { aspect-ratio: auto; height: 76px; border-radius: 20px; }
@media (max-width: 599px) { .catlist .skel { height: 68px; border-radius: 16px; } }
@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }
.state { border: 1px dashed var(--line); border-radius: 22px; padding: 40px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.state strong { font-size: 18px; overflow-wrap: anywhere; }
.state p { margin: 0; max-width: 48ch; color: var(--muted); }
.state .btn { margin-top: 8px; }

.foot { border-top: 1px solid var(--line); padding-block: 26px 36px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; align-items: center; }
.foot strong { font-family: var(--display); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.contacts { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; min-width: 0; }
.contact { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.contact a { font-weight: 600; user-select: all; }
.contact.address { display: block; white-space: pre-line; line-height: 1.5; }

/* вікна */
dialog { border: 0; padding: 0; background: var(--card); color: var(--ink); border-radius: 26px; width: min(900px, calc(100% - 32px)); max-width: calc(100% - 32px); max-height: calc(100% - 32px); overflow: auto; overscroll-behavior: contain; box-shadow: 0 30px 80px rgba(5, 8, 20, .35); }
dialog::backdrop { background: var(--backdrop); }
dialog.narrow { width: min(480px, calc(100% - 32px)); }
@media (max-width: 719px) {
  dialog, dialog.narrow { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: calc(100% - 20px - env(safe-area-inset-top, 0px)); }
}
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); position: relative; }
.pd .shot { align-self: start; border-radius: 0; }
.pd-body { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 70px 32px 32px; min-width: 0; }
.pd-body h2 { font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1.28; margin: 0; overflow-wrap: anywhere; }
.pd-price { margin: 0; font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pd-close { position: absolute; top: 14px; right: 14px; }
/* категорія та бренд у вікні товару */
.pd-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; min-height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 500; white-space: nowrap; }
.chip > span:not([class]) { overflow: hidden; text-overflow: ellipsis; }
.pd-brand-logo { display: flex; flex: none; }
.pd-brand-logo:empty { display: none; }
.pd-brand-logo img { width: auto; height: 24px; max-width: 70px; object-fit: contain; }
.pd-brand-logo img.boxed { border-radius: 5px; }
/* логотип-напис уже містить назву: її лишаємо тільки для читачів екрана */
.chip.wordmark { position: relative; }
.chip.wordmark .pd-brand-logo img { height: 22px; max-width: 130px; }
.chip.wordmark #pdBrandName { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.desc { overflow-wrap: anywhere; }
.desc p { margin: 0 0 12px; }
.desc ul { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 7px; }
.desc li::marker { color: var(--muted); }
@media (max-width: 719px) {
  .pd { grid-template-columns: minmax(0, 1fr); padding-top: 60px; }
  .pd-close { top: 10px; right: 12px; }
  .pd-body { padding: 22px 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
}

.form-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px 0; }
.form-head h2 { font-family: var(--display); font-weight: 600; font-size: 20px; margin: 0; }
.form-body { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; padding: 20px 24px 8px; align-items: start; }
.form-body.single { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.form-fields { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.form-foot { display: flex; flex-direction: column; gap: 10px; position: sticky; bottom: 0; background: var(--card); padding: 12px 24px calc(20px + env(safe-area-inset-bottom, 0px)); }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 719px) { .form-body { grid-template-columns: minmax(0, 1fr); padding-inline: 20px; } .form-head, .form-foot { padding-inline: 20px; } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 14px; padding: 0; }
legend.label { margin-bottom: 6px; }
.input { width: 100%; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 12px; }
.input:hover { border-color: var(--muted); }
textarea.input { min-height: 190px; resize: vertical; line-height: 1.5; }
@media (max-width: 719px) { .input, .search input { font-size: 16px; } }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 12px; margin: 0; font-weight: 500; }

.drop { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; aspect-ratio: 1; max-width: 100%; border: 2px dashed var(--line); border-radius: 20px; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--focus); background: var(--soft); }
.drop.has:not(.over) { border-color: transparent; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 18px; }
.drop img.cutout { background: var(--c0-tint); }
@media (max-width: 719px) { .drop { aspect-ratio: 16 / 10; } }
.drop.logo-drop { aspect-ratio: 16 / 9; }
.drop.logo-drop img { inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); border-radius: 10px; }
.pick { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pick .input { flex: 1; }
.pick-logo { position: relative; flex: none; width: 66px; height: 44px; }
.pick-logo:empty { display: none; }
.pick-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pick-logo img.boxed { border-radius: 8px; }
.drop-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.confirm { display: flex; flex-direction: column; gap: 14px; padding: 24px 24px calc(22px + env(safe-area-inset-bottom, 0px)); }
.confirm h2 { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.35; margin: 0; overflow-wrap: anywhere; }
.confirm p { margin: 0; overflow-wrap: anywhere; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choices:empty { display: none; }
.choice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); }
.choice input { margin-top: 4px; accent-color: var(--focus); }

/* панель керування */
.admin { max-width: 1000px; padding-block: 32px 72px; }
.admin h1 { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3.4vw, 30px); line-height: 1.25; margin: 0; }
.lead { margin: 8px 0 22px; color: var(--muted); }
.admin .notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: -6px 0 22px; }
.tabs { display: flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 15px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 24px; }
.tab { border: 0; background: transparent; min-height: 40px; padding: 0 15px; border-radius: 11px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(8, 12, 28, .16); }
.tab span { font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 359px) { .tab { padding: 0 9px; font-size: 15px; } }
/* чотири вкладки на телефоні стають у два ряди, нічого не ховається за краєм */
@media (max-width: 479px) { .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; } }
.admin-bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.inline-field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inline-field .input { width: auto; max-width: 240px; }
.rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.thumb { width: 60px; height: 60px; flex: none; position: relative; overflow: hidden; display: grid; place-items: center; border-radius: 13px; color: var(--on-tint); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.thumb .no-photo span { display: none; }
.thumb .maker-letter { font-size: 20px; }
.thumb.logo-thumb { width: 88px; }
.big-dot { width: 22px; height: 22px; border-radius: 7px; background: var(--dept); flex: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 8px; flex: none; }
.row-price { margin-right: 9px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.row-cat { display: flex; align-items: center; gap: 7px; min-width: 0; }
.row-brand, .row-views { margin-left: 9px; }
.row-views { white-space: nowrap; }
@media (max-width: 599px) { .row-brand, .row-views { margin-left: 0; } }
@media (max-width: 599px) {
  .row { gap: 10px; padding-inline: 10px; }
  .row-actions .btn.iconic { width: 40px; padding: 0; }
  .row-actions .btn.iconic span { display: none; }
  .thumb { width: 52px; height: 52px; }
  .thumb.logo-thumb { width: 66px; }
}
.cat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px 20px; align-items: end; background: var(--soft); border-radius: 18px; padding: 16px; margin-bottom: 18px; }
.cat-form .error { grid-column: 1 / -1; }
@media (max-width: 719px) { .cat-form { grid-template-columns: minmax(0, 1fr); align-items: stretch; } }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 44px; padding-inline: 4px; }
.swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--dept); cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 6px; }
.cat-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; }
.cat-edit .input { flex: 1 1 220px; }
.cat-edit .error { flex-basis: 100%; }
.shop-form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.shop-form textarea.input { min-height: 90px; }
.icon-field { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.icon-preview { height: 64px; min-width: 64px; max-width: 100%; flex: none; display: grid; grid-template-columns: minmax(0, auto); place-content: center; place-items: center; padding: 0 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.icon-preview img { height: 46px; width: auto; max-width: 100%; object-fit: contain; }
.icon-preview img.boxed { border-radius: 8px; }
.icon-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 180px; }
.shop-form .btn { align-self: flex-start; }
.pass-form { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.pass-form h2 { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.35; margin: 0; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }

/* вхід у панель */
.login { max-width: 460px; padding-block: 40px 72px; }
.login-card { display: flex; flex-direction: column; gap: 16px; background: var(--soft); border-radius: 22px; padding: 26px 22px; }
.login-card h1 { font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.35; margin: 0 0 4px; }
.login-card .input { background: var(--page); }
.password { display: flex; gap: 8px; }
.password .input { flex: 1; }
.password .btn { flex: none; min-width: 96px; min-height: 44px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; background: var(--btn); color: var(--btn-ink); border-radius: 14px; padding: 12px 18px; font-weight: 600; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 12px 32px rgba(5, 8, 20, .3); }

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