@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Serif:wght@400;600;700&display=swap');

:root {
  --bg-primary: #f4f5f7;
  --bg-secondary: #eef0f3;
  --bg-tertiary: #ffffff;
  --bg-hover: #e2e6eb;
  --text-primary: #1c2128;
  --text-secondary: #4b5563;
  --text-muted: #5c6570;
  --accent-orange: #c45c2a;
  --accent-deep: #9a4520;
  --accent-yellow: #b45309;
  --accent-blue: #2563eb;
  --accent-green: #15803d;
  --accent-red: #b91c1c;
  --border-color: #d8dde3;
  --border-light: #b8bec6;
  --shadow: 0 20px 40px rgba(17, 24, 39, 0.08);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.08);
  --focus-ring: 0 0 0 2px rgba(196, 92, 42, 0.25);
  --accent-tint: rgba(196, 92, 42, 0.12);
  --accent-tint-strong: rgba(196, 92, 42, 0.2);

  --paper: var(--bg-primary);
  --paper-deep: var(--bg-secondary);
  --ink: var(--text-primary);
  --ink-soft: var(--text-secondary);
  --ink-muted: var(--text-muted);
  --line: var(--border-color);
  --accent: var(--accent-orange);
  --sage: var(--accent-green);
  --sage-soft: rgba(21, 128, 61, 0.12);
  --blueprint: var(--accent-blue);
  --warn: var(--accent-yellow);
  --err: var(--accent-red);
  --ok: var(--accent-green);

  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'IBM Plex Serif', 'Georgia', 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --blueprint-bg: #e8edf4;
  --blueprint-line: rgba(37, 99, 235, 0.09);
  --blueprint-line-fine: rgba(37, 99, 235, 0.05);
  --screen-leave-ms: 0.34s;
  --screen-enter-ms: 0.48s;
  --dock-w: clamp(160px, 13vw, 220px);
  --dock-right-w: clamp(240px, 20vw, 300px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --topbar-h: 56px;
  --landing-wing-width: clamp(148px, 14vw, 240px);
  --landing-wing-offset: clamp(
    16px,
    calc((100vw - 1100px) / 2 - var(--landing-wing-width) + 12px),
    72px
  );
  --transition: 0.25s ease;
  --z-sticky: 50;
  --z-modal: 210;
  --z-toast: 300;
  --text-on-accent-muted: rgba(255, 255, 255, 0.88);
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-primary);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.site-header-ad {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-height: var(--topbar-h);
}

.site-header-ad:empty {
  display: none;
}

.topbar-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body:has(.screen--editor:not([hidden])) .app-main {
  overflow: hidden;
}

/* Focus & keyboard */
.brand:focus-visible,
.link-btn:focus-visible,
.btn:focus-visible,
.tool:focus-visible,
.chip:focus-visible,
.chat-send:focus-visible,
.chat-chip:focus-visible,
.modal-close:focus-visible,
.legal-banner__close:focus-visible,
.editor-welcome__close:focus-visible,
.guest-banner__close:focus-visible,
.partners-panel__toggle:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.tool.is-active:focus-visible,
.btn--primary:focus-visible {
  outline: none;
  box-shadow: inset 2px 0 0 var(--accent-orange), var(--focus-ring);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.chat-compose textarea:focus-visible {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: var(--focus-ring);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: var(--transition);
}

.brand:hover { opacity: 0.92; }

a.brand {
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-orange);
  border-radius: 8px;
  color: #ffffff;
}

