/* ============================================================================
 * customizer.css — оформление кастомайзера
 * Токены и компоненты (секции, свитчи, сегменты, плитки форм) — те же, что у
 * кастомайзера чата, чтобы все кастомайзеры выглядели как одно семейство.
 * ========================================================================== */

:root {
  --bg: #151022; --panel: #1e1733; --panel-2: #261d40; --panel-3: #2e2350; --line: #372a55;
  --ink: #efe9ff; --dim: #ab9fd0; --accent: #ff7bac; --accent-2: #7c9cff;
  --ok: #7fe3b0; --warn: #ffcf7a; --err: #ff8a9a;
  --radius: 14px; --font: 'Manrope', 'Nunito', system-ui, sans-serif;
  --top: 58px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font); color: var(--ink); font-size: 13px; overflow: hidden;
  background:
    radial-gradient(900px 500px at 82% -8%, rgba(255,123,172,.16), transparent 60%),
    radial-gradient(700px 500px at -6% 20%, rgba(124,156,255,.14), transparent 58%),
    var(--bg);
}
button { font-family: inherit; }
.spacer { flex: 1; }
.muted { color: var(--dim); font-size: 12px; }

/* ---- кнопки ---- */
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; transition: .15s; }
button:hover { border-color: var(--accent-2); }
button:disabled { opacity: .45; cursor: default; }
button.primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.small { padding: 5px 9px; font-size: 11.5px; }
button.narrow { padding: 8px 9px; }
.icon-btn { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; font-size: 14px; }
.mini-btn { width: 26px; height: 26px; padding: 0; display: inline-grid; place-items: center; font-size: 12px; border-radius: 8px; background: var(--panel-2); }
.mini-btn.danger:hover { border-color: var(--err); color: var(--err); }

input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font-family: inherit; font-size: 13px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); }
input.bad { border-color: var(--err); }
textarea { min-height: 220px; font-family: ui-monospace, Consolas, monospace; font-size: 11px; resize: vertical; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 5px; background: var(--panel-3); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); cursor: pointer; box-shadow: 0 0 0 3px rgba(255,123,172,.22); }
input[type=color] { width: 38px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; padding: 2px; flex: none; }

/* ============================================================================
 *  ВЕРХНЯЯ ПАНЕЛЬ
 * ========================================================================== */
