/* Муляж Pages: размеры и цвета сняты с живого интерфейса. */

@font-face { font-family: 'dsText'; src: url('fonts/NeueHaasUnicaW1G-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap }
@font-face { font-family: 'dsText'; src: url('fonts/NeueHaasUnicaW1G-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap }
@font-face { font-family: 'dsText'; src: url('fonts/NeueHaasUnicaW1G-Bold.woff2') format('woff2'); font-weight: 600; font-display: swap }
@font-face { font-family: 'dsHeading'; src: url('fonts/TinkoffSans.woff2') format('woff2'); font-weight: 400; font-display: swap }
@font-face { font-family: 'dsHeading'; src: url('fonts/DSHeading_Medium.woff2') format('woff2'); font-weight: 500; font-display: swap }
@font-face { font-family: 'dsHeading'; src: url('fonts/DSHeading_Bold.woff2') format('woff2'); font-weight: 600; font-display: swap }

:root {
  /* токены из tui-tokens.json */
  --accent-1: #ffdd2d;
  --accent-1-hover: #ffcd33;
  --accent-1-pressed: #fab619;
  --accent-2: #428bf9;
  --accent-2-hover: #126df7;
  --link: #126df7;
  --neutral-1: #f6f7f8;
  --neutral-2: #eaecee;
  --dark: #333333;
  --purple: #9a6bff;
  --blue-icon: #66a3ff;
  --danger: #f52222;
  --warning: #faa805;
  --success-pale: rgba(0, 185, 45, .16);

  --text-primary: rgba(0, 0, 0, .8);
  --text-secondary: rgba(0, 0, 0, .54);
  --text-tertiary: rgba(0, 0, 0, .4);
  --icon-neutral: rgba(0, 16, 36, .22);
  --line: rgba(0, 16, 36, .12);

  --topbar-h: 48px;
  --left-w: 256px;
  --right-w: 364px;

  --shadow-menu: 0 5px 20px rgba(0, 0, 0, .1), inset 0 0 0 1px rgba(0, 16, 36, .12);
  --shadow-menu-dark: 0 5px 20px rgba(0, 0, 0, .1), inset 0 0 0 1px rgba(255, 255, 255, .15);
  --shadow-dropdown: 0 25px 15px rgba(0, 0, 0, .03), 0 11px 11px rgba(0, 0, 0, .04), 0 3px 6px rgba(0, 0, 0, .05);
}

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

body {
  font-family: dsText, -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--neutral-1);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer }
a { color: var(--link); text-decoration: none }

.i { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px }
.i svg { width: 100%; height: 100%; display: block }

/* ── общий топбар ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  height: var(--topbar-h); padding: 8px;
  background: var(--dark); color: #fff;
}
.topbar .ibtn { color: #fff }

.ibtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  color: var(--text-tertiary); transition: background .12s;
}
.ibtn:hover { background: rgba(255, 255, 255, .12) }
.ibtn.on-light:hover { background: rgba(0, 0, 0, .06) }
.ibtn.sm { width: 24px; height: 24px; border-radius: 4px }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 4px 8px; border-radius: 8px;
  font-size: 13px; line-height: 16px; white-space: nowrap;
}
.btn-yellow { background: var(--accent-1); color: var(--dark) }
.btn-yellow:hover { background: var(--accent-1-hover) }
.btn-purple { background: var(--purple); color: #fff }
.btn-ghost { color: rgba(255, 255, 255, .6) }
.btn:disabled { opacity: .4; cursor: default }

.badge {
  display: inline-flex; align-items: center;
  height: 16px; padding: 0 2px; border-radius: 4px;
  font-size: 11px; line-height: 13px; color: var(--text-primary);
}
.badge-yellow { background: var(--warning) }
.badge-grey { background: var(--neutral-2); height: 24px; padding: 0 4px; border-radius: 4px; font-size: 13px }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px 0 4px; border-radius: 100px;
  background: var(--success-pale); font-size: 13px; line-height: 16px;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #00b92d }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  font-size: 13px; font-weight: 500; line-height: 20px;
  background: var(--neutral-2); color: var(--text-primary);
}
.avatar.accent { background: var(--accent-2); color: #fff }

/* ── разводящая ─────────────────────────────────────────────── */
.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px }
.nav a {
  padding: 6px 10px; border-radius: 6px;
  font-size: 15px; line-height: 20px; font-weight: 500; color: rgba(255, 255, 255, .6);
}
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff }
.nav a.active { background: rgba(255, 255, 255, .16); color: #fff }

.shell { display: flex; min-height: calc(100vh - var(--topbar-h)) }

.sidebar {
  width: var(--left-w); flex: none; background: #fff;
  border-right: 1px solid var(--line);
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 8px 8px 8px 12px;
}
.project-select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 32px; padding: 0 8px; border-radius: 8px;
  font-size: 15px; line-height: 20px;
}
.project-select:hover { background: var(--neutral-1) }

.tree { padding: 4px 0 }
.tree-row {
  display: flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 8px 0 4px; cursor: pointer;
}
.tree-row:hover { background: var(--neutral-1) }
.tree-row.active { background: rgba(66, 139, 249, .12) }
.tree-row .chev { color: var(--icon-neutral); transition: transform .15s }
.tree-row .chev.open { transform: rotate(90deg) }
.tree-row .file { color: var(--blue-icon) }
.tree-row .label { flex: 1; font-size: 13px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tree-row .row-dots { opacity: 0; color: var(--text-secondary) }
.tree-row:hover .row-dots { opacity: 1 }

.content { flex: 1; min-width: 0 }

.page-head { padding: 16px 32px; background: #fff }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary) }
.crumbs .sep { color: var(--icon-neutral) }
.page-url {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  font-size: 15px; font-weight: 500; line-height: 24px;
}
.page-url a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px }
.page-url .ok { color: #00b92d }
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px }
.head-actions { display: flex; align-items: center; gap: 8px }
.add-tags {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 12px;
  font-size: 13px; line-height: 20px; color: var(--text-secondary);
}

.tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: 8px; width: fit-content;
}
.tabs-wrap { padding: 16px 32px; background: #fff; border-top: 1px solid var(--line) }
.tab {
  height: 28px; padding: 0 6px; border-radius: 6px;
  font-size: 13px; line-height: 16px; color: var(--text-primary);
}
.tab:hover { background: var(--neutral-1) }
.tab.active { background: #fff; box-shadow: inset 0 0 0 1px var(--line) }
.tab-sep { width: 1px; height: 16px; background: var(--line); margin: 0 6px }

.displays { padding: 24px 32px 48px }
.display-block + .display-block { margin-top: 32px }
.display-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.display-head .title { display: flex; align-items: center; gap: 12px }
.display-head h2 { font-size: 15px; font-weight: 400; line-height: 24px; color: #000 }
.display-head .meta { display: flex; align-items: center; gap: 24px; color: var(--text-secondary) }
.display-head .meta button { display: inline-flex; align-items: center; gap: 6px; color: inherit; font-size: 13px }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px }
.drafts-label { margin: 20px 0 8px; font-size: 11px; line-height: 16px; color: var(--text-secondary) }

.card {
  display: block; width: 100%; text-align: left;
  padding: 16px; border-radius: 12px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: inset 0 0 0 1px rgba(66, 139, 249, .5), 0 5px 20px rgba(0, 0, 0, .08) }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px }
.card-title { display: flex; align-items: center; gap: 6px; font-size: 15px; line-height: 20px }
.card-title .i { color: var(--blue-icon) }
.card-title .warn { color: var(--icon-neutral) }
.card-sub { margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--text-secondary) }
.card-actions { display: flex; align-items: center; gap: 4px }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px }