.brand-mark--logo {
  background: linear-gradient(145deg, #e85d1a 0%, var(--accent-orange) 52%, var(--accent-deep) 100%);
  box-shadow: 0 4px 14px rgba(196, 92, 42, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-mark--svg {
  background: none;
  box-shadow: none;
  border: none;
  overflow: hidden;
  border-radius: 10px;
  padding: 0;
}

.brand-mark__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-logo-full,
.brand-logo-detail {
  display: none;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-logo-full {
  height: 34px;
  max-width: min(228px, 46vw);
}

.brand--header .brand-logo-full {
  display: block;
}

.brand--header > .brand-mark,
.brand--header > .brand-name {
  display: none;
}

@media (max-width: 640px) {
  .brand--header .brand-logo-full {
    display: none;
  }

  .brand--header > .brand-mark {
    display: flex;
  }

  .brand--header > .brand-name {
    display: inline;
  }
}

.brand-logo-detail {
  height: 38px;
  max-width: min(260px, 72vw);
}

@media (min-width: 520px) {
  .brand--detail-wide .brand-logo-detail {
    display: block;
  }

  .brand--detail-wide > .brand-mark,
  .brand--detail-wide > .brand-name {
    display: none;
  }
}

.brand-mark__letters {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  color: #fff;
  user-select: none;
}

.brand--footer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  text-decoration: none;
  color: inherit;
}

.brand--footer .brand-name {
  font-size: 1.05rem;
}

.brand-mark .ico { width: 20px; height: 20px; }

.brand-accent {
  color: var(--accent-orange);
}

.text-accent {
  color: var(--accent-orange);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  min-height: 36px;
}

.link-btn .ico { width: 16px; height: 16px; }

.link-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

a.link-btn { color: var(--ink-soft); }
a.link-btn:hover { color: var(--text-primary); }

/* Icons */
.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.ico--furniture { width: 20px; height: 20px; opacity: 0.85; }
.ico--accent { color: var(--accent-orange); }

.tool, .chip, .btn, .chat-send, .link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tool .ico { width: 18px; height: 18px; }
.tool.is-active .ico { color: inherit; }

.chip--icon { padding: 10px; min-width: 44px; min-height: 44px; flex-shrink: 0; }
.screen--editor .chip--icon {
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
}
.chip .ico { width: 16px; height: 16px; }
.chip-label { font-size: 0.72rem; }

.btn .ico { width: 16px; height: 16px; }
.btn--primary .ico,
.btn--wide.btn--primary .ico { color: #ffffff; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .anim-fade { animation: fadeIn 0.5s var(--ease-out) both; }
  .anim-rise { animation: riseIn 0.55s var(--ease-out) both; }
  .anim-delay-1 { animation-delay: 0.08s; }
  .anim-pop { animation: popIn 0.35s var(--ease-out) both; }
  .anim-in { animation: msgIn 0.3s var(--ease-out) both; }
  .anim-draw { animation: drawRuler 1.2s var(--ease-out) infinite; }

  .screen--active.screen { animation: riseIn 0.45s var(--ease-out) both; }

  .brief-card { transition: transform 0.25s var(--ease-out), box-shadow 0.25s; }
  .brief-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

  .tool { transition: background 0.15s ease, color 0.15s ease; }
  .tool:hover { transform: none; }
  .tool:active { transform: none; }

  .catalog-item { transition: border-color 0.2s, background 0.2s; }
  .loading-steps li.is-done { animation: tickDone 0.35s var(--ease-out) both; }
}

@media (prefers-reduced-motion: reduce) {
  .anim-fade,
  .anim-rise,
  .anim-pop,
  .anim-in,
  .anim-draw,
  .screen--active.screen,
  .screen--leave,
  .screen--enter,
  .screen--enter-active {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .brief-card:hover,
  .tool:hover,
  .btn--primary:hover {
    transform: none;
  }

  .loading-video-wrap {
    display: none;
  }

  .loading-bar-fill {
    transition: none;
  }

  .chat-dots span {
    animation: none;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.92); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tickDone {
  from { opacity: 0.4; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); color: var(--accent-green); }
}

@keyframes drawRuler {
  0%, 100% { opacity: 0.5; transform: scaleX(0.85); }
  50% { opacity: 1; transform: scaleX(1); }
}

.screen { display: none; }

.screen--brief:not([hidden]),
.screen--loading:not([hidden]),
.screen--editor:not([hidden]) {
  will-change: opacity, transform;
}

@media (prefers-reduced-motion: no-preference) {
  .screen--leave {
    opacity: 0;
    transform: translateY(-10px) scale(0.992);
    transition:
      opacity var(--screen-leave-ms) var(--ease-out),
      transform var(--screen-leave-ms) var(--ease-out);
    pointer-events: none;
  }

  .screen--enter {
    opacity: 0;
    transform: translateY(14px);
  }

  .screen--enter-active {
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity var(--screen-enter-ms) var(--ease-out),
      transform var(--screen-enter-ms) var(--ease-out);
  }

  .screen--loading.screen--enter {
    transform: translateY(10px) scale(0.996);
  }

  .screen--editor.screen--enter {
    transform: translateY(8px);
  }
}

.screen--active {
  display: flex;
  flex: 1;
}
.screen--loading:not([hidden]) {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 24%, #ffffff 68%);
}
.screen--editor {
  display: none;
  grid-template-columns: var(--dock-w) minmax(0, 1fr) var(--dock-right-w);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "banners banners banners"
    "tools canvas inspector"
    "footer footer footer";
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body:has(.screen--editor:not([hidden])) {
  overflow: hidden;
}

.screen--editor:not([hidden]) {
  display: grid;
}

/* Brief */
.screen--active.screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 60px;
}

.brief-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 48px;
  max-width: 1080px;
  width: 100%;
  align-items: start;
}

.brief-layout > * {
  min-width: 0;
}

.eyebrow,
.brief-lead-label {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.45;
}

.brief-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede {
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 36ch;
  margin-bottom: 24px;
  text-wrap: pretty;
}

.brief-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brief-points li {
  padding-left: 16px;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.brief-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-orange);
}

.brief-legal {
  margin-top: 20px;
  font-size: 0.8rem;
}

.brief-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.field-row--triple { grid-template-columns: repeat(3, 1fr); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field--full { margin-bottom: 12px; }

.field span {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: var(--focus-ring);
}

.btn {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font: inherit;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover { background: var(--bg-hover); border-color: var(--border-light); }

.btn:active { transform: translateY(1px); }

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--compact {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn--primary {
  background: var(--accent-orange);
  color: #ffffff;
  border: none;
  font-weight: 600;
}

.btn--primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(196, 92, 42, 0.25);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--wide {
  width: 100%;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}

.btn-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-on-accent-muted);
}

/* Loading — видео 3082×566, горизонтальное */
.loading-card {
  text-align: center;
  max-width: 400px;
  width: 100%;
  padding: 22px 22px 28px;
  border-radius: calc(var(--radius) + 3px);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.loading-video-wrap {
  position: relative;
  width: min(340px, 90vw);
  aspect-ratio: 3082 / 566;
  height: auto;
  margin: 0 auto 18px;
  border-radius: 14px;
  background: var(--bg-tertiary);
  overflow: hidden;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.loading-video-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0) 8%,
    rgba(255, 255, 255, 0) 92%,
    rgba(255, 255, 255, 0.88) 100%
  );
}

.loading-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  background: var(--bg-tertiary);
}

.loading-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.loading-bar {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.loading-bar-fill {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--accent-orange);
  transition: transform 0.12s linear;
}

.loading-steps {
  list-style: none;
  text-align: left;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.loading-steps li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border-color);
}

.loading-steps li.is-done { color: var(--accent-green); }

.loading-steps li.is-active {
  color: var(--text);
  font-weight: 600;
}

/* Editor layout — flat panels, canvas-first */
.dock {
  background: var(--bg-secondary);
  min-height: 0;
}

.dock--left {
  grid-area: tools;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 0;
  min-width: 160px;
  max-width: var(--dock-w);
  width: var(--dock-w);
}

.dock-left__main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dock-left__partners,
#partners-mount {
  flex: 0 0 auto;
  margin-top: auto;
  min-height: 0;
  max-height: min(36vh, 220px);
  overflow-y: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.dock--left .dock-title {
  flex-shrink: 0;
  margin-bottom: 6px;
}