.top {
  height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: rgba(21,16,34,.92); position: relative; z-index: 20;
}
.brand h1 { font-family: 'Fredoka', var(--font); font-size: 18px; line-height: 1.1;
  background: linear-gradient(90deg, #ffb3d1, #9db3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand p { font-size: 11px; color: var(--dim); }
.profiles { display: flex; gap: 4px; align-items: center; margin-left: 10px; }
.profiles select { width: 190px; }
.mode .seg { width: 190px; }
.saved { font-size: 11px; color: var(--ok); opacity: 0; transition: opacity .3s; }
.saved.on { opacity: 1; }

.checkwrap { position: relative; }
.check { padding: 8px 12px; }
.check.ok { color: var(--ok); }
.check.warn { color: var(--warn); border-color: rgba(255,207,122,.5); }
.check.err { color: var(--err); border-color: rgba(255,138,154,.6); }
.check__list, .menu {
  position: absolute; right: 0; top: calc(100% + 6px); width: 420px; max-height: 60vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45); display: none; z-index: 50;
}
.check__list.open, .menu.open { display: block; }
.check__row { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px;
  font-weight: 600; font-size: 12.5px; line-height: 1.4; }
.check__row:hover { background: var(--panel-2); }
.check__row.err { color: var(--err); } .check__row.warn { color: var(--warn); } .check__row.ok { color: var(--ok); }
.check__sec { display: block; color: var(--dim); font-size: 11px; font-weight: 600; margin-top: 2px; }
.export { position: relative; display: flex; gap: 2px; }
.menu { width: 330px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; }
.menu button:hover { background: var(--panel-2); }
.menu b { display: block; font-size: 12.5px; }
.menu span { display: block; color: var(--dim); font-size: 11px; font-weight: 600; }

/* ============================================================================
 *  ТРИ КОЛОНКИ: разделы · настройки · превью
 * ========================================================================== */
.app { display: grid; grid-template-columns: 178px 490px 1fr; height: calc(100vh - var(--top)); }

.nav { overflow-y: auto; padding: 10px 8px; border-right: 1px solid var(--line); background: rgba(30,23,51,.55); }
.nav__btn { display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 3px; padding: 8px 10px; border: 1px solid transparent;
  background: transparent; border-radius: 10px; color: var(--dim); text-align: left; position: relative; }
.nav__btn:hover { color: var(--ink); background: var(--panel); border-color: transparent; }
.nav__btn.on { color: #fff; background: linear-gradient(135deg, rgba(255,123,172,.22), rgba(124,156,255,.22)); border-color: var(--line); }
.nav__icon { font-size: 15px; width: 20px; text-align: center; }
.nav__name { font-size: 12.5px; }
.dot { position: absolute; right: 8px; font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 9px; }
.dot.err { background: var(--err); color: #2a0b12; } .dot.warn { background: var(--warn); color: #2a1d05; }

.panel { overflow-y: auto; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(30,23,51,.92), rgba(21,16,34,.92)); }
.panel::-webkit-scrollbar, .nav::-webkit-scrollbar, .check__list::-webkit-scrollbar { width: 9px; }
.panel::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 2px solid var(--panel); }
.panel__head { position: sticky; top: 0; z-index: 3; padding: 14px 18px 10px; background: rgba(30,23,51,.97); border-bottom: 1px solid var(--line); }
.panel__head h2 { font-family: 'Fredoka', var(--font); font-size: 17px; font-weight: 600; }
.panel__body { padding: 12px 18px 60px; display: flex; flex-direction: column; gap: 14px; }

/* Basic скрывает расширенные поля */
.is-basic .f.adv { display: none !important; }
.is-basic .adv-block > .f, .is-basic .adv-block > .grid2 { display: none; }

/* ---- поля ---- */
.row { display: flex; flex-direction: column; gap: 6px; }
.row > label { font-size: 12px; color: var(--dim); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row .val { color: var(--accent-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.badge { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 6px; background: var(--panel-3); color: var(--dim); }
.hint { font-size: 11.5px; color: var(--dim); line-height: 1.45; }
.hint b, .warn b { color: var(--ink); }
.warn { font-size: 11.5px; color: var(--warn); line-height: 1.45; }
.num { display: flex; align-items: center; gap: 8px; }
.num .unit { color: var(--dim); font-size: 12px; min-width: 18px; }
.group { display: flex; flex-direction: column; gap: 12px; }
.group--box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; background: rgba(38,29,64,.45); }
.group__title { font-weight: 800; font-size: 12.5px; color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg { display: flex; gap: 5px; flex-wrap: wrap; }
.seg button { flex: 1 1 0; min-width: 0; padding: 7px 6px; color: var(--dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button.on { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--panel-3); border: 1px solid var(--line); transition: .18s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; left: 3px; top: 2px; background: var(--dim); transition: .18s; }
.switch input:checked + span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.switch input:checked + span::before { transform: translateX(18px); background: #fff; }

.color { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.color .color-text { flex: 1; min-width: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.color__alpha { display: flex; align-items: center; gap: 8px; width: 100%; }
.color__alpha .val { width: 40px; text-align: right; font-size: 11.5px; }
.color--compact .color__alpha { width: 100%; }

.paint { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(38,29,64,.5); }
.paint__head { display: flex; gap: 8px; align-items: center; }
.paint__swatch { width: 44px; height: 30px; flex: none; border-radius: 8px; border: 1px solid var(--line);
  background-image: repeating-conic-gradient(#3a3060 0 25%, #2a2148 0 50%); background-size: 12px 12px; }
.paint__head .seg { flex: 1; }
.paint__body { display: flex; flex-direction: column; gap: 8px; }
.mini { display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; align-items: center; font-size: 11.5px; color: var(--dim); }

.font { display: flex; flex-direction: column; gap: 6px; }
.font-preview { padding: 8px 10px; border-radius: 9px; background: #f6f3ff; color: #2a2350; font-size: 17px; line-height: 1.25; }

.asset { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
.asset input { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.shapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.thumb { position: relative; aspect-ratio: 1 / .95; padding: 6px 4px 16px; display: grid; place-items: center; border-radius: 10px; }
.thumb svg { width: 34px; height: 34px; overflow: visible; }
.thumb svg path { fill: url(#none); fill: #cfd9ff; stroke: #fff; stroke-width: 1.5; }
.thumb svg path.facet { fill: none; stroke: rgba(80,90,160,.55); stroke-width: 1; }
.thumb b { position: absolute; bottom: 3px; left: 3px; right: 3px; font-size: 9px; color: var(--dim); font-weight: 700; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb.on { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(124,156,255,.4); background: var(--panel); }
.thumb.on svg path { fill: #ffd0e2; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 7px; }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; text-align: left; border-radius: 12px; }
.card__icon { font-size: 18px; }
.card__name { font-size: 12.5px; color: var(--ink); }
.card__desc { font-size: 10.5px; color: var(--dim); font-weight: 600; }
.card.on { border-color: transparent; background: linear-gradient(135deg, rgba(255,123,172,.3), rgba(124,156,255,.3)); box-shadow: 0 0 0 2px rgba(124,156,255,.45); }

/* ---- пресеты ---- */
.presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.preset { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); transition: .15s; }
.preset:hover { border-color: var(--accent-2); }
.preset.on { background: linear-gradient(135deg, rgba(255,123,172,.25), rgba(124,156,255,.25)); box-shadow: 0 0 0 2px rgba(124,156,255,.45); border-color: transparent; }
.preset__sw { display: flex; gap: 3px; }
.preset__sw i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); }
.preset__name { font-weight: 800; font-size: 12.5px; }
.preset__note { font-size: 10.5px; color: var(--dim); line-height: 1.3; }
.preset__tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.preset:hover .preset__tools { opacity: 1; }

/* ---- призы ---- */
.items__head, .chances__sum { font-size: 12px; color: var(--dim); font-weight: 700; }
.items { display: flex; flex-direction: column; gap: 5px; }
.item { display: grid; grid-template-columns: 14px 40px 34px 26px minmax(90px, 1fr) 50px 42px 24px 24px 24px; gap: 4px; align-items: center;
  padding: 5px 6px; border-radius: 10px; border: 1px solid transparent; background: rgba(38,29,64,.55); }
.item.is-off { opacity: .55; }
.item.dragging { opacity: .4; }
.item.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.item.drop-after { box-shadow: 0 2px 0 var(--accent); }
.item__drag { cursor: grab; color: var(--dim); font-size: 13px; letter-spacing: -2px; user-select: none; text-align: center; }
.item__icon { text-align: center; padding: 6px 2px !important; font-size: 15px !important; }
.item__color { width: 26px !important; height: 28px !important; }
.item .mini-btn { width: 24px; height: 26px; }
.item__name { padding: 7px 8px !important; }
.item__color.dim { opacity: .45; }
.item__weight { padding: 6px 6px !important; text-align: center; }
.item__pct { font-size: 11.5px; color: var(--accent-2); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.item__details { margin: -2px 0 6px 22px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(30,23,51,.85);
  display: flex; flex-direction: column; gap: 10px; }
.adv-block { display: flex; flex-direction: column; gap: 10px; }

/* ---- шансы ---- */
.chances { display: flex; flex-direction: column; gap: 4px; }
.chances__row { display: grid; grid-template-columns: 1fr 58px 1fr 54px 74px; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; background: rgba(38,29,64,.45); }
.chances__row.is-off { opacity: .45; }
.chances__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 12px; }
.chances__w { padding: 5px 6px !important; text-align: center; }
.chances__bar { height: 8px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.chances__bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.chances__pct { text-align: right; font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.tag { display: inline-block; font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 7px; text-align: center;
  background: var(--panel-3); color: var(--dim); }
.tag.r-uncommon { color: #8ff0bf; } .tag.r-rare { color: #9fd0ff; } .tag.r-epic { color: #d7b5ff; }
.tag.r-legendary { color: #ffd77a; } .tag.r-custom { color: #ffb3d9; }

/* ---- пороги, таблица расчёта ---- */
.thresholds { display: flex; flex-direction: column; gap: 5px; }
.threshold { display: grid; grid-template-columns: auto 1fr auto 80px auto 26px; gap: 6px; align-items: center; color: var(--dim); font-size: 12px; }
.st { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 10px; }
.st__row { display: grid; grid-template-columns: 80px 30px 1fr; gap: 6px; align-items: baseline; padding: 4px 8px; border-radius: 8px; background: rgba(38,29,64,.45); }
.st__row span { color: var(--dim); font-variant-numeric: tabular-nums; }
.st__row b { color: var(--accent-2); font-size: 14px; text-align: right; }
.st__row i { font-style: normal; color: var(--dim); font-size: 10.5px; }
.probe { display: flex; align-items: center; gap: 8px; color: var(--dim); }
.probe input { width: 120px; }
.probe__res { font-size: 12px; color: var(--dim); line-height: 1.45; }
.probe__res b { color: var(--ink); }

/* ---- палитры ---- */
.palettes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.palette { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 7px 8px; border-radius: 10px; }
.palette__sw { display: flex; gap: 2px; }
.palette__sw i { width: 12px; height: 18px; border-radius: 4px; }
.palette b { font-size: 11px; color: var(--dim); }
.palette.on { box-shadow: 0 0 0 2px rgba(124,156,255,.5); border-color: transparent; }
.custom-pal { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.custom-pal__c { display: inline-flex; gap: 2px; align-items: center; }

/* ---- редкость, декор, звук, слои ---- */
.rarity { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: rgba(38,29,64,.45); }
.rarity .tag { align-self: flex-start; }
details.deco { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
details.deco > summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
details.deco > summary::-webkit-details-marker { display: none; }
details.deco > summary span::before { content: '▸ '; color: var(--accent-2); }
details.deco[open] > summary span::before { content: '▾ '; }
details.deco.on > summary span { color: #fff; }
.deco__body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.snd { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(38,29,64,.45); border: 1px solid var(--line); }
.snd__head { display: flex; align-items: center; gap: 10px; }
.snd__head b { flex: 1; }
.layer { display: grid; grid-template-columns: 44px 1fr 26px 26px; gap: 6px; align-items: center; padding: 5px 6px; border-radius: 8px; background: rgba(38,29,64,.45); }
.cfont { display: grid; grid-template-columns: 120px 1fr 26px; gap: 6px; align-items: center; }
.status { font-size: 12px; padding: 8px 10px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); color: var(--dim); }
.status.ok { color: var(--ok); border-color: rgba(127,227,176,.4); } .status.err { color: var(--err); border-color: rgba(255,138,154,.5); }

/* ============================================================================
 *  ПРЕВЬЮ
 * ========================================================================== */
.preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pv-bar, .pv-demo { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pv-bar .seg { width: 300px; }
.pv-field { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12px; white-space: nowrap; }
.pv-field select { width: 200px; }
.pv-demo input { width: 110px; padding: 7px 9px; }
.pv-demo #demoAmount { width: 80px; }
.pv-demo #demoMsg { width: 170px; }
.pv-demo button { padding: 7px 10px; font-size: 12px; }
.pv-tag { font-size: 10px; font-weight: 800; letter-spacing: .12em; padding: 3px 8px; border-radius: 6px; background: rgba(255,123,172,.2); color: var(--accent); }
.pv-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; overflow: hidden; }
.scene { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.scene iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: transparent; }
.scene[data-bg="plain"] { background: #f2f0fb; }
.scene[data-bg="game"] { background:
  radial-gradient(500px 420px at 72% 26%, #ffb347, transparent 60%),
  radial-gradient(520px 440px at 18% 78%, #2ec5ff, transparent 60%),
  linear-gradient(135deg, #0d7a4f, #1b9c8a 60%, #0a5f6e); }
.scene[data-bg="dark"] { background:
  radial-gradient(500px 420px at 30% 24%, #7a3cff, transparent 60%),
  radial-gradient(500px 440px at 82% 80%, #ff3c7a, transparent 60%),
  linear-gradient(135deg, #0d1030, #241a4a 60%, #0b0817); }
.scene[data-bg="checker"] { background: repeating-conic-gradient(#d8d8e4 0 25%, #ffffff 0 50%) 0 0 / 28px 28px; }
.pv-status { padding: 8px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.calc { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.chip.r-rare { border-color: #9fd0ff; } .chip.r-epic { border-color: #d7b5ff; } .chip.r-legendary { border-color: #ffd77a; box-shadow: 0 0 10px rgba(255,215,122,.35); }
.pv-log { border-top: 1px solid var(--line); }
.pv-log > summary { cursor: pointer; padding: 7px 14px; color: var(--dim); font-size: 12px; }
.log { max-height: 140px; overflow-y: auto; padding: 0 14px 10px; font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--dim); }
.log__row.warn { color: var(--warn); } .log__row.error { color: var(--err); }

/* ---- раздел «Элементы»: наборы, фильтр тем, галереи слотов ---- */
.custom { display: flex; flex-direction: column; gap: 12px; }
.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; }
.kit { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 6px 7px; border-radius: 12px; }
.kit b { font-size: 11px; color: var(--dim); }
.kit__th { display: flex; gap: 2px; }
.kit__th .ath { width: 24px; height: 24px; }
.kit.on { border-color: transparent; background: linear-gradient(135deg, rgba(255,123,172,.3), rgba(124,156,255,.3)); box-shadow: 0 0 0 2px rgba(124,156,255,.45); }
.kit.on b { color: #fff; }
.theme-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tchip { padding: 4px 10px; border-radius: 999px; font-size: 11px; color: var(--dim); }
.tchip.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
details.el { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
details.el > summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
details.el > summary::-webkit-details-marker { display: none; }
details.el > summary span::before { content: '▸ '; color: var(--accent-2); }
details.el[open] > summary span::before { content: '▾ '; }
details.el > summary i { font-style: normal; font-size: 11.5px; color: var(--accent-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.el__body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.gtile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px 6px; border-radius: 11px; background: rgba(38,29,64,.55); }
.gtile b { font-size: 10.5px; font-weight: 700; color: var(--dim); line-height: 1.2; text-align: center; }
.gtile.on { border-color: transparent; background: linear-gradient(135deg, rgba(255,123,172,.28), rgba(124,156,255,.28)); box-shadow: 0 0 0 2px rgba(124,156,255,.5); }
.gtile.on b { color: #fff; }
.tint { display: flex; flex-direction: column; gap: 6px; }

/* миниатюры assets: те же классы, что в виджете (widget.css), но с постоянной палитрой */
.ath { width: 46px; height: 46px; overflow: visible; display: block;
  --el-tint: #8fa6ff; --el-light: #dbe4ff; --el-dark: #4b4f9e; --el-op: 1; --el-int: .8;
  --c-highlight: #b9dcff; --tint-hub: #c9d6ff; --c-border: #fff; --rar-c: #ffd77a; --label-halo: rgba(255,255,255,.78); }
.ath .f1 { fill: var(--el-tint); }  .ath .s1 { stroke: var(--el-tint); }
.ath .f2 { fill: var(--el-light); } .ath .s2 { stroke: var(--el-light); }
.ath .f3 { fill: var(--el-dark); }  .ath .s3 { stroke: var(--el-dark); }
.ath .fw { fill: #fff; }            .ath .sw { stroke: #fff; }
.ath .s1, .ath .s2, .ath .s3, .ath .sw { stroke-linecap: round; }
.ath path.s1:not([fill]), .ath path.s2:not([fill]), .ath path.s3:not([fill]), .ath path.sw:not([fill]) { fill: none; }
.ath .none-x { stroke: var(--dim); stroke-width: 3; stroke-linecap: round; fill: none; }
.ath .ptr-body { stroke: rgba(255,255,255,.95); stroke-width: 4; stroke-linejoin: round; }
.ath .ptr-body.is-miter { stroke-linejoin: miter; stroke-width: 3; }
.ath .ptr-facets { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 2; stroke-linejoin: round; }
.ath .ptr-shine { fill: rgba(255,255,255,.16); stroke: none; }
.ath .cap-rim { stroke: #fff; stroke-width: 1.5; }
.ath .cap-facet { stroke: rgba(255,255,255,.85); stroke-width: .8; }
.ath .sel-fill { opacity: .7; stroke: var(--el-tint); stroke-width: 1; }
.ath .badge-text { font: 800 7.6px/1 system-ui, sans-serif; fill: #fff; letter-spacing: .04em; }
.ath .rim { fill: none; stroke: #fff; stroke-width: 1.6; }
.ath .rim-in { stroke-width: .9; opacity: .7; }
.ath .rim-dash { stroke-dasharray: 5 3.5; }
.ath .rim-beads { stroke-dasharray: 0 5; stroke-linecap: round; stroke-width: 2.6; }
.ath .rim-neon { stroke: var(--el-tint); stroke-width: 2.6; }
.ath .rim-core { stroke: #fff; stroke-width: .8; }
.ath .rim-gold { stroke-width: 2.4; }
.ath .rim-pixel { stroke-dasharray: 3 2; stroke-linecap: square; stroke-width: 2.4; }
.ath .rim-halo { stroke: var(--el-tint); stroke-width: 5; opacity: .35; }
.ath .rim-thin { stroke-width: .8; }
.gtile:hover .ath { transform: scale(1.06); }
.ath { transition: transform .15s; }

/* ---- вкладки раздела «Элементы» ---- */
.el-tabs { display: flex; flex-wrap: wrap; gap: 5px; position: sticky; top: 0; z-index: 3; padding: 6px 0; background: linear-gradient(var(--bg), rgba(21,16,34,.92)); }
.el-tab { padding: 6px 10px; border-radius: 10px; font-size: 12px; color: var(--dim); }
.el-tab.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* ---- раздел «Дизайн по теме» (Theme Designer) ---- */
.td-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.td-theme { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 7px; border-radius: 12px; }
.td-theme__i { font-size: 18px; line-height: 1; }
.td-theme b { font-size: 11px; color: var(--dim); }
.td-theme.on { border-color: transparent; background: linear-gradient(135deg, rgba(255,123,172,.3), rgba(124,156,255,.3)); box-shadow: 0 0 0 2px rgba(124,156,255,.45); }
.td-theme.on b { color: #fff; }
.td-sw { display: flex; gap: 2px; }
.td-sw i, .td-dots i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.td-opts { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(38,29,64,.45); }
.td-acc { display: flex; gap: 8px; align-items: center; }
.td-acc .seg { flex: 1; }
.td-acc input[type=color] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.td-locks { display: flex; flex-wrap: wrap; gap: 5px; }
.td-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.td-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; }
.td-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.td-card.applied { border-color: transparent; box-shadow: 0 0 0 2px var(--ok); }
.td-pv { position: relative; height: 172px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #3a3260, #1a1530); }
.td-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.td-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; }
.td-cx { font-size: 10px; letter-spacing: 1px; color: var(--accent-2); white-space: nowrap; }
.td-cx i { font-style: normal; color: var(--line); }
.td-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.td-tags span { font-size: 10.5px; color: var(--dim); padding: 1px 7px; border-radius: 999px; background: var(--panel-2); }
.td-tags .td-dots { display: inline-flex; gap: 2px; padding: 2px 5px; }
.td-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.td-actions button { flex: 1 1 auto; }

/* ---- раздел «Перенос стиля» (Design DNA) ---- */
.st-box { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(38,29,64,.45); }
.st-sum { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; }
.st-sum span { color: var(--dim); font-size: 10.5px; letter-spacing: .08em; padding-top: 1px; }
.st-sum b { font-weight: 700; }
.st-sw { display: flex; gap: 4px; flex-wrap: wrap; }
.st-sw i { width: 22px; height: 22px; border-radius: 7px; display: inline-block; box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset, 0 0 0 1px rgba(0,0,0,.25); }
.st-json > summary { cursor: pointer; color: var(--dim); font-size: 12px; }
.st-json textarea, .st-input { width: 100%; min-height: 120px; resize: vertical; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font: 11.5px/1.45 ui-monospace, Consolas, monospace; padding: 8px 10px; margin-top: 6px; }
.st-input { min-height: 96px; font-family: var(--font); font-size: 12.5px; }
.st-preview { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid var(--accent-2); background: var(--panel); }
.st-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-pv { position: relative; height: 190px; border-radius: 10px; overflow: hidden; background: radial-gradient(120% 90% at 30% 20%, #3a3260, #1a1530); }
.st-tag { position: absolute; left: 6px; top: 6px; z-index: 2; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(20,14,40,.75); color: #fff; }
.st-map { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--dim); }
.st-map i { font-style: normal; opacity: .7; }
.st-pass { display: grid; grid-template-columns: 1fr auto auto auto auto auto; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 9px; background: var(--panel-2); }
.st-pass span { font-size: 11px; }
@media (max-width: 700px) { .st-pair { grid-template-columns: 1fr; } }

/* кнопки «Проверка вида» в превью */
.pv-show { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 6px 14px 8px; border-top: 1px solid var(--line); }
.pv-show span { font-size: 11.5px; color: var(--dim); margin-right: 4px; }

/* ---- уведомления ---- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 420px; }
.toast { padding: 11px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.4);
  font-size: 12.5px; line-height: 1.45; animation: toast-in .3s ease; transition: opacity .3s, transform .3s; }
.toast.ok { border-color: rgba(127,227,176,.5); } .toast.err { border-color: rgba(255,138,154,.6); color: #ffd3da; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- узкие экраны ---- */
@media (max-width: 1500px) {
  .app { grid-template-columns: 58px 460px 1fr; }
  .nav__name { display: none; }
  .nav__btn { justify-content: center; padding: 9px 0; }
  .dot { right: 2px; top: 2px; }
  .brand p { display: none; }
  #random { font-size: 0; padding: 8px 10px; } #random::before { content: "🎲"; font-size: 14px; }
  #recolor { font-size: 0; padding: 8px 10px; } #recolor::before { content: "🎨"; font-size: 14px; }
}
@media (max-width: 1180px) {
  body { overflow: auto; }
  .app { grid-template-columns: 58px 1fr; height: auto; }
  .preview { grid-column: 1 / -1; height: 80vh; }
  .top { flex-wrap: wrap; height: auto; padding: 8px 12px; }
}

/* карточка темы: силуэт контейнера, указатель, рама и материал */
.td-themes { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.td-row { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; }
.td-mini { width: 40px; height: 30px; }
.td-ptr { display: inline-block; width: 18px; height: 18px; margin-top: -4px; }
.td-ptr svg { width: 100%; height: 100%; }
.td-theme small { font-size: 9.5px; color: var(--dim); text-align: center; line-height: 1.15; }