.card-preview {
  margin-top: 12px; border-radius: 8px; overflow: hidden;
  background: var(--neutral-1); box-shadow: inset 0 0 0 1px var(--line);
  height: 200px; display: flex; justify-content: center;
}
.card-preview[data-preview="mobile"] { height: 280px }
.card-preview .mini { transform-origin: top center; flex: none }


.card-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 96px; border-radius: 8px;
  border: 1px dashed var(--icon-neutral); color: var(--icon-neutral);
  background: none; cursor: pointer;
}
.card-placeholder:hover { border-color: var(--accent-2); color: var(--accent-2) }

/* ── конструктор ────────────────────────────────────────────── */
.editor { display: flex; height: calc(100vh - var(--topbar-h)); overflow: hidden }

.zoom {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 4px; border-radius: 4px; font-size: 13px;
}
.zoom:hover { background: rgba(255, 255, 255, .12) }
.topbar .url { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-left: 8px }
.topbar .chip {
  height: 24px; padding: 0 4px; border-radius: 4px;
  background: rgba(255, 255, 255, .12); display: inline-flex; align-items: center;
}
.topbar .chip.grey { background: var(--neutral-2); color: var(--dark) }
.spacer { flex: 1 }

.blocks-panel {
  width: var(--left-w); flex: none; background: #fff;
  display: flex; flex-direction: column; border-right: 1px solid var(--line);
}
.blocks-head {
  display: flex; align-items: center; gap: 4px;
  height: 48px; padding: 8px 8px 8px 12px; flex: none;
}
.blocks-head .t { font-size: 15px; font-weight: 500; line-height: 24px; margin-right: 4px }
.blocks-head .ibtn { color: var(--text-tertiary) }
.blocks-head .magic { color: var(--purple) }
.blocks-head .plus { background: var(--accent-1); color: var(--dark); width: 32px; height: 32px; margin-left: auto }
.blocks-head .plus:hover { background: var(--accent-1-hover) }