.dock--left .tool-grid {
  flex-shrink: 0;
  margin-bottom: 0;
}

.dock--left .tool-grid + .dock-title {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.dock--left .catalog {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}

.catalog-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  margin-left: 4px;
}

.catalog-group {
  margin: 8px 0 4px;
  padding: 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.catalog-group:first-child {
  margin-top: 0;
}

.dock--right {
  grid-area: inspector;
  border-left: 1px solid var(--border-color);
  display: grid;
  grid-template-rows: minmax(88px, auto) minmax(220px, 1fr) minmax(0, auto);
  grid-template-areas:
    "props"
    "chat"
    "extras";
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-width: 240px;
  max-width: var(--dock-right-w);
  width: var(--dock-right-w);
  min-height: 0;
}

.dock--right .inspector-block,
.dock--right #chat-mount,
.dock--right input,
.dock--right textarea,
.dock--right select {
  min-width: 0;
  max-width: 100%;
}

.inspector-block--props {
  grid-area: props;
  flex: none;
  max-height: clamp(100px, 18vh, 168px);
  overflow-y: auto;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
}

#chat-mount {
  grid-area: chat;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  position: relative;
  z-index: 2;
  isolation: isolate;
}

#chat-mount > .chat-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.inspector-bottom {
  grid-area: extras;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  max-height: min(36vh, 280px);
  overflow-y: auto;
  padding: 0 10px 8px;
}

#lead-mount {
  flex: 0 0 auto;
}

.dock-title,
.inspector-heading {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
}

.tool-grid--wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool {
  width: 100%;
  height: 36px;
  min-width: 0;
  min-height: 36px;
  max-height: 36px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
}

.tool:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tool.is-active {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: inset 2px 0 0 var(--accent-orange);
}

.catalog {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.catalog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  cursor: grab;
  font-size: 0.82rem;
  background: transparent;
  color: var(--text-secondary);
}

.catalog-item:last-child {
  border-bottom: none;
}

.catalog-item:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  background: var(--bg-hover);
}

.catalog-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.catalog-item:active { cursor: grabbing; }

.workspace {
  grid-area: canvas;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-primary);
}

.workspace-bar {
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.workspace-bar__controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.workspace-bar__controls::-webkit-scrollbar {
  display: none;
}

.bar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.bar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  flex-shrink: 0;
  margin: 0 2px;
}

.chip {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.chip:hover { background: var(--bg-hover); color: var(--text-primary); }

.chip.is-on {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 600;
}

.zoom-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 40px;
  text-align: center;
  padding: 0 2px;
  flex-shrink: 0;
}

.canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: var(--bg-secondary);
  touch-action: none;
  overscroll-behavior: contain;
}

#plan-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

#plan-canvas.is-panning { cursor: grabbing; }
#plan-canvas.is-dragging { cursor: grabbing; }
#plan-canvas.can-move { cursor: move; }

.snap-toast {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: var(--z-toast);
}

.north-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.inspector-block { margin-bottom: 0; }

/* AI Chat — фиксированная высота, скролл только в сообщениях */
.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "head"
    "messages"
    "typing"
    "suggest"
    "compose";
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow: hidden;
}

.chat-head { grid-area: head; }
.chat-messages { grid-area: messages; }
.chat-typing { grid-area: typing; }
.chat-suggestions { grid-area: suggest; }
.chat-compose { grid-area: compose; }

.chat-head,
.chat-suggestions,
.chat-compose,
.chat-typing {
  flex-shrink: 0;
}

.chat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.chat-head .inspector-heading { margin-bottom: 0; }

.chat-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-badge--live {
  color: #16a34a;
}

.chat-messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 4px 2px 0;
  scrollbar-gutter: stable;
}

.chat-msg { display: flex; }
.chat-msg--user { justify-content: flex-end; }
.chat-msg--assistant { justify-content: flex-start; }

.chat-bubble {
  max-width: 94%;
  padding: 6px 9px;
  font-size: 0.8rem;
  line-height: 1.45;
  border-radius: 4px;
}

.chat-msg--user .chat-bubble {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.chat-msg--assistant .chat-bubble {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 2px 0 6px;
}

.chat-dots {
  display: inline-flex;
  gap: 3px;
}

.chat-dots span {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: chatDot 1s ease-in-out infinite;
}

.chat-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatDot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-bottom: 6px;
}

.chat-chip {
  border: none;
  background: transparent;
  font-size: 0.72rem;
  padding: 4px 0;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-light);
}

.chat-chip:hover {
  color: var(--text-primary);
  text-decoration-color: var(--text-secondary);
}

.chat-compose {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  position: relative;
  z-index: 2;
  background: var(--bg-tertiary);
  padding-top: 4px;
}

.chat-compose textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 7px 9px;
  font: inherit;
  font-size: 0.82rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 36px;
  max-height: 120px;
}

.chat-compose textarea:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: var(--focus-ring);
}

.chat-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  border-radius: 4px;
  background: var(--accent-orange);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-send:hover { background: var(--accent-deep); }
.chat-send:active { opacity: 0.92; }
.chat-send .ico { width: 16px; height: 16px; }

.properties-panel { font-size: 0.82rem; }

.prop-title { margin-bottom: 8px; font-size: 0.88rem; font-weight: 600; }

.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.prop-row label { color: var(--text-muted); font-size: 0.75rem; }

