:root {
    --bg: #0f1115;
    --bg-soft: #171a21;
    --panel: #1d2129;
    --border: #2a2f3a;
    --text: #e6e8ec;
    --muted: #8b93a7;
    --accent: #7c5cff;
    --accent-2: #27d5c4;
    --error: #ff6b6b;
    --radius: 12px;
    --shadow: 0 10px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: radial-gradient(1200px 600px at 20% -10%, rgba(124,92,255,.15), transparent 60%),
                radial-gradient(900px 500px at 110% 10%, rgba(39,213,196,.10), transparent 60%),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Auth page ---------- */
body.auth {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 28px;
}

.brand {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .5px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 20px rgba(124,92,255,.35);
}

.brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .2px;
}

.tagline {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

input[type=text], input[type=password] {
    width: 100%;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

input[type=text]:focus, input[type=password]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,92,255,.25);
}

button[type=submit] {
    margin-top: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .05s, filter .15s;
}
button[type=submit]:hover { filter: brightness(1.08); }
button[type=submit]:active { transform: translateY(1px); }

.error {
    background: rgba(255,107,107,.08);
    border: 1px solid rgba(255,107,107,.3);
    color: var(--error);
    font-size: 13px;
    border-radius: 8px;
    padding: 8px 12px;
}

.foot {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

/* ---------- Dashboard ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(23,26,33,.7);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-sm {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.topbar nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.user { color: var(--muted); font-size: 14px; }

.btn-ghost {
    color: var(--text);
    background: transparent;
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(124,92,255,.08); }

.stub {
    max-width: 720px;
    margin: 48px auto;
    padding: 0 24px;
}

.stub h1 {
    font-size: 28px;
    margin: 0 0 10px;
}

.stub p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.roadmap {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.roadmap li {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.roadmap .step {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* =================== Products page =================== */
.topbar-sep { color: var(--border); margin: 0 4px; }
.topbar-section { color: var(--muted); font-size: 14px; }

.source-tag {
    color: var(--muted);
    font-size: 12px;
    padding: 4px 10px;
    border: 1px dashed var(--border);
    border-radius: 999px;
}
.source-tag strong { color: var(--accent-2); }

.page {
    max-width: 1680px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

/* ---- tiles ---- */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}
.tile {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
}
.tile__num { font-size: 17px; font-weight: 700; letter-spacing: .2px; line-height: 1.15; }
.tile__lbl { color: var(--muted); font-size: 11px; margin-top: 1px; }
.tile--ok   { border-color: rgba(39,213,196,.35); }
.tile--ok   .tile__num { color: var(--accent-2); }
.tile--bad  { border-color: rgba(255,107,107,.35); }
.tile--bad  .tile__num { color: var(--error); }
.tile--warn { border-color: rgba(255,183,77,.35); }
.tile--warn .tile__num { color: #ffb74d; }
.tile--hot {
    text-decoration: none;
    color: inherit;
    border-color: rgba(255,107,107,.45);
    background: linear-gradient(135deg, rgba(255,107,107,.10), rgba(255,140,66,.06) 70%, var(--panel));
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.tile--hot:hover { border-color: var(--error); }
.tile--hot .tile__num {
    background: linear-gradient(135deg, var(--error), #ff8c42);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tile--hot .tile__lbl {
    color: var(--error);
    font-weight: 700;
    letter-spacing: .3px;
}
.tile--money {
    text-decoration: none;
    color: inherit;
    border-color: rgba(255,210,74,.45);
    background: linear-gradient(135deg, rgba(255,210,74,.12), rgba(255,189,46,.05) 70%, var(--panel));
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.tile--money:hover { border-color: #ffd24a; }
.tile--money .tile__num {
    background: linear-gradient(135deg, #ffd24a, #ffa726);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tile--money .tile__lbl {
    color: #ffd24a;
    font-weight: 700;
    letter-spacing: .3px;
}

/* ---- filters ---- */
.filters {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 8px;
}
.filters__row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-end;
}
.filter { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); min-width: 120px; }
.filter--grow { flex: 1 1 180px; }
.filter--btns { flex-direction: row; align-items: center; gap: 6px; }
.filter select, .filter input[type=search], .filter input[type=number] {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
    outline: none;
    font-family: inherit;
}
.filter input[type=number]:focus, .filter input[type=search]:focus, .filter select:focus {
    border-color: var(--accent);
}

/* Расширенные фильтры — раскрываются по клику */
.filters-advanced {
    margin-top: 8px;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}
.filters-advanced > summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--muted);
    padding: 4px 6px;
    display: inline-block;
    list-style: none;
    user-select: none;
}
.filters-advanced > summary::-webkit-details-marker { display: none; }
.filters-advanced > summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform .12s;
}
.filters-advanced[open] > summary::before { content: '▾ '; }
.filters-advanced > summary:hover { color: var(--text); }

.filters-advanced__grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
}
.filter--slim { min-width: 0; }
.filter--range { min-width: 0; }
.range-inputs { display: flex; gap: 4px; }
.range-inputs input[type=number] {
    width: 100%;
    min-width: 0;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 6px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
}
.range-inputs input[type=number]:focus { border-color: var(--accent); }
.filter select:focus, .filter input:focus { border-color: var(--accent); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}
.btn-sm { padding: 3px 8px; font-size: 11px; }

/* ---- table ---- */
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: auto;
    max-width: 100%;
}
.products {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.products thead th {
    background: var(--bg-soft);
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-size: 10px;
    text-align: left;
    padding: 5px 7px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.products thead th.num    { text-align: right; }
.products thead th abbr   { text-decoration: none; border-bottom: 1px dotted transparent; cursor: help; }
.products thead th:hover abbr { border-bottom-color: var(--muted); }

/* Кликабельный сортировочный заголовок */
.th-sort {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    padding: 2px 2px;
    border-radius: 3px;
    transition: color .1s, background .1s;
}
.th-sort:hover { color: var(--text); background: rgba(124,92,255,.08); }
.th-sort.is-active { color: var(--accent-2); }
.th-arrow {
    font-size: 9px;
    opacity: .55;
    line-height: 1;
}
.th-sort.is-active .th-arrow { opacity: 1; color: var(--accent-2); }
.products thead th.num .th-sort { flex-direction: row-reverse; }
.products tbody td {
    padding: 4px 7px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    line-height: 1.25;
}
.products tbody tr:last-child td { border-bottom: none; }
.products tbody tr:hover td { background: rgba(124,92,255,.04); }
.products td.num    { text-align: right; }
.products td.center { text-align: center; }
.products td.muted  { color: var(--muted); }
.products td.total  { font-weight: 700; color: var(--text); }

.sticky-col {
    position: sticky;
    left: 0;
    background: var(--panel);
    z-index: 1;
    min-width: 300px;
    max-width: 340px;
    white-space: normal;
}
.products thead th.sticky-col {
    background: var(--bg-soft);
    z-index: 3;
}

/* Шапка первой колонки: две emoji-сортировки слева + «Название товара» с отступом. */
.head-name {
    position: relative;
    padding-left: 40px;
    display: block;
}
.head-name .badge-slot {
    pointer-events: auto;
    transform: translateY(-50%);
}
.head-name .badge-slot .th-sort {
    padding: 2px 3px;
    font-size: 13px;
    gap: 2px;
}
.head-name .badge-slot .th-arrow { display: none; }               /* у emoji-сортировок стрелку не рисуем */
.head-name .badge-slot .th-sort.is-active {
    background: rgba(39,213,196,.18);
    border-radius: 4px;
}
.head-name .badge-slot .th-sort:hover { background: rgba(124,92,255,.14); }
.products tbody tr:hover td.sticky-col { background: #212635; }

.prod-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.prod-link:hover .prod__title { color: var(--accent-2); }
.prod__title {
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
    line-height: 1.25;
}
.prod__meta {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.2;
    margin-top: 1px;
}

/* pills, badges */
.pill {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    white-space: nowrap;
}
.pill--muted { background: var(--bg-soft); }
.pill--warn  {
    color: #ffb74d;
    background: rgba(255,183,77,.08);
    border-color: rgba(255,183,77,.35);
}
.pill--ok {
    color: var(--accent-2);
    background: rgba(39,213,196,.08);
    border-color: rgba(39,213,196,.35);
}

.badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.badge--in  { background: rgba(39,213,196,.12);  color: var(--accent-2); }
.badge--out { background: rgba(255,107,107,.12); color: var(--error); }
.badge--preorder { background: rgba(255,183,77,.12); color: #ffb74d; }
.badge--unknown  { background: var(--bg-soft); color: var(--muted); }
.badge--ok    { background: rgba(39,213,196,.12); color: var(--accent-2); }
.badge--muted { background: var(--bg-soft); color: var(--muted); }

/* видео-«галочка» */
.tick { font-size: 13px; line-height: 1; }
.tick--ok { color: var(--accent-2); font-weight: 700; }
.tick--no { color: var(--muted); }

.warn { color: #ffb74d; font-weight: 600; }

.price-cell { white-space: nowrap; }
.price { font-weight: 700; font-size: 12px; }
.price__disc {
    color: var(--error);
    font-weight: 700;
    font-size: 10px;
    margin-left: 4px;
}

/* Потенциал выручки */
.potential-cell {
    white-space: nowrap;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.potential-cell--top {
    color: #ffd24a;
    font-weight: 700;
}
.money-badge {
    display: inline-block;
    font-size: 12px;
    margin-right: 3px;
    vertical-align: -1px;
}

/* Скоринг — плоский chip вместо блока с баром */
.score-chip {
    display: inline-block;
    min-width: 26px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.score-chip--low { background: rgba(255,107,107,.12); color: var(--error); }
.score-chip--mid { background: rgba(255,183,77,.12); color: #ffb74d; }
.score-chip--hi  { background: rgba(39,213,196,.12); color: var(--accent-2); }

.priority {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    min-width: 26px;
    text-align: center;
}
.priority--hi  { background: rgba(255,107,107,.12); color: var(--error); }
.priority--mid { background: rgba(255,183,77,.12); color: #ffb74d; }
.priority--low { background: var(--bg-soft); color: var(--muted); }

/* Проблемы — цветные точки с счётчиком */
.issues-dots {
    white-space: nowrap;
    cursor: help;
}
.dots-wrap { display: inline-flex; gap: 2px; vertical-align: middle; }
.dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffb74d;
}
.dot--ok { background: var(--accent-2); }
.dots-count {
    font-size: 10.5px;
    color: var(--muted);
    margin-left: 4px;
}

/* Иконочные ссылки-стрелки */
.actions { white-space: nowrap; text-align: center; }
.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
    border: 1px solid var(--border);
    margin: 0 1px;
    transition: border-color .15s, background .15s;
}
.icon-link:hover { border-color: var(--accent); background: rgba(124,92,255,.12); }
.icon-link--ext { transform: rotate(45deg); color: var(--muted); }
.icon-link--edit { color: var(--accent); }
.icon-link--edit:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.icon-link--edit svg { display: block; }

.empty { text-align: center; color: var(--muted); padding: 30px !important; }

/* footer */
.page-foot {
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}
.page-foot code {
    background: var(--bg-soft);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--text);
    font-size: 11px;
}

/* row status tint */
.row--status-out td { opacity: .85; }
.row--status-out .prod__title { color: var(--muted); }

/* row hot — высокий приоритет, обрабатывать в первую очередь */
.row--hot td { background: rgba(255,107,107,.04); }
.row--hot:hover td { background: rgba(255,107,107,.09) !important; }

/* Во всех ячейках первой колонки резервируем фиксированную зону слева
   под два значка: 🔥 (приоритет) и 💰 (потенциал выручки).
   Названия товаров всегда выровнены по одной левой границе. */
.prod-link {
    position: relative;
    padding-left: 40px;
}
.badge-slot {
    position: absolute;
    top: 50%;
    transform: translateY(-55%);
    font-size: 14px;
    line-height: 1;
    background: transparent;
    filter: none;
    margin: 0;
    pointer-events: auto;
}
.badge-slot--hot   { left: 0;  }
.badge-slot--money { left: 20px; }

/* ============ Checkbox column & batch actions ============ */
.col-select {
    width: 30px;
    padding-left: 10px !important;
    padding-right: 4px !important;
    text-align: center;
}
.chk { display: inline-flex; cursor: pointer; user-select: none; }
.chk input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk__box {
    width: 16px; height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg-soft);
    display: inline-block;
    position: relative;
    transition: all .1s;
}
.chk input:checked + .chk__box {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
}
.chk input:checked + .chk__box::after {
    content: '';
    position: absolute;
    left: 4px; top: 0;
    width: 5px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.chk input:indeterminate + .chk__box {
    background: var(--accent);
    border-color: transparent;
}
.chk input:indeterminate + .chk__box::after {
    content: '';
    position: absolute;
    left: 3px; right: 3px; top: 6px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}
.chk:hover .chk__box { border-color: var(--accent); }

/* Action bar */
.action-bar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--panel);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 0 3px rgba(124,92,255,.12);
    z-index: 50;
    animation: actionbar-in .15s ease-out;
}
@keyframes actionbar-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.action-bar__left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 13px;
}
.action-bar__count { font-weight: 700; }
.action-bar__count span { color: var(--accent-2); }
.action-bar__right {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Глобально: атрибут hidden должен всегда скрывать элемент,
   даже если класс позже задаёт display. */
[hidden] { display: none !important; }

/* Modal */
.modal {
    position: fixed; inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
}
.modal__dialog {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    width: min(100%, 640px);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
}
.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.modal__head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.modal__close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.modal__close:hover { color: var(--text); background: var(--bg-soft); }
.modal__body {
    padding: 16px 18px;
    overflow: auto;
}
.modal__body .muted.small { font-size: 12px; margin-top: 10px; }
.modal__foot {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.tz-list {
    margin: 6px 0 0;
    padding: 0 0 0 22px;
    font-size: 13px;
    line-height: 1.6;
    max-height: 320px;
    overflow: auto;
}
.tz-list li { padding: 2px 0; }
.tz-id { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }

/* === стоп старая заглушка === */
.stub { display: none; }

/* =================== Product page =================== */
.brand-link { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.brand-link:hover { opacity: .85; }
.topbar-section { text-decoration: none; color: var(--muted); }
.topbar-section:hover { color: var(--text); }
.topbar-section--active { color: var(--text); }

.product-page { max-width: 1120px; }

.prod-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 14px;
}
.prod-header__title h1 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.3;
}
.prod-header__meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.prod-header__price { text-align: right; min-width: 160px; }
.price--lg { font-size: 26px; font-weight: 700; margin-bottom: 4px; }

.tiles--prod {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-bottom: 14px;
}
.tile--accent { border-color: rgba(124,92,255,.5); }
.tile--accent .tile__num { color: var(--accent); }

.issues-panel {
    background: rgba(255,183,77,.06);
    border: 1px solid rgba(255,183,77,.25);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
}

.actions-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.actions-bar .btn-primary:disabled,
.actions-bar .btn-ghost:disabled { opacity: .55; cursor: not-allowed; }
.actions-hint { color: var(--muted); font-size: 12px; font-style: italic; }

.editor { display: flex; flex-direction: column; gap: 14px; }

.block {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
}
.block__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}
.block__head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.block__count {
    display: inline-block;
    margin-left: 6px;
    background: var(--bg-soft);
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.block__meta { color: var(--muted); font-size: 12px; }

.ta,
.block textarea,
.card textarea {
    width: 100%;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    transition: border-color .15s;
}
.ta { font-size: 14px; }
.block textarea:focus, .ta:focus { border-color: var(--accent); }

.empty-block {
    background: var(--bg-soft);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 10px;
}
.card:first-of-type { margin-top: 0; }
.card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.card__who { font-size: 13px; }
.card__who .muted { color: var(--muted); margin-left: 4px; }

.stars { letter-spacing: 2px; font-size: 14px; }
.stars .star { color: var(--border); }
.stars .star.is-full { color: #ffc857; }

.field { margin-top: 8px; }
.field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    margin-bottom: 4px;
}

.details {
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 4px 14px;
}
.details > div { display: flex; justify-content: space-between; font-size: 12px; }
.details dt { color: var(--muted); margin: 0; }
.details dd { margin: 0; font-weight: 600; }

/* Q&A */
.qa-card { padding: 0; overflow: hidden; }
.qa-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.qa-row:last-child { border-bottom: none; }
.qa-row--q { background: rgba(124,92,255,.04); }
.qa-row--a { background: rgba(39,213,196,.04); }
.qa-row--empty { color: var(--muted); }
.qa-side { font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.qa-tag {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.qa-tag--q { background: rgba(124,92,255,.18); color: var(--accent); }
.qa-tag--a { background: rgba(39,213,196,.18); color: var(--accent-2); }

/* === Технические характеристики === */
.spec-group {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-soft);
}
.spec-group:first-of-type { margin-top: 0; }
.spec-group__title {
    background: var(--panel);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-2);
    border-bottom: 1px solid var(--border);
    letter-spacing: .2px;
}
.spec-group__rows {
    display: flex;
    flex-direction: column;
}
.spec-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: start;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
}
.spec-row:last-child { border-bottom: none; }
.spec-row__name {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.35;
    padding-top: 7px;
    white-space: normal;
    word-break: break-word;
}
.spec-row textarea {
    width: 100%;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    min-height: 30px;
    transition: border-color .15s;
}
.spec-row textarea:focus { border-color: var(--accent); }

.spec-note {
    margin: 14px 0 0;
    padding: 10px 14px;
    background: rgba(124,92,255,.04);
    border: 1px dashed rgba(124,92,255,.35);
    border-radius: 8px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
}

@media (max-width: 720px) {
    .spec-row { grid-template-columns: 1fr; gap: 4px; }
    .spec-row__name { padding-top: 0; }
}

/* Переключатель Визуально/HTML */
.block__head-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.editor-mode {
    display: inline-flex;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
}
.editor-mode__btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.3;
    transition: color .12s, background .12s;
}
.editor-mode__btn:hover { color: var(--text); }
.editor-mode__btn.is-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}

/* =================== Quill (описание) — dark theme overrides =================== */
#editor-description {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px;
    min-height: 420px;
    max-height: 720px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.55;
}
#editor-description .ql-editor {
    color: var(--text);
    padding: 16px 18px;
    min-height: 420px;
}