.blocks-list { flex: 1; overflow-y: auto; padding: 4px 0 24px }
.block-group { margin: 0 8px 8px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line) }
.block-group + .block-group { margin-top: 8px }

.block-row {
  display: flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 4px 0 8px; cursor: pointer; border-radius: 6px;
}
.block-row:hover { background: var(--neutral-1) }
.block-row.active { background: rgba(66, 139, 249, .12) }
.block-row .type { color: var(--blue-icon); flex: none }
.block-row .type.plain { color: var(--icon-neutral) }
.block-row .type.error { color: var(--danger) }
.block-row .chev { color: var(--icon-neutral); flex: none }
.block-row .label {
  flex: 1; min-width: 0; font-size: 13px; line-height: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.block-row.muted .label { color: var(--text-tertiary) }
.block-row .dots { opacity: 0; color: var(--text-secondary) }
.block-row:hover .dots, .block-row.active .dots { opacity: 1 }
.block-row.child { padding-left: 24px }

.canvas { flex: 1; overflow: auto; background: var(--neutral-1); padding: 12px 0 64px }
.canvas-inner { background: #fff; margin: 0 auto; min-height: 100%; position: relative }
.canvas-inner.desktop { width: min(1216px, calc(100% - 24px)) }
.canvas-inner.mobile { width: 375px; box-shadow: 0 5px 20px rgba(0, 0, 0, .08) }

.settings-panel {
  width: var(--right-w); flex: none; background: #fff;
  border-left: 1px solid var(--line); overflow-y: auto;
}
.settings-head { padding: 16px 16px 0 }
.settings-title { display: flex; align-items: flex-start; gap: 8px }
.settings-title h2 {
  flex: 1; font-size: 17px; font-weight: 500; line-height: 28px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.settings-type {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 13px; line-height: 20px; color: var(--text-secondary);
}
.settings-type .i { color: var(--text-tertiary) }
.settings-tabs {
  display: flex; align-items: center; gap: 16px; margin-top: 12px;
  border-bottom: 1px solid var(--line);
}
.settings-tabs .t {
  height: 44px; font-size: 13px; color: var(--text-secondary); position: relative;
}
.settings-tabs .t.active { color: var(--text-primary) }
.settings-tabs .t.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--dark);
}
.settings-tabs .tools { margin-left: auto; display: flex; gap: 4px }

.settings-body { padding: 0 16px 48px }

.section { border-bottom: 1px solid var(--line) }
.section-head {
  display: flex; align-items: center; gap: 4px;
  width: 100%; padding: 14px 0; font-size: 16px; font-weight: 500; line-height: 26px;
}
.section-head .chev { color: var(--text-primary); transition: transform .15s }
.section-head.collapsed .chev { transform: rotate(-90deg) }
.section-body { padding-bottom: 12px; display: grid; gap: 12px }
.section-head.collapsed + .section-body { display: none }
.subsection { font-size: 14px; font-weight: 500; line-height: 26px; display: flex; align-items: center; gap: 4px }

.field {
  position: relative; height: 44px; border-radius: 8px;
  background: var(--neutral-1); padding: 6px 12px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center;
}
.field:hover { background: var(--neutral-2) }
.field .lbl { font-size: 11px; line-height: 13px; color: var(--text-secondary) }
.field .val { font-size: 13px; line-height: 20px; color: var(--text-primary) }
.field .req { color: var(--danger) }
.field .caret {
  position: absolute; right: 8px; top: 10px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
}
.field.with-swatch { padding-left: 50px }
.field .swatch {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line);
}