.prop-row input,
.prop-row select {
  width: 104px;
  padding: 4px 7px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font: inherit;
  font-size: 0.82rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.prop-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.prop-actions .btn { flex: 1; font-size: 0.75rem; padding: 5px 8px; }

.btn--danger { color: var(--accent-red); border-color: var(--accent-red); }
.btn--danger:hover { background: rgba(185, 28, 28, 0.1); }

.muted { color: var(--text-muted); font-size: 0.82rem; }

.prop-hint {
  margin: 4px 0 8px;
  line-height: 1.4;
  font-size: 0.72rem;
}

.prop-row input[type='range'] {
  width: 100%;
  margin: 4px 0;
}

.editor-footer {
  grid-area: footer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.footer-stats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.pdf-quota-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.editor-footer .btn:not(.btn--primary) {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 0.82rem;
}

.editor-footer .btn:not(.btn--primary):hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.editor-footer .btn--primary {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.modal {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0;
  max-width: min(440px, calc(100vw - 32px));
  width: min(440px, calc(100vw - 32px));
  max-height: min(calc(100vh - 48px), 90dvh);
  overflow: auto;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: var(--shadow);
  margin: auto;
}

.modal:not([open]) {
  display: none;
}

.modal::backdrop { background: rgba(28, 33, 40, 0.45); }

.app-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: calc(var(--z-toast) + 1);
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.app-toast--error {
  border-color: rgba(220, 38, 38, 0.35);
  background: #fff5f5;
  color: #991b1b;
}

.app-toast--warning {
  border-color: rgba(217, 119, 6, 0.35);
  background: #fffbeb;
  color: #92400e;
}

.modal[open] {
  display: flex;
  flex-direction: column;
}

.modal-inner {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-head h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }

.modal-close {
  border: none;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink-muted);
  line-height: 1;
}

.modal-body {
  padding: 16px 20px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.modal-foot {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Partners — левая колонка, низ */
.partners-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

.partners-panel.is-collapsed .partners-panel__body {
  display: none;
}

.partners-panel__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 6px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: left;
}

.partners-panel__toggle .ico {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.partners-panel__toggle:hover {
  color: var(--text-primary);
}

.partners-panel__toggle::after {
  content: '▾';
  margin-left: auto;
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.partners-panel.is-collapsed .partners-panel__toggle::after {
  transform: rotate(-90deg);
}

.partners-panel__body {
  padding: 0;
}

.partners-panel__lead {
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.partners-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.partners-slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 6px;
  padding: 5px 0;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
}

.partners-slot:last-child {
  border-bottom: none;
}

.partners-slot__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.partners-slot__hint {
  grid-column: 1 / -1;
  font-size: 0.64rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 1px;
}

.partners-slot__badge {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  :root {
    --dock-right-w: clamp(240px, 26vw, 280px);
  }
}

@media (max-width: 900px) {
  .brief-layout { grid-template-columns: 1fr; }
  .field-row--triple { grid-template-columns: 1fr 1fr; }

  .screen--editor:not([hidden]) {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(400px, 76dvh) auto auto minmax(400px, auto);
    grid-template-areas:
      "banners"
      "canvas"
      "tools"
      "footer"
      "inspector";
    overflow: visible;
    height: auto;
    min-height: 100%;
    width: 100%;
  }

  body:has(.screen--editor:not([hidden])) .app-main {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dock--left {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 6px 6px;
  }

  .dock-left__main .catalog {
    max-height: 80px;
  }

  .dock-left__partners,
  #partners-mount {
    display: none;
  }

  .dock--right {
    min-height: 0;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--border-color);
    grid-template-rows: auto minmax(240px, 1fr) auto;
    overflow: visible;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
  }

  .inspector-block--props {
    flex: 0 0 auto;
    order: 1;
    max-height: 96px;
    padding: 6px 8px;
  }

  #chat-mount {
    flex: 0 0 auto;
    order: 3;
    min-height: 380px;
    height: min(52vh, 480px);
    max-height: 480px;
    margin: 10px 4px 14px;
    padding: 12px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
  }

  #chat-mount > .chat-panel {
    border: none;
    padding: 0;
    min-height: 340px;
  }

  #chat-mount .chat-bubble {
    max-width: 100%;
    font-size: 0.9rem;
    line-height: 1.55;
    padding: 8px 10px;
  }

  #chat-mount .chat-messages {
    min-height: 220px;
    gap: 8px;
    padding: 4px 2px 4px 0;
  }

  #chat-mount .chat-head .inspector-heading {
    font-size: 0.88rem;
  }

  #chat-mount .chat-chip {
    font-size: 0.78rem;
    padding: 6px 0;
  }

  #chat-mount .chat-compose textarea {
    min-height: 52px;
    padding: 10px 11px;
  }

  .inspector-bottom {
    flex: 0 0 auto;
    order: 2;
    max-height: none;
    padding: 0 6px 6px;
  }

  .workspace {
    min-height: 0;
    height: 100%;
    width: 100%;
  }

  .workspace-bar {
    padding: 4px 4px;
  }

  .bar-group[aria-label='Варианты'] .chip {
    min-height: 36px;
    font-size: 0.72rem;
  }

  .screen--editor .chip--icon {
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
  }

  .workspace-bar__controls {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    align-items: stretch;
  }

  .bar-group[aria-label='Варианты'] {
    grid-column: 1 / -1;
  }

  .bar-group[aria-label='Варианты'] .chip {
    width: 100%;
    justify-content: center;
    min-height: 36px;
  }

  .bar-group[aria-label='История'] {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .bar-group[aria-label='Масштаб'] {
    grid-column: span 4;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    gap: 4px;
    align-items: center;
  }

  .bar-group[aria-label='Отображение'] {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .tool {
    min-height: 44px;
    max-height: none;
    height: 44px;
  }

  .tool-grid {
    gap: 4px;
  }

  .editor-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-stats {
    white-space: normal;
  }

  .footer-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-actions .btn {
    min-width: 0;
    justify-content: center;
  }

  .pdf-quota-hint {
    grid-column: 1 / -1;
    text-align: center;
  }

  .bar-divider {
    display: none;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    min-height: var(--topbar-h);
  }

  .brand {
    min-width: 0;
    font-size: 1.05rem;
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .topbar-nav {
    width: auto;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-end;
  }

  .topbar-nav::-webkit-scrollbar {
    display: none;
  }

  .auth-nav {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 4px;
    min-width: min-content;
  }

  .auth-nav .link-btn,
  .auth-nav .btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .auth-nav .link-btn[data-action='show-about'] {
    display: none;
  }

  .auth-nav .btn--compact {
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .canvas-wrap {
    min-height: 0;
    flex: 1 1 auto;
    width: 100%;
  }

  .editor-banners-strip .legal-banner,
  .editor-banners-strip .guest-banner,
  .editor-banners-strip .editor-welcome {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .tool,
  .btn,
  .chat-chip,
  .chat-send {
    min-height: 44px;
  }

  .chat-compose textarea {
    font-size: 16px;
  }
}

@media (max-width: 720px) {
  .field-row--triple {
    grid-template-columns: 1fr;
  }

  .footer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen--editor:not([hidden]) {
    grid-template-rows: auto minmax(380px, 78dvh) auto auto minmax(420px, auto);
  }

  #chat-mount {
    min-height: 400px;
    height: min(54vh, 500px);
    max-height: 500px;
  }

  #chat-mount > .chat-panel {
    min-height: 360px;
  }

  #chat-mount .chat-messages {
    min-height: 240px;
  }
}

/* Auth nav */
.auth-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-nav__user {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Legal & guest banners — neutral strip */
.legal-banner,
.guest-banner,
.editor-welcome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.legal-banner strong,
.editor-welcome strong {
  color: var(--text-primary);
  font-weight: 600;
}

.guest-banner a {
  color: var(--text-primary);
  font-weight: 600;
  text-underline-offset: 2px;
}

.legal-banner__close,
.guest-banner__close,
.editor-welcome__close {
  margin-left: auto;
  flex-shrink: 0;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 8px;
  min-width: 32px;
  min-height: 32px;
  position: relative;
  z-index: 5;
  border-radius: 4px;
}

/* Lead form — inline, no card */
.lead-panel {
  margin-top: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.lead-panel__title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.lead-panel__sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.lead-panel .field { margin-bottom: 6px; }
.lead-panel .field span { font-size: 0.68rem; color: var(--text-muted); }

.lead-success {
  text-align: left;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.lead-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  text-align: left;
}

.lead-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.lead-panel .btn--primary {
  margin-top: 4px;
  font-size: 0.82rem;
  padding: 8px 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Standalone pages */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: no-preference) {
  .page-shell--enter {
    opacity: 0;
    transform: translateY(16px);
  }

  .page-shell--enter-active {
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity 0.42s var(--ease-out),
      transform 0.42s var(--ease-out);
  }

  .page-shell--leave {
    opacity: 0;
    transform: translateY(-10px);
    transition:
      opacity 0.28s var(--ease-out),
      transform 0.28s var(--ease-out);
  }
}

.plan-viewer {
  margin-top: 16px;
}

.plan-viewer__canvas-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  min-height: min(52vh, 520px);
  height: min(68vh, 720px);
  overflow: hidden;
}

.plan-viewer__canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.plan-viewer__disclaimer {
  margin-top: 8px;
  font-size: 0.85rem;
}

.plan-viewer__cta {
  margin-top: 16px;
  font-size: 0.9rem;
  text-align: center;
}

.plan-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.plan-view-toolbar__hint {
  font-size: 0.78rem;
  margin-left: auto;
}

.plan-viewer__canvas-wrap canvas.is-panning {
  cursor: grabbing;
}

.plan-viewer__canvas-wrap canvas {
  cursor: grab;
}

.plan-viewer__gallery {
  margin-top: 20px;
}

.plan-viewer__gallery-title {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.plan-viewer__gallery-lead {
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.plan-viewer__gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.plan-viewer__gallery-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.plan-viewer__gallery-card:hover {
  border-color: var(--accent-orange);
  box-shadow: var(--shadow-sm);
}

.plan-viewer__gallery-card img {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.plan-viewer__gallery-card span {
  display: block;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.plan-visual-lightbox {
  border: none;
  padding: 0;
  max-width: min(920px, 96vw);
  width: 100%;
  background: transparent;
}

.plan-visual-lightbox::backdrop {
  background: rgba(28, 33, 40, 0.55);
}

.plan-visual-lightbox__inner {
  margin: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.plan-visual-lightbox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.plan-visual-lightbox__head h2 {
  font-size: 1rem;
  font-weight: 600;
}

.plan-visual-lightbox__img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #111;
}

.export-menu {
  position: relative;
  display: inline-flex;
}

.export-menu__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: calc(var(--z-sticky) + 2);
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-sm);
  flex-direction: column;
  gap: 4px;
}

.export-menu__panel:not([hidden]) {
  display: flex;
}

.export-menu__panel[hidden] {
  display: none !important;
}

.export-menu__item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
  color: var(--text-primary);
}

.export-menu__item:hover {
  background: var(--bg-hover);
}

.page-main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.page-main--wide { max-width: 960px; }

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-wrap: balance;
}

.page-lead {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.legal-doc h2 {
  font-size: 1.05rem;
  margin: 24px 0 8px;
}

.legal-doc p,
.legal-doc li {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  overflow: visible;
}

.auth-card .field--check {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
}

.auth-card .field--check input { margin-top: 3px; }

.auth-card .field--check span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-oauth .btn,
.auth-oauth-btn {
  width: 100%;
}

.auth-oauth-block {
  margin-top: 36px;
  padding-top: 0;
  border-top: none;
  clear: both;
}

.auth-or-line {
  position: relative;
  margin: 0 0 18px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.auth-or-line span {
  position: relative;
  top: -0.65em;
  display: inline-block;
  padding: 0 14px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1;
}

.auth-oauth-sep {
  display: none;
}

.auth-oauth-block__label {
  display: none;
}

.auth-oauth-note {
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-oauth-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-orange);
  flex-shrink: 0;
}

.oauth-stub-msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(196, 92, 42, 0.08);
  border: 1px solid rgba(196, 92, 42, 0.22);
  color: var(--text-primary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-footer a { color: var(--accent-orange); }

.auth-error {
  background: rgba(185, 28, 28, 0.1);
  border: 1px solid rgba(185, 28, 28, 0.28);
  color: var(--accent-red);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: var(--accent-orange);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.project-card__thumb {
  aspect-ratio: 16/10;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-card__thumb--empty {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.project-card__body { padding: 12px 14px; }

.project-card__name {
  font-weight: 600;
  margin-bottom: 4px;
}

.project-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

.project-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.project-card__actions .btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 6px 8px;
  min-width: 70px;
}

.empty-projects {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
}

.empty-projects p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.admin-stat {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.admin-stat__val {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-orange);
}

.admin-stat__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-section-title {
  margin: 28px 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.admin-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.admin-chart-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 14px 10px;
  min-width: 0;
}

.admin-chart-card--wide {
  grid-column: 1 / -1;
}

.admin-chart-card__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.admin-chart-card__canvas {
  overflow-x: auto;
  overflow-y: hidden;
}

.admin-chart__svg {
  display: block;
  width: 100%;
  min-width: 320px;
  height: auto;
}

.admin-chart__svg--horizontal {
  min-width: 280px;
}

.admin-chart__baseline {
  stroke: var(--border-color);
  stroke-width: 1;
}

.admin-chart__bar {
  fill: var(--accent-orange);
}

.admin-chart__bar--muted {
  fill: #9aa3ad;
}

.admin-chart__bar--accent {
  fill: #4a7c59;
}

.admin-chart__value {
  fill: var(--text-secondary);
  font-size: 9px;
  font-family: var(--font-mono);
}

.admin-chart__value--right {
  font-size: 10px;
}

.admin-chart__axis {
  fill: var(--text-muted);
  font-size: 9px;
  font-family: var(--font-mono);
}

.admin-chart__axis--left {
  font-size: 10px;
}

.admin-chart__empty {
  font-size: 0.82rem;
  padding: 8px 0;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .admin-charts {
    grid-template-columns: 1fr;
  }

  .admin-chart-card--wide {
    grid-column: auto;
  }
}

/* Showcase admin + brief preview */
.admin-showcase {
  margin-bottom: 32px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
}

.admin-showcase__head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.admin-showcase__hint {
  max-width: 52ch;
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-showcase__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-showcase__layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}

.admin-showcase__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-showcase__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.admin-showcase__item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.admin-showcase__badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

.admin-showcase__badge--off {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.admin-showcase__editor {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.admin-showcase__json {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.admin-showcase__editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.admin-showcase__status {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.admin-showcase__status--success {
  color: var(--accent-green);
}

.admin-showcase__status--error {
  color: var(--danger);
}

.admin-showcase__status--warning {
  color: var(--warning, #b8860b);
}

.admin-showcase__editor-actions--primary {
  margin-bottom: 12px;
}

.admin-showcase__json-details {
  margin: 12px 0;
}

.admin-showcase__json-details summary {
  cursor: pointer;
  margin-bottom: 8px;
}

/* Admin canvas template editor */
.admin-template-page {
  background: var(--bg-primary);
  overflow: hidden;
  height: 100%;
}

body.admin-template-page {
  overflow: hidden;
}

.admin-template-page .app-shell--admin-template {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-template-page .app-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-template-page .app-shell--admin-template {
  min-height: 0;
}

.admin-template-page #screen-editor {
  display: grid !important;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.admin-template-page #editor-banners[hidden] {
  display: none !important;
}

.admin-template-page .app-shell--admin-template[hidden],
.admin-template-gate-overlay[hidden] {
  display: none !important;
}

.admin-template-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(28, 33, 40, 0.5);
  backdrop-filter: blur(2px);
}

.admin-template-gate {
  width: min(400px, 100%);
  margin: 0;
}

.admin-template-gate__title {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.admin-template-gate__error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 8px 0 0;
}

.admin-template-panel {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.admin-template-panel .admin-template-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  flex: 1 1 320px;
}

.admin-template-panel .field--compact {
  min-width: 100px;
}

.admin-template-panel .admin-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Скрыть пользовательские блоки /app внутри админки */
.admin-template-page #editor-banners,
.admin-template-page .bar-group[aria-label="Варианты"],
.admin-template-page #partners-mount,
.admin-template-page #chat-mount,
.admin-template-page .inspector-bottom,
.admin-template-page .footer-actions {
  display: none !important;
}

.admin-template-page .dock--right {
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "props";
}

.admin-template-page .inspector-block--props {
  max-height: none;
}

.admin-template-topbar {
  padding: 12px 20px;
  flex-shrink: 0;
}

.admin-template-topbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-template-topbar__eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 2px;
}

.admin-template-topbar__title {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.admin-template-topbar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-template-status {
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-secondary);
}

.admin-template-status--success {
  color: var(--accent-green);
}

.admin-template-status--error {
  color: var(--danger);
}

.admin-template-status--warning {
  color: var(--warning, #b8860b);
}

.prop-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.prop-title {
  margin: 0 0 4px;
}

.brief-showcase-preview {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.brief-showcase-preview__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.brief-showcase-preview__frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #fff;
  max-width: 320px;
}

.brief-showcase-preview__frame img {
  display: block;
  width: 100%;
  height: auto;
}

.brief-showcase-preview__caption {
  margin-top: 8px;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .admin-showcase__layout {
    grid-template-columns: 1fr;
  }
}

.page-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.page-footer a {
  color: var(--text-secondary);
  margin: 0 8px;
}

.brief-legal a { color: var(--text-muted); }
.brief-legal a:hover { color: var(--accent-orange); }

#editor-banners,
.editor-banners-strip {
  grid-area: banners;
  position: relative;
  z-index: 120;
  flex-shrink: 0;
  pointer-events: auto;
  isolation: isolate;
}

.banner-is-dismissed,
#editor-banners [hidden] {
  display: none !important;
}

.legal-banner,
.guest-banner,
.editor-welcome {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.link-btn--pro {
  color: var(--accent-orange);
  font-weight: 600;
}

.btn--pro-cta {
  border-color: rgba(196, 92, 42, 0.35);
  color: var(--accent-orange);
  font-weight: 600;
}

.btn--pro-cta:hover {
  background: rgba(196, 92, 42, 0.08);
}

.pricing-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 33, 40, 0.5);
  backdrop-filter: blur(2px);
}

.pricing-overlay[hidden] {
  display: none !important;
}

body.pricing-overlay-open {
  overflow: hidden;
}

.pricing-overlay__panel {
  width: min(920px, 100%);
  max-height: min(90vh, 880px);
  overflow: auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pricing-auth-notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: #fffbeb;
  color: var(--text-primary);
}

.pricing-auth-notice__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pricing-widget__success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--accent-green);
}

.pricing-grid--diagonal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .pricing-grid--diagonal {
    grid-template-columns: 1fr;
  }
}

.pricing-widget .modal-inner {
  max-width: min(920px, 96vw);
  width: 100%;
}

.pricing-widget__lead {
  margin-top: 4px;
  font-size: 0.85rem;
}

.pricing-widget__body {
  max-height: min(72vh, 720px);
  overflow-y: auto;
}

.pricing-grid--widget {
  margin-bottom: 16px;
}

.pricing-widget__waitlist {
  padding: 16px;
  margin-top: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
}

.pricing-waitlist-intro {
  font-size: 0.88rem;
  margin-bottom: 12px;
  line-height: 1.45;
}

.pricing-widget__waitlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.pricing-widget__waitlist-field {
  margin-bottom: 0;
}

.pricing-widget__waitlist-btn {
  white-space: nowrap;
  min-height: 42px;
}

@media (max-width: 640px) {
  .pricing-widget__waitlist-form {
    grid-template-columns: 1fr;
  }

  .pricing-widget__waitlist-btn {
    width: 100%;
  }
}

.projects-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.oauth-demo-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-orange);
  margin-bottom: 8px;
}

.pricing-waitlist-note {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.pricing-card {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
}

.pricing-card--featured {
  border-color: rgba(196, 92, 42, 0.35);
  box-shadow: var(--shadow-sm);
}

.pricing-card__badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-orange);
  margin-bottom: 6px;
}

.pricing-card__price {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 8px 0 14px;
}

.pricing-card__price span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-card__list {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.pricing-card__list li + li {
  margin-top: 6px;
}

.pricing-card__hint {
  margin-top: 10px;
  font-size: 0.82rem;
}

.about-copy p {
  line-height: 1.55;
}

/* Landing */
.landing-page .page-shell {
  min-height: 100dvh;
}

.landing-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.landing-auth-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 48px 24px 32px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: center;
}

.landing-kicker {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.landing-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 16px;
}

.landing-lead {
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 36rem;
}

.landing-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.landing-mock {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.landing-mock__bar {
  height: 28px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.landing-mock__canvas {
  padding: 16px;
  color: var(--accent-orange);
}

.landing-mock__plan {
  width: 100%;
  height: auto;
}

.landing-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.landing-section__title {
  font-size: 1.35rem;
  margin-bottom: 16px;
}

.landing-steps {
  line-height: 1.7;
  padding-left: 1.2rem;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.landing-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  background: var(--bg-secondary);
}

.landing-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.landing-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-examples span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.landing-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.landing-tier {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
}

.landing-tier--pro {
  border-color: var(--accent-orange);
  background: rgba(249, 115, 22, 0.06);
}

.landing-muted {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.landing-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px;
  margin-top: 24px;
}

.landing-footer__grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.landing-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.landing-footer__links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.landing-footer__links a:hover {
  color: var(--text-primary);
}

@media (max-width: 860px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-cards,
  .landing-tiers {
    grid-template-columns: 1fr;
  }
}

.empty-projects__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Editor onboarding tooltips */
.bm-tooltip-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: auto;
}

.bm-tooltip-root[hidden] {
  display: none !important;
}

.bm-tooltip-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.bm-tooltip-spotlight {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  border: 2px solid var(--accent-orange);
}

.bm-tooltip-card {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 32px));
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.15));
  z-index: 10002;
}

