:root {
  --bg: #F5F5F7;
  --panel: #FFFFFF;
  --text: #16161A;
  --muted: #6B6B76;
  --faint: #9A9AA5;
  --line: #E6E6EC;
  --line-strong: #D4D4DC;
  --accent: #5B3DF5;
  --accent-hover: #4A2EE0;
  --accent-soft: #EEEAFE;
  --danger: #D93A3F;
  --danger-soft: #FDECEC;
  --ok: #1A7F43;
  --ok-soft: #E7F6EC;
  --warn: #B4690E;
  --warn-soft: #FFF4E0;
  --r: 14px;
  --shadow: 0 1px 2px rgba(16, 16, 26, .04), 0 0 0 1px var(--line);
  --shadow-lg: 0 12px 40px rgba(16, 16, 26, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg { display: block; flex: none; }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 17px; line-height: 1.3; }
h3 { font-size: 15px; line-height: 1.3; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--faint); font-weight: 700; letter-spacing: .04em; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.lg { gap: 20px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Каркас ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-name { display: inline-flex; align-items: flex-end; line-height: 1; }
.brand-name b { font: 800 21px/1 "Unbounded", system-ui, sans-serif; letter-spacing: -.02em; background: linear-gradient(100deg, #7350FF 0%, #C94BFF 50%, #FF4FA3 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 1px; }
.brand-name svg { width: 13px; height: 13px; align-self: flex-start; margin: -6px 0 0 1px; }
.brand-name small { font: 800 9px/1 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin: 0 0 3px 8px; }
@media (max-width: 380px) { .brand-name small { display: none; } }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link .count { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side .spacer { flex: 1; }
.side .who { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.side .who b { display: block; color: var(--text); font-size: 14px; }
.main { min-width: 0; padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.topbar, .tabbar { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: rgba(245, 245, 247, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; font-size: 16px; }
  .topbar .brand-name b { font-size: 19px; }
  .topbar .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--faint); padding: 4px 0; position: relative; }
  .tabbar a.active { color: var(--accent); }
  .tabbar .dot { position: absolute; top: 2px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
  h1 { font-size: 21px; }
}

/* ---------- Заголовок страницы ---------- */
.ph { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.ph h1 { flex: 1; min-width: 0; }
.ph .sub { width: 100%; color: var(--muted); margin-top: -6px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.back-link:hover { color: var(--text); }

/* ---------- Панели ---------- */
.panel { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel h2 + * { margin-top: 12px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 860px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.c2.collapse { grid-template-columns: minmax(0, 1fr); } }

.kpi { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .s { color: var(--faint); font-size: 12px; margin-top: 2px; }

.onboard { display: flex; gap: 18px; align-items: flex-start; padding: 22px; background: linear-gradient(135deg, #F3EFFF 0%, #FFFFFF 60%); box-shadow: 0 0 0 1.5px #DCD3FF; }
.onboard-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
@media (max-width: 600px) { .onboard { flex-direction: column; } }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 11px; font-weight: 650; background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line-strong) inset; white-space: nowrap; transition: background .12s, box-shadow .12s, transform .08s; }
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: none; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { box-shadow: none; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(0, 0, 0, .04); color: var(--text); }
.btn.danger { color: var(--danger); box-shadow: 0 0 0 1px #F3C6C7 inset; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; box-shadow: none; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: 13px; }
.btn.block { width: 100%; }
.iconbtn { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--muted); flex: none; }
.iconbtn:hover { background: rgba(0, 0, 0, .05); color: var(--text); }
.iconbtn:disabled { opacity: .3; pointer-events: none; }
.iconbtn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 650; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, .textarea, .select { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel); outline: none; transition: border-color .12s, box-shadow .12s; font-size: 15px; }
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.code { font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 860px) { .input, .textarea, .select { font-size: 16px; } }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; flex: none; transition: background .15s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch .txt { font-size: 14px; line-height: 1.4; }

.seg { display: inline-flex; background: #EBEBF0; border-radius: 11px; padding: 3px; gap: 2px; }
.seg button, .seg a { padding: 7px 14px; border-radius: 8px; font-weight: 650; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg .on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { background: var(--danger); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
/* На узком экране — плитки в 3 колонки, чтобы все вкладки были видны сразу */
@media (max-width: 860px) {
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border-bottom: 0; overflow: visible; }
  .tabs a { justify-content: center; margin: 0; padding: 9px 4px; border: 0; border-radius: 10px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); font-size: 13px; gap: 5px; }
  .tabs a.on { background: var(--accent); color: #fff; box-shadow: none; }
}

/* ---------- Списки, бейджи ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li.top { align-items: flex-start; }
.li.click { cursor: pointer; }
.li.click:hover { background: #FAFAFC; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { color: var(--text); margin-bottom: 4px; font-size: 16px; }
.empty p { max-width: 380px; margin: 0 auto 16px; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }

.avatar { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; flex: none; overflow: hidden; background-size: cover; background-position: center; }

/* ---------- Карточки заведений ---------- */
.biz { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 14px; color: var(--text); transition: box-shadow .15s, transform .15s; }
.biz:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 6px 20px rgba(16, 16, 26, .06); }
.biz .nm { font-weight: 750; font-size: 16px; }
.biz .stats { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.biz .stats b { color: var(--text); }
.biz-open { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.biz-open svg:last-child { margin-left: auto; }
.biz:hover .biz-open { background: var(--accent); color: #fff; }

/* ---------- Модалка ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(16, 16, 26, .45); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fadein .15s; }
.modal { background: var(--panel); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-head h2 { flex: 1; font-size: 19px; }
.modal-body { padding: 12px 20px 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; }
@media (max-width: 600px) {
  .backdrop { place-items: end stretch; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .modal-foot .btn { flex: 1; }
}
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Тосты ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1D1D22; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .2s; max-width: calc(100vw - 32px); }
.toast.error { background: var(--danger); }
@media (max-width: 860px) { .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* ---------- Редактор ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.editor .preview-col { position: sticky; top: 20px; }
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } .editor .preview-col { display: none; } }
.phone { width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 9 / 18.5; max-height: calc(100vh - 110px); border-radius: 44px; background: #111; padding: 12px; box-shadow: var(--shadow-lg); }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 33px; background: #fff; display: block; }
.preview-cap { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); font-weight: 600; }
.save-state.saving { color: var(--warn); }
.save-state.error { color: var(--danger); }
.save-state .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fab-preview { display: none; }
@media (max-width: 1100px) {
  .fab-preview { display: inline-flex; position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: var(--shadow-lg); }
}
@media (min-width: 861px) and (max-width: 1100px) { .fab-preview { bottom: 24px; } }
.preview-full { position: fixed; inset: 0; z-index: 120; background: #111; display: flex; flex-direction: column; }
.preview-full iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.preview-full .bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: #fff; padding-top: calc(10px + env(safe-area-inset-top)); }

.blk { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); transition: box-shadow .15s; }
.blk.off { opacity: .6; }
.blk.open { box-shadow: 0 0 0 1.5px var(--accent), 0 6px 24px rgba(91, 61, 245, .08); opacity: 1; }
.blk-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; cursor: pointer; user-select: none; }
.blk-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.blk-title { flex: 1; min-width: 0; }
.blk-title b { display: block; font-weight: 700; }
.blk-title span { display: block; font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-tools { display: flex; align-items: center; gap: 2px; }
.blk-body { padding: 6px 16px 18px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.blk-warn { font-size: 12px; font-weight: 700; color: var(--warn); }

.add-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.add-grid button { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bg); text-align: left; font-weight: 650; font-size: 14px; }
.add-grid button:hover { background: var(--accent-soft); color: var(--accent); }
.add-grid .blk-ic { width: 32px; height: 32px; background: var(--panel); }

.cat { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #FBFBFD; }
.item-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: start; padding: 10px; background: var(--panel); border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
.item-row .fields { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.item-row .fields .textarea { grid-column: 1 / -1; min-height: 42px; }
.item-row .tools { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 600px) { .item-row { grid-template-columns: 56px 1fr; } .item-row .tools { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; } .item-row .fields { grid-template-columns: 1fr; } }

.photo { width: 64px; height: 64px; border-radius: 10px; background: var(--bg); border: 1.5px dashed var(--line-strong); display: grid; place-items: center; color: var(--faint); cursor: pointer; overflow: hidden; position: relative; background-size: cover; background-position: center; }
.photo.has { border: 0; }
.photo.big { width: 100%; height: 120px; }
.photo.round { border-radius: 50%; width: 84px; height: 84px; }
.photo input { display: none; }
.photo .x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.photo.loading::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .7) ; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sw { border-radius: 14px; padding: 10px; text-align: left; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .12s, transform .12s; }
.sw:hover { transform: translateY(-1px); }
.sw.on { box-shadow: 0 0 0 2.5px var(--accent); }
.sw .mini { border-radius: 10px; padding: 10px 8px; display: flex; flex-direction: column; gap: 5px; }
.sw .mini i { display: block; height: 10px; border-radius: 4px; }
.sw .nm { font-size: 13px; font-weight: 700; margin-top: 8px; color: var(--text); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.gallery-cell { display: flex; flex-direction: column; gap: 4px; }
.gallery-cell .photo { width: 100%; height: auto; aspect-ratio: 3 / 4; }
.style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st { border-radius: 14px; padding: 8px; box-shadow: 0 0 0 1px var(--line); background: var(--panel); text-align: left; transition: box-shadow .12s, transform .12s; }
.st:hover { transform: translateY(-1px); }
.st.on { box-shadow: 0 0 0 2.5px var(--accent); }
.st-prev { height: 92px; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; justify-content: center; overflow: hidden; }
.st-prev i { display: block; height: 18px; border-radius: 6px; }
.st .nm { font-size: 13px; font-weight: 700; margin-top: 7px; }
.decor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.dc { border-radius: 14px; padding: 8px; text-align: left; box-shadow: 0 0 0 1px var(--line); background: var(--panel); transition: box-shadow .12s, transform .12s; }
.dc:hover { transform: translateY(-1px); }
.dc.on { box-shadow: 0 0 0 2.5px var(--accent); }
.dc-prev { height: 54px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 22px; overflow: hidden; }
.dc-prev svg { width: 22px; height: 22px; }
.dc .nm { font-size: 13px; font-weight: 700; margin-top: 7px; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bars .b { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .b:hover { opacity: 1; }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1D1D22; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.hbar { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; padding: 5px 0; }
.hbar .t { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.hbar .t i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.owner-access { box-shadow: 0 0 0 1.5px #DCD3FF, 0 6px 24px rgba(91, 61, 245, .07); }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 11px; padding: 6px 6px 6px 12px; }
.copybox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.note { background: var(--accent-soft); color: #3A2A9C; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.note.warn { background: var(--warn-soft); color: #7A4706; }
.note.danger { background: var(--danger-soft); color: #9B1C20; }
.stars { color: #FFB800; letter-spacing: 1px; white-space: nowrap; }

@media (max-width: 600px) {
  .ph h1 { flex-basis: 100%; white-space: normal; }
  .head-row { flex-direction: column; align-items: stretch !important; }
  .head-row > .field { align-items: flex-start !important; }
  .blk-head { padding: 10px 6px 10px 10px; gap: 8px; }
  .blk-tools .iconbtn { width: 30px; height: 30px; }
  .blk-ic { width: 32px; height: 32px; border-radius: 9px; }
  .blk-body { padding: 14px 12px 16px; }
  .cat { padding: 10px; }
  .item-row { padding: 8px; }
}

/* ---------- Вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden;
  background: radial-gradient(55% 45% at 8% 8%, #E3DAFF 0%, transparent 70%), radial-gradient(50% 50% at 95% 95%, #FFE0EC 0%, transparent 70%),
              radial-gradient(40% 40% at 92% 8%, #D9F1FF 0%, transparent 70%), radial-gradient(40% 40% at 5% 95%, #FFF1D6 0%, transparent 70%), var(--bg); }
.auth .panel { width: 100%; max-width: 400px; padding: 28px 24px; position: relative; z-index: 1; box-shadow: 0 24px 70px rgba(91, 61, 245, .14), 0 0 0 1px var(--line); border-radius: 22px; }
.auth-deco { position: absolute; inset: 0; pointer-events: none; }
.auth-deco span { position: absolute; line-height: 1; opacity: .75; transform: translate(-50%, -50%) rotate(var(--rt)); animation: drift 7s ease-in-out infinite alternate; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .08)); }
@keyframes drift { to { transform: translate(-50%, calc(-50% - 14px)) rotate(calc(var(--rt) + 8deg)); } }
@media (prefers-reduced-motion: reduce) { .auth-deco span { animation: none; } }
@media (max-width: 600px) { .auth-deco span { opacity: .45; } }
.auth .brand { justify-content: center; padding: 0 0 18px; font-size: 20px; }
.auth .brand-mark { width: 40px; height: 40px; border-radius: 12px; }

/* ---------- Прошивка NFC ---------- */
.nfc-stage { text-align: center; padding: 28px 16px; }
.nfc-ring { width: 150px; height: 150px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); position: relative; }
.nfc-ring.wait::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--accent); opacity: .3; animation: pulse 1.4s ease-out infinite; }
.nfc-ring.ok { background: var(--ok-soft); color: var(--ok); }
.nfc-ring.err { background: var(--danger-soft); color: var(--danger); }
@keyframes pulse { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.15); opacity: 0; } }
.nfc-code { font: 800 34px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; }