.text-field .cap { font-size: 13px; font-weight: 500; line-height: 20px; margin-bottom: 8px }
.text-area {
  border-radius: 8px; background: var(--neutral-1); padding: 8px 12px; min-height: 76px;
  display: flex; flex-direction: column; gap: 8px;
}
.text-area .tools { display: flex; gap: 8px; color: var(--text-tertiary) }
.text-area .value { font-size: 13px; line-height: 20px; flex: 1 }
.text-area .counter { align-self: flex-end; font-size: 13px; color: var(--text-secondary) }
.hint { font-size: 13px; line-height: 20px; color: var(--text-secondary) }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 20px; cursor: pointer }
.check .box {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  box-shadow: inset 0 0 0 1px var(--icon-neutral);
  display: flex; align-items: center; justify-content: center; color: var(--dark);
}
.check.on .box { background: var(--accent-1); box-shadow: none }
.check.on .box::after { content: '✓'; font-size: 12px; font-weight: 600 }

.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer }
.toggle .track {
  width: 36px; height: 20px; border-radius: 100px; flex: none;
  background: var(--neutral-2); position: relative; transition: background .15s;
}
.toggle .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s;
}
.toggle.on .track { background: var(--accent-1) }
.toggle.on .track::after { transform: translateX(16px) }

.repeater { display: grid; gap: 4px }
.repeater .item {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 8px; border-radius: 8px; font-size: 15px;
}
.repeater .item:hover { background: var(--neutral-1) }
.repeater .item .grip { color: var(--icon-neutral) }
.repeater .add { color: var(--link); font-size: 15px; height: 40px; padding: 0 8px; text-align: left }