.bm-tooltip-card__title {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.bm-tooltip-card__text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.bm-tooltip-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.bm-tooltip-card__step {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.plan-badge--basic {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.plan-badge--pro {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

.pricing-card__badge--active {
  background: var(--accent-green, #059669);
  color: #fff;
}

.btn.btn--disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Room interior preview cards on canvas */
.room-preview-stack {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.room-preview-card {
  position: absolute;
  pointer-events: auto;
  background: var(--bg-tertiary, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius, 8px);
  box-shadow: 0 12px 40px rgba(28, 33, 40, 0.18);
  overflow: hidden;
  min-width: 160px;
  max-width: 420px;
  touch-action: none;
}

.room-preview-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  cursor: grab;
  user-select: none;
}

.room-preview-card__head:active {
  cursor: grabbing;
}

.room-preview-card__title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-preview-card__close {
  border: none;
  background: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft, #64748b);
  padding: 0 4px;
}

.room-preview-card__close:hover {
  color: var(--accent-orange, #c45c2a);
}

.room-preview-card__body {
  padding: 0;
  background: #111;
}

.room-preview-card__img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.room-preview-card__placeholder {
  height: 140px;
  background: linear-gradient(135deg, #1e293b, #334155);
}

.room-preview-card__placeholder--pulse {
  animation: room-preview-pulse 1.2s ease-in-out infinite;
}

@keyframes room-preview-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.room-preview-card__status {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--ink-soft, #64748b);
  background: var(--bg-tertiary, #fff);
}

.room-preview-card__status--error {
  color: #b91c1c;
}

.room-preview-card__resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(28, 33, 40, 0.25) 50%);
}

/* ——— Topbar: кнопка «На главную» в /app ——— */
.topbar__brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.topbar__home-link {
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.82rem;
}

/* ——— Поле пароля с переключателем ——— */
.field-password {
  position: relative;
  display: flex;
  width: 100%;
}

.field-password input {
  padding-right: 42px;
}

.field-password__toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field-password__toggle:hover {
  color: var(--accent-orange);
  background: var(--accent-tint);
}

.field-password__icon {
  font-size: 1rem;
  line-height: 1;
}

/* ——— Лендинг: гамбургер-меню ——— */
.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
}

.landing-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  cursor: pointer;
  margin-left: auto;
}

.landing-menu-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 1px;
}

/* ——— Лендинг: блок «О сервисе» ——— */
.landing-about__lead {
  font-size: 1.05rem;
  line-height: 1.55;
  margin-bottom: 20px;
  max-width: 52rem;
}

.landing-about__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.landing-about__subtitle {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.landing-about__grid p,
.landing-about__list {
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.92rem;
}

.landing-about__list {
  padding-left: 1.1rem;
}

.landing-about__list li + li {
  margin-top: 6px;
}

/* ——— Лендинг: сравнение тарифов ——— */
.landing-tiers--compare {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-tier__price {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 6px 0 12px;
}

.landing-tier__price span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.landing-tier--basic {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.04);
}

.landing-tier__features {
  list-style: none;
  margin: 0;
  padding: 0;
}

.landing-tier__feature {
  font-size: 0.86rem;
  line-height: 1.45;
  padding-left: 1.35rem;
  position: relative;
  color: var(--text-secondary);
}

.landing-tier__feature + .landing-tier__feature {
  margin-top: 8px;
}

.landing-tier__feature--yes::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-green);
  font-weight: 700;
}

.landing-tier__feature--no::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ——— Лендинг: фото-превью вместо SVG ——— */
.landing-mock--photo .landing-mock__canvas--photo {
  padding: 0;
  color: inherit;
}

.landing-mock__photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 340px;
}

.landing-page .page-shell {
  overflow-x: clip;
}

/* ——— Архитектурный фон (клетка / миллиметровка) ——— */
.blueprint-page {
  background-color: var(--blueprint-bg);
}

.landing-backdrop,
.blueprint-page.plan-share-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--blueprint-bg);
  background-image:
    linear-gradient(var(--blueprint-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint-line) 1px, transparent 1px),
    linear-gradient(var(--blueprint-line-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint-line-fine) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px;
  background-position: -1px -1px;
}