/* HTML-режим */
.editor-html {
    display: none;
    width: 100%;
    min-height: 460px;
    max-height: 780px;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    tab-size: 2;
    resize: vertical;
    outline: none;
    transition: border-color .15s;
}
.editor-html:focus { border-color: var(--accent); }
#editor-description .ql-editor p,
#editor-description .ql-editor ul,
#editor-description .ql-editor ol,
#editor-description .ql-editor h2,
#editor-description .ql-editor h3 {
    margin: 0 0 10px;
}
#editor-description .ql-editor h2 { font-size: 17px; font-weight: 700; color: var(--text); }
#editor-description .ql-editor h3 { font-size: 15px; font-weight: 700; color: var(--text); }
#editor-description .ql-editor blockquote {
    border-left: 3px solid var(--accent);
    margin: 0 0 10px;
    padding: 4px 12px;
    color: var(--muted);
    background: rgba(124,92,255,.06);
    border-radius: 0 6px 6px 0;
}
#editor-description .ql-editor a { color: var(--accent-2); }
#editor-description .ql-editor.ql-blank::before {
    color: var(--muted);
    font-style: normal;
}

/* Toolbar */
.block-description .ql-toolbar.ql-snow {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    padding: 6px 8px;
}
.block-description .ql-toolbar.ql-snow .ql-picker,
.block-description .ql-toolbar.ql-snow .ql-picker-label,
.block-description .ql-toolbar.ql-snow button {
    color: var(--muted);
}
.block-description .ql-toolbar.ql-snow .ql-stroke        { stroke: var(--muted); }
.block-description .ql-toolbar.ql-snow .ql-fill          { fill:   var(--muted); }
.block-description .ql-toolbar.ql-snow button:hover .ql-stroke,
.block-description .ql-toolbar.ql-snow button.ql-active .ql-stroke,
.block-description .ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--accent-2); }
.block-description .ql-toolbar.ql-snow button:hover .ql-fill,
.block-description .ql-toolbar.ql-snow button.ql-active .ql-fill,
.block-description .ql-toolbar.ql-snow .ql-picker-label:hover .ql-fill   { fill: var(--accent-2); }
.block-description .ql-toolbar.ql-snow .ql-picker-options {
    background: var(--panel);
    border-color: var(--border) !important;
    color: var(--text);
}
.block-description .ql-snow .ql-tooltip {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow);
}
.block-description .ql-snow .ql-tooltip input[type=text] {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
}

@media (max-width: 720px) {
    .prod-header { flex-direction: column; }
    .prod-header__price { text-align: left; }
    .qa-row { grid-template-columns: 1fr; }
}