.upload {
  border-radius: 8px; background: var(--neutral-1); padding: 8px 12px;
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.upload .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.thumb {
  margin-top: 8px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line);
  background: repeating-conic-gradient(#f0f0f0 0 25%, #fff 0 50%) 0 0/16px 16px;
  height: 148px; display: flex; align-items: center; justify-content: center;
}
.thumb-cap { padding: 8px 12px; font-size: 13px; color: var(--text-secondary) }

/* ── меню и модалка ─────────────────────────────────────────── */
.menu {
  position: fixed; z-index: 200; min-width: 175px; padding: 4px;
  border-radius: 8px; background: #fff; box-shadow: var(--shadow-menu);
}
.menu.dark { background: var(--dark); box-shadow: var(--shadow-menu-dark) }
.menu button {
  display: block; width: 100%; text-align: left;
  height: 28px; padding: 4px 6px; border-radius: 4px;
  font-size: 16px; line-height: 18.4px; color: var(--text-primary);
}
.menu.dark button { color: #fff }
.menu button:hover { background: var(--neutral-1) }
.menu.dark button:hover { background: rgba(255, 255, 255, .12) }

.dropdown {
  position: fixed; z-index: 200; padding: 0 4px;
  border-radius: 8px; background: #fff; box-shadow: var(--shadow-dropdown);
}
.dropdown button {
  display: block; width: 100%; text-align: left;
  height: 40px; padding: 6px 8px; border-radius: 6px; font-size: 16px;
}
.dropdown button:hover { background: var(--neutral-1) }
.dropdown button.sel { background: rgba(36, 74, 127, .08) }

.overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .7);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: 1000px; max-width: calc(100vw - 64px); height: 1200px; max-height: calc(100vh - 96px);
  background: #fff; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: center; gap: 24px; padding: 24px 40px 0 }
.modal-head .t { font-size: 15px; padding-bottom: 12px; color: var(--text-secondary); position: relative }
.modal-head .t.active { color: var(--text-primary) }
.modal-head .t.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--dark);
}
.modal-head .right { margin-left: auto; display: flex; align-items: center; gap: 12px; padding-bottom: 12px }
.modal-filters {
  display: flex; gap: 16px; padding: 20px 40px; border-top: 1px solid var(--line);
}
.modal-search {
  flex: 1; height: 44px; border-radius: 8px; padding: 0 12px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: inset 0 0 0 2px var(--dark); color: var(--text-tertiary);
}
.modal-search input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 15px; color: var(--text-primary) }
.modal-select {
  width: 320px; height: 44px; border-radius: 8px; background: var(--neutral-1);
  display: flex; align-items: center; justify-content: space-between; padding: 0 12px;
  color: var(--text-secondary); font-size: 15px;
}
.modal-chips { padding: 0 40px 20px; display: flex; gap: 8px }
.chip-btn {
  height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip-btn.active { background: var(--dark); color: #fff; box-shadow: none }
.modal-body { flex: 1; overflow: auto; border-top: 1px solid var(--line); padding: 24px 40px }
.empty { display: grid; place-items: center; gap: 12px; height: 100%; text-align: center; color: var(--text-secondary) }
.empty h3 { font-size: 20px; font-weight: 500; color: var(--text-primary) }
.empty .glyph {
  width: 80px; height: 80px; border-radius: 16px; background: var(--neutral-1);
  display: grid; place-items: center; color: var(--accent-2);
}
.catalog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px }
.catalog-item {
  padding: 12px; border-radius: 12px; text-align: left;
  box-shadow: inset 0 0 0 1px var(--line);
}
.catalog-item:hover { box-shadow: inset 0 0 0 1px var(--accent-2) }
.catalog-item .n { font-size: 15px; line-height: 20px }
.catalog-item .v { font-size: 13px; color: var(--text-secondary); margin-top: 2px }

/* ── превью страницы в канвасе ──────────────────────────────── */
.pv { font-family: dsText, sans-serif; color: #000 }
.pv [data-block] { position: relative; outline: 0; cursor: pointer }
.pv [data-block].sel { box-shadow: inset 0 0 0 2px var(--accent-2) }
.pv [data-block]:hover:not(.sel) { box-shadow: inset 0 0 0 1px rgba(66, 139, 249, .4) }

.pv-nav {
  display: flex; align-items: center; gap: 32px; padding: 20px 40px;
  font-size: 15px; font-weight: 500;
}
.pv-logo { display: flex; align-items: center; gap: 8px; font-family: dsHeading, sans-serif; font-weight: 600; letter-spacing: .02em }
.pv-logo .mark {
  width: 28px; height: 28px; border-radius: 6px; background: #000; color: var(--accent-1);
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
}
.pv-hero {
  position: relative; padding: 48px 40px 56px; overflow: hidden;
  background: linear-gradient(160deg, #fafafa 0%, #f2f3f5 100%);
}
.pv-hero h1 {
  font-family: dsHeading, sans-serif; font-weight: 700; letter-spacing: -.02em;
  font-size: 96px; line-height: .95; text-transform: uppercase;
}
.pv-hero .tag {
  display: inline-block; margin-top: 12px; padding: 8px 24px; border-radius: 999px;
  background: var(--accent-1); font-family: dsHeading, sans-serif; font-weight: 700;
  font-size: 40px; text-transform: uppercase;
}
.pv-error {
  display: grid; place-items: center; gap: 4px; padding: 24px;
  background: #ffe9e9; text-align: center;
}
.pv-error .t { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 500 }
.pv-error .t .dot {
  width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff;
  display: grid; place-items: center; font-size: 13px;
}
.pv-error .s { font-size: 13px; color: var(--text-secondary) }
.pv-grid { display: grid; gap: 16px; padding: 24px 40px }
.pv-grid.c3 { grid-template-columns: repeat(3, 1fr) }
.pv-grid.c2 { grid-template-columns: repeat(2, 1fr) }
.pv-tile {
  border-radius: 20px; padding: 24px; min-height: 180px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.pv-tile.yellow { background: var(--accent-1) }
.pv-tile.dark { background: #2b2b2b; color: #fff }
.pv-tile .h { font-size: 17px; line-height: 24px }
.pv-tile .pdf {
  align-self: flex-start; margin-top: 24px; padding: 8px 16px;
  border-radius: 12px; background: rgba(255, 255, 255, .16); font-size: 13px;
}
.pv-tile.yellow .pdf { background: rgba(0, 0, 0, .06) }
.pv-card {
  border-radius: 24px; padding: 32px; min-height: 260px; background: #2b2b2b; color: #fff;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.pv-card h3 { font-family: dsHeading, sans-serif; font-size: 28px; font-weight: 600 }
.pv-card p { margin-top: 8px; font-size: 15px; color: rgba(255, 255, 255, .7) }
.pv-card .more {
  margin-top: auto; align-self: flex-start; padding: 12px 24px;
  border-radius: 14px; background: rgba(255, 255, 255, .14); font-size: 15px;
}
.pv-section-title { padding: 48px 40px 8px; text-align: center }
.pv-section-title h2 { font-family: dsHeading, sans-serif; font-size: 44px; font-weight: 700 }
.pv-section-title p { margin-top: 12px; font-size: 15px; color: var(--text-secondary) }
.pv-foot { padding: 32px 40px; text-align: center; font-size: 13px; color: var(--text-secondary) }
.pv-pad { height: 24px }

/* мобильное превью */
.pv.mobile .pv-nav { padding: 16px; gap: 12px; justify-content: space-between }
.pv.mobile .pv-hero { padding: 24px 16px 32px; text-align: center }
.pv.mobile .pv-hero h1 { font-size: 34px }
.pv.mobile .pv-hero .tag { font-size: 18px; padding: 6px 14px }
.pv.mobile .pv-grid { grid-template-columns: 1fr; padding: 12px 16px; gap: 12px }
.pv.mobile .pv-tile { min-height: 96px; padding: 16px; border-radius: 16px }
.pv.mobile .pv-tile .h { font-size: 15px; line-height: 20px }
.pv.mobile .pv-tile .pdf { margin-top: 12px }
.pv.mobile .pv-card { min-height: 200px; padding: 20px; border-radius: 18px }
.pv.mobile .pv-card h3 { font-size: 20px }
.pv.mobile .pv-section-title { padding: 32px 16px 4px }
.pv.mobile .pv-section-title h2 { font-size: 24px }
.pv.mobile .pv-error { padding: 16px }
.pv.mobile .pv-error .t { font-size: 15px }

/* ── живой блок и кадрирование: всё ниже принадлежит единственному блоку муляжа, который ходит в реестр ── */

.pv-hubpanel { padding: 24px 40px; }
.pv-panel {
  display: flex; align-items: stretch; gap: 24px;
  background: var(--neutral-1); border-radius: 24px; overflow: hidden;
}
.pv-panel-text { flex: 1; min-width: 0; padding: 40px; align-self: center; }
.pv-panel-text h3 { font-family: dsHeading, sans-serif; font-size: 30px; font-weight: 700 }
.pv-panel-text p { margin-top: 16px; font-size: 17px; line-height: 24px; max-width: 44ch }

/* Место под картинку, оно же маска кадра: кадрирование берёт пропорцию отсюда. */
.pv-panel-media {
  position: relative; flex: 0 0 48%; aspect-ratio: 1.9; align-self: stretch;
  border-radius: 0 24px 24px 0; overflow: hidden;
}
.pv-panel-img { display: block; width: 100%; height: 100%; object-fit: cover }
.pv-panel-blank {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  height: 100%; background: #eef0f2; border: 1px dashed #c6ccd2; border-radius: inherit;
  color: #7c8792; font-size: 14px;
}
.pv-panel-blank .plus { font-size: 28px; line-height: 1; color: #b3bbc2 }
.pv [data-block].sel .pv-panel-blank { border-color: var(--accent-2); color: var(--accent-2) }

/* Кнопки появляются по наведению на место под картинку, в уменьшенном превью разводящей их нет. */
.pv-media-tools {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  display: flex; gap: 8px; opacity: 0; transition: opacity .12s;
}
.pv-panel-media:hover .pv-media-tools { opacity: 1 }
.mini .pv-media-tools { display: none }
.pv-media-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .96); color: var(--text-primary);
  font-size: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
}
.pv-media-btn:hover { background: #fff }
.pv-media-btn.only-icon { width: 32px; padding: 0; color: var(--text-secondary) }

.pv.mobile .pv-hubpanel { padding: 12px 16px }
.pv.mobile .pv-panel { flex-direction: column; gap: 0 }
.pv.mobile .pv-panel-text { padding: 20px; align-self: auto }
.pv.mobile .pv-panel-text h3 { font-size: 20px }
.pv.mobile .pv-panel-text p { margin-top: 8px; font-size: 15px; line-height: 20px }
.pv.mobile .pv-panel-media { flex: none; width: 100%; aspect-ratio: 1.6; border-radius: 0 0 24px 24px }

.crop-layer {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center;
  justify-content: center; background: rgba(0, 0, 0, .45);
}
.crop-box {
  display: flex; flex-direction: column; width: min(920px, 92vw); height: min(680px, 90vh);
  background: #fff; border-radius: 12px; box-shadow: 0 5px 20px rgba(0, 0, 0, .1); overflow: hidden;
}
.crop-head, .crop-foot {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex: none;
}
.crop-head { border-bottom: 1px solid #eceff1; }
.crop-foot { border-top: 1px solid #eceff1; }
.crop-head .t { font-weight: 600; }
.crop-head .who, .crop-note { color: #7c8792; font-size: 12px; }
.crop-head .who { margin-right: auto; }
.crop-note { margin-right: auto; }
.crop-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.crop-wait, .crop-empty { display: grid; place-content: center; height: 100%; color: #7c8792; text-align: center; }
.crop-empty .dim { font-size: 12px; }

.crop-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.crop-card .th {
  display: block; aspect-ratio: 4 / 3; margin-bottom: 8px; border-radius: 8px;
  background: #f1f3f5 center / contain no-repeat;
}
.crop-card .th.ready { background-color: #eceff1 }
.crop-card .th.fail { background: repeating-linear-gradient(45deg, #f1f3f5 0 6px, #e6e9ec 6px 12px) }
.crop-card {
  display: block; text-align: left; padding: 12px; border: 1px solid #eceff1; border-radius: 8px;
  background: #fff; cursor: pointer; font: inherit;
}
.crop-card:hover { border-color: #428bf9; }
.crop-card .n { display: block; font-size: 13px; margin-bottom: 4px; word-break: break-word; }
.crop-card .d { display: block; font-size: 11px; color: #7c8792; }

.crop-signin { display: grid; gap: 12px; max-width: 320px; margin: 24px auto; }
.crop-signin .dim { font-size: 12px; color: #7c8792; margin: 0; }
.crop-signin label { display: grid; gap: 4px; font-size: 11px; color: #7c8792; }
.crop-signin input {
  height: 40px; padding: 0 12px; border: 1px solid #d5dade; border-radius: 8px;
  font: inherit; font-size: 14px; color: #333;
}
.crop-signin input:focus { outline: none; border-color: #428bf9; }
.crop-err { font-size: 12px; color: #e5322d; min-height: 16px; }

/* ── позиционирование картинки в самом блоке: выступающее за маску показано вполсилы, соседи притушены ── */

.editor.placing .blocks-panel,
.editor.placing .settings-panel { display: none }
/* Канвас на время позиционирования не прокручивается. */
.editor.placing .canvas { overflow: hidden }

.pv.placing [data-block] { opacity: .18; pointer-events: none; transition: opacity .15s }
.pv.placing [data-block].placing-block { opacity: 1; pointer-events: auto }
.pv.placing [data-block]:hover:not(.sel) { box-shadow: none }
/* Карточка не обрезает картинку, выступающую за её края. */
.pv.placing .placing-block .pv-panel,
.pv.placing .placing-block .pv-panel-media { overflow: visible }
.pv.placing .placing-block .pv-media-tools { display: none }

.pv-place { position: absolute; inset: 0; z-index: 3; touch-action: none; user-select: none; cursor: move }
.pv-place-ghost, .pv-place-live {
  position: absolute; max-width: none; pointer-events: none; transform-origin: 50% 50%;
}
.pv-place-ghost { opacity: .28 }
/* Дырка под маску: внутри неё картинка видна целиком, снаружи остаётся только призрак. */
.pv-place-hole { position: absolute; inset: 0; overflow: hidden; border-radius: inherit }
.pv-place-frame {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  outline: 1.5px solid var(--accent-2); outline-offset: -1px;
}
.pv-place-wait {
  position: absolute; inset: 0; z-index: 3; display: grid; place-content: center;
  background: rgba(255, 255, 255, .82); color: var(--text-secondary); font-size: 13px;
}
.pv-place-wait.bad { color: var(--danger) }

/* Зацепы сидят на самой картинке и едут вместе с ней. */
.pv-place-grips { position: absolute; pointer-events: none; transform-origin: 50% 50% }
.pv-place-grips .g {
  position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  display: grid; place-content: center; pointer-events: auto;
}
.pv-place-grips .g::before {
  content: ""; width: 11px; height: 11px; background: #fff; border: 2px solid var(--accent-2);
  border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.pv-place-grips .g[data-grip="nw"] { left: 0; top: 0; cursor: nwse-resize }
.pv-place-grips .g[data-grip="ne"] { left: 100%; top: 0; cursor: nesw-resize }
.pv-place-grips .g[data-grip="se"] { left: 100%; top: 100%; cursor: nwse-resize }
.pv-place-grips .g[data-grip="sw"] { left: 0; top: 100%; cursor: nesw-resize }
/* Зацеп поворота стоит снаружи картинки, на ножке. */
.pv-place-grips .turn {
  position: absolute; left: 50%; top: 0; width: 26px; height: 26px; margin: -50px 0 0 -13px;
  display: grid; place-content: center; cursor: grab; pointer-events: auto;
}
.pv-place-grips .turn::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 24px;
  margin-left: -1px; background: var(--accent-2);
}
.pv-place-grips .turn::before {
  content: ""; width: 15px; height: 15px; border: 2.5px solid var(--accent-2);
  border-top-color: transparent; border-radius: 50%; transform: rotate(-45deg);
  background: rgba(255, 255, 255, .9);
}
.pv-place-grips .turn:active { cursor: grabbing }

/* Панель подтверждения под блоком. */
.pv-place-bar {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 4;
  display: flex; align-items: center; gap: 8px; padding: 8px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-dropdown), inset 0 0 0 1px var(--line);
  cursor: default;
}
.pv-place-bar .note { padding: 0 8px; font-size: 12px; color: var(--text-secondary); white-space: nowrap }
/* Кнопка «Отмена» на светлом фоне, btn-ghost рассчитан на тёмный топбар. */
.crop-foot .btn-ghost,
.pv-place-bar .btn-ghost { color: var(--text-secondary) }
.crop-foot .btn-ghost:hover,
.pv-place-bar .btn-ghost:hover { background: rgba(0, 16, 36, .06) }

/* Что стоит в живом блоке — строкой в правой панели. */
.hub-slot { padding: 12px; border-radius: 8px; background: var(--neutral-1) }
.hub-slot.empty { color: var(--text-tertiary); font-size: 12px }
.hub-slot .n { font-size: 13px; word-break: break-word }
.hub-slot .d { display: block; margin-top: 4px; font-size: 11px; color: var(--text-secondary) }