.landing-backdrop {
  display: block;
}

.blueprint-page .page-shell,
.blueprint-page .landing-page__shell,
.blueprint-page .plan-share-page__shell {
  background: transparent;
}

.landing-page__shell {
  position: relative;
  z-index: 3;
}

.plan-share-page__shell .page-main {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  backdrop-filter: blur(2px);
}

.landing-topbar,
.plan-share-page .topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
}

.landing-section,
.landing-hero {
  position: relative;
  z-index: 1;
}

.landing-footer {
  position: relative;
  z-index: 12;
  margin-top: 24px;
  background: rgba(232, 237, 244, 0.97);
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(4px);
}

.landing-topbar {
  z-index: 20;
}

/* ——— Боковые превью планировок на лендинге ——— */
.landing-wing {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  bottom: 12px;
  width: var(--landing-wing-width);
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
  display: block;
  opacity: 0.42;
}

.landing-wing[hidden] {
  display: none !important;
}

.landing-wing--left {
  left: var(--landing-wing-offset);
}

.landing-wing--right {
  right: var(--landing-wing-offset);
}

.landing-wing__track {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.landing-wing__card {
  margin: 0;
  flex: 0 0 auto;
  padding: 5px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.landing-wing__card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  opacity: 0.92;
}

@media (max-width: 1280px),
       (max-height: 680px),
       (hover: none) and (pointer: coarse),
       (max-aspect-ratio: 5/4) and (max-width: 1600px) {
  .landing-wing {
    display: none !important;
  }
}


/* ——— Страница /pricing fallback ——— */
.pricing-page-fallback {
  max-width: 480px;
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: clip;
  }

  .page-shell,
  .page-main,
  .auth-card,
  .brief-card {
    max-width: 100%;
  }

  .landing-menu-toggle {
    display: flex;
  }

  .landing-nav {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    left: 0;
    z-index: calc(var(--z-sticky) + 5);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s var(--ease-out), opacity 0.28s ease;
  }

  .landing-nav--open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .landing-nav .link-btn,
  .landing-nav .btn,
  .landing-auth-nav .link-btn {
    width: 100%;
    justify-content: center;
  }

  .landing-auth-nav {
    flex-direction: column;
    width: 100%;
    gap: 4px;
  }

  body.landing-nav-open {
    overflow: hidden;
  }

  .landing-hero {
    padding: 32px 16px 24px;
    gap: 24px;
  }

  .landing-hero h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .landing-section {
    padding: 24px 16px;
  }

  .landing-about__grid,
  .landing-cards,
  .landing-tiers--compare {
    grid-template-columns: 1fr;
  }

  .field-row,
  .field-row--triple {
    grid-template-columns: 1fr;
  }

  .brief-layout {
    gap: 24px;
    padding: 0 16px;
  }

  .brief-card {
    padding: 20px 16px;
  }

  .topbar__home-link {
    font-size: 0.75rem;
    padding: 6px 8px;
  }

  .pricing-overlay {
    padding: 12px;
  }

  .pricing-overlay__panel {
    max-height: 92vh;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 8px 12px;
    gap: 8px;
  }
}
