:root {
  --bg: #0d1014;
  --panel: #14181e;
  --panel-2: #1a1f27;
  --border: #262d37;
  --text: #e7eaf0;
  --muted: #9aa4b2;
  --accent: #ffb020;
  --accent-ink: #14181e;
  --danger: #ff6b5e;
  --ok: #46c98a;
  --radius: 6px;
  --space: 8px;
  --surface-0: #0f131a; --surface-1: #12161d; --code-bg: #0b0f14; --code-text: #d7dee8;
  --text-strong: #e9edf3; --text-soft: #b8c0cc; --line: #2b3442;
  --blue-line: #2f4d78; --blue-bg: #17304f; --blue-sep: #1d3355; --blue-deep: #0f1b30;
  --blue-text: #dbe6f5; --blue-link: #9fc2f0; --on-blue: #fff; --accent-2: #e8b93a;
  --fs: 14px; --danger-soft: #ff8f8f; --ok-soft: #7bd99b;
  color-scheme: dark;
}

/* ---------- темы кабинета ---------- */
:root[data-theme="light"] {
  --bg: #f3f5f8; --panel: #ffffff; --panel-2: #eef1f5; --border: #cfd6df; --text: #1b2430; --muted: #5a6676;
  --accent: #b86e00; --accent-ink: #ffffff; --danger: #c62828; --ok: #1f7a4d;
  --surface-0: #ffffff; --surface-1: #ffffff; --code-bg: #f0f3f7; --code-text: #1b2430;
  --text-strong: #0d1620; --text-soft: #3b4756; --line: #cfd6df;
  --blue-line: #9db7d9; --blue-bg: #dde9f8; --blue-sep: #c3d5ec; --blue-deep: #eaf1fb;
  --blue-text: #14304f; --blue-link: #1c5bb0; --on-blue: #0d1620; --accent-2: #d99a00; --danger-soft: #b3261e; --ok-soft: #1c6b43;
  color-scheme: light;
}
:root[data-theme="contrast"] {
  --bg: #000000; --panel: #0a0a0a; --panel-2: #161616; --border: #8a8a8a; --text: #ffffff; --muted: #d0d0d0;
  --accent: #ffd400; --accent-ink: #000000; --danger: #ff7b7b; --ok: #5dff9d;
  --surface-0: #000000; --surface-1: #0a0a0a; --code-bg: #000000; --code-text: #ffffff;
  --text-strong: #ffffff; --text-soft: #f0f0f0; --line: #9a9a9a;
  --blue-line: #7fb2ff; --blue-bg: #0a2a5c; --blue-sep: #5c8fd6; --blue-deep: #00132e;
  --blue-text: #ffffff; --blue-link: #9ccaff; --on-blue: #ffffff; --accent-2: #ffd400;
  --fs: 16px; color-scheme: dark;
}
:root[data-theme="graphite"] {
  --bg: #1b1d22; --panel: #23262d; --panel-2: #2b2f37; --border: #3a3f49; --muted: #a8afbb;
  --accent: #5fb3a1; --accent-ink: #10201d; --accent-2: #5fb3a1;
  --surface-0: #1b1d22; --surface-1: #23262d; --code-bg: #15171b; --line: #3a3f49;
  --blue-line: #4a6670; --blue-bg: #2a3d44; --blue-sep: #3a4f57; --blue-deep: #1f2d32; --blue-link: #8fd0c0;
}
:root[data-fs="large"] { --fs: 16px; }
:root[data-fs="xlarge"] { --fs: 18px; }

* { box-sizing: border-box; }

/* hidden и .is-hidden должны побеждать любые display из классов */
[hidden], .is-hidden { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: var(--fs, 14px)/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 18px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

a { color: var(--accent); }
.muted { color: var(--muted); }
.err { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; font-size: 13px; }

/* ---------- buttons & inputs ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text); padding: 8px 12px; min-height: 36px; border-radius: var(--radius);
  font: inherit; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: #3a4351; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--danger { color: var(--danger); border-color: #4a2a2a; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 0; font: inherit; }
.link:hover { color: var(--text); }

label { display: block; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; margin-top: 4px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px;
  font: inherit; min-height: 36px;
}
textarea { min-height: 64px; resize: vertical; }
.search { max-width: 280px; margin: 0; }

/* ---------- login ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: var(--bg, #0d1015); color: var(--muted, var(--muted)); font-size: 14px;
}
.auth {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 24px; background: rgba(8, 10, 14, .92); backdrop-filter: blur(2px);
}
.auth__form {
  width: 100%; max-width: 380px; box-shadow: 0 24px 60px rgba(0,0,0,.55); background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px; display: grid; gap: 12px;
}
.auth__form h1 { font-size: 20px; }
.auth__form button { margin-top: 4px; justify-content: center; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--border); background: var(--panel);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 16px;
}
.side__brand { font-weight: 700; letter-spacing: .04em; padding: 0 8px; }
.side__nav { display: grid; gap: 2px; }
.side__nav button {
  text-align: left; background: none; border: 0; color: var(--muted); font: inherit;
  padding: 9px 8px; border-radius: var(--radius); cursor: pointer; min-height: 38px;
}
.side__nav button:hover { background: var(--panel-2); color: var(--text); }
.side__nav button.is-active { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.side__foot { margin-top: auto; display: grid; gap: 8px; padding: 0 8px; font-size: 13px; }
.who { color: var(--muted); overflow-wrap: anywhere; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.topbar__left { display: flex; align-items: center; gap: 10px; }
.chip {
  font-size: 12px; color: var(--muted); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 999px;
}
.view { padding: 16px 20px 48px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar__right { margin-left: auto; display: flex; gap: 8px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; color: var(--muted); font-weight: 500; padding: 8px; 
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 8px; border-bottom: 1px solid #1c222a; vertical-align: top; }
.table tr:hover td { background: #151a21; }
.table td:first-child { font-variant-numeric: tabular-nums; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.badge--ok { color: var(--ok); border-color: #23503c; }
.badge--draft { color: #d5a44a; border-color: #4a3d22; }
.empty { color: var(--muted); padding: 24px 0; }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.editor__meta { display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--border); padding: 14px; border-radius: var(--radius); }
.editor__meta h2 { margin-bottom: 4px; }
.editor__blocks { min-width: 0; }
.blocks { display: grid; gap: 10px; }
.block { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.block__head {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--border); background: var(--panel-2);
}
.block__head strong { font-size: 13px; }
.block__head .muted { font-size: 12px; }
.block__actions { margin-left: auto; display: flex; gap: 4px; }
.block__body { padding: 12px; display: grid; gap: 10px; }
.list-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.list-row--3 { grid-template-columns: 1fr 1fr 1fr auto; }

/* ---------- media ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.media-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.media-card img { display: block; width: 100%; height: 110px; object-fit: cover; background: #0a0d11; }
.media-card__body { padding: 8px; display: grid; gap: 6px; font-size: 12px; }
.media-card__body code { color: var(--muted); overflow-wrap: anywhere; font-size: 11px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; margin-bottom: 16px; }
.panel__row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.panel__row label { flex: 1 1 160px; }

.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 20px; width: min(420px, 92vw); }
.dialog form { display: grid; gap: 10px; }
.dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 6px 0 0; }

.toast {
  position: fixed; right: 16px; bottom: 16px; background: var(--panel-2);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: var(--radius); max-width: 380px; font-size: 13px;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: center; gap: 8px; padding: 8px; overflow-x: auto; }
  .side__nav { display: flex; gap: 4px; }
  .side__nav button { white-space: nowrap; }
  .side__foot { margin: 0 0 0 auto; display: flex; align-items: center; gap: 8px; }
  .who { display: none; }
  .editor { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* hidden must win over component display rules */
[hidden] { display: none !important; }


/* «Запомнить меня»: чекбокс слева от подписи */
.auth__form .check, label.check {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--muted, var(--muted)); margin: 2px 0 6px;
}
label.check input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; flex: 0 0 16px; accent-color: var(--accent-2);
}

/* Мобильный список страниц — карточки вместо таблицы */
@media (max-width: 720px) {
  .side { position: sticky; top: 0; }
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr {
    border: 1px solid var(--border, #232833); border-radius: 10px;
    padding: 10px 12px; margin-bottom: 8px; background: var(--panel, #12151c);
  }
  table.responsive td { border: 0; padding: 4px 0; display: flex; gap: 8px; justify-content: space-between; }
  table.responsive td::before {
    content: attr(data-label); color: var(--muted, var(--muted)); font-size: 12px; flex: 0 0 92px;
  }
  table.responsive td[data-label="Адрес"] { display: block; }
  table.responsive td[data-label="Адрес"]::before { display: none; }
  table.responsive td b { font-size: 15px; }
}


/* ---------- отдельная страница входа (/login) ---------- */
body.body--auth { margin: 0; min-height: 100vh; background: var(--code-bg); }
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #16202c 0%, var(--code-bg) 60%);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px 26px 20px; box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.auth-card__brand { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 10px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card .muted { margin: 0 0 18px; font-size: 13px; }
.auth-card label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-soft); }
.auth-card input[type="email"], .auth-card input[type="password"], .auth-card input[type="text"] {
  width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-0); color: var(--text-strong); font-size: 15px;
}
.auth-card input:focus { outline: 2px solid #e8b93a55; border-color: var(--accent-2); }
.auth-card__submit { width: 100%; margin-top: 6px; }
.auth-card .err { color: var(--danger-soft); font-size: 13px; min-height: 18px; margin: 10px 0 0; }


/* ---------- превью настоящей страницы ---------- */
.preview-dialog {
  width: min(1500px, 96vw); height: min(94vh, 1000px); padding: 0; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface-0); color: var(--text-strong); overflow: hidden;
}
.preview-dialog::backdrop { background: rgba(6,8,12,.72); }
.preview-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-1); font-size: 13px;
}
.preview-bar code { color: var(--muted); }
.preview-source { display: flex; gap: 4px; margin-left: auto; }
.preview-source button {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-0); color: var(--text-soft);
  font-size: 12px; cursor: pointer;
}
.preview-source button.is-on { border-color: #3fa96a; color: var(--ok-soft); }
.preview-devices { display: flex; gap: 4px; }
.preview-devices button {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-0); color: var(--text-soft);
  font-size: 12px; cursor: pointer;
}
.preview-devices button.is-on { border-color: var(--accent-2); color: var(--accent-2); }
.preview-stage { height: calc(100% - 49px); overflow: auto; background: #fff; display: grid; place-items: start center; }
#previewFrame { border: 0; height: 100%; min-height: calc(94vh - 60px); background: #fff; display: block; }

.preview-info { font-size: 12px; color: #8b95a3; }

.live-badge { color: #56606e; font-size: 10px; transition: color .2s; }
.live-badge.is-on { color: #3fa96a; }
.code-dialog { width: min(1100px, 94vw); }
.code-dialog textarea {
  width: 100%; height: min(70vh, 720px); resize: vertical; border: 0; outline: none;
  background: var(--code-bg); color: var(--code-text); font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
  padding: 12px 14px; box-sizing: border-box; white-space: pre; overflow: auto;
}

.inline-bar {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  background: var(--blue-deep); color: var(--blue-text); font-size: 13px; border-bottom: 1px solid var(--blue-sep);
}
.inline-bar .inline-tip { color: var(--blue-link); font-size: 12px; }
.inline-bar #inlineCount { font-weight: 600; }
.inline-bar button {
  border: 1px solid var(--blue-line); background: var(--blue-bg); color: var(--blue-text); padding: 5px 12px;
  border-radius: 7px; cursor: pointer; font-size: 12px;
}
.inline-bar button:disabled { opacity: .45; cursor: default; }

.publish-dialog { width: min(900px, 94vw); }
.publish-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line, var(--text-strong)); }
.publish-head strong { font-size: 15px; }
.publish-head #publishClose { margin-left: auto; }
.publish-body { padding: 14px 16px 18px; }
.publish-list { max-height: 46vh; overflow: auto; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.pub-row { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #eef1f5; }
.pub-row span { flex: 0 0 62px; color: #8a94a4; }
.pub-row--new span { color: #1f7a45; }
.pub-note { margin-top: 10px; color: #8a6d1f; font: 12px/1.5 system-ui, sans-serif; }
.publish-confirm { display: flex; gap: 10px; align-items: center; justify-content: flex-start; margin: 14px 0 10px; font-size: 13px; }
.publish-confirm input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: #e07b1b; }
.publish-actions { display: flex; gap: 10px; }
.publish-log { margin-top: 12px; max-height: 220px; overflow: auto; background: var(--code-bg); color: var(--code-text); padding: 10px 12px; border-radius: 8px; font: 11px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; }

/* ---------- редактор страницы: панель форматирования и замена картинок ---------- */
.preview-dialog[open] { display: flex; flex-direction: column; }
.preview-dialog .preview-stage { flex: 1 1 auto; height: auto; min-height: 0; }
.inline-bar { display: block; padding: 0; }
.inline-bar[hidden] { display: none !important; }
.ed-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 8px 14px; }
.ed-row + .ed-row { border-top: 1px solid var(--blue-sep); }
.ed-group { display: inline-flex; align-items: center; gap: 4px; padding-right: 12px; border-right: 1px solid var(--blue-sep); }
.ed-spacer { flex: 1 1 auto; }
.inline-bar .ed-btn {
  min-width: 38px; height: 36px; padding: 0 12px; border: 1px solid var(--blue-line); background: var(--blue-bg); color: var(--blue-text);
  border-radius: 8px; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.inline-bar .ed-btn:hover:not(:disabled) { background: #20406a; }
.inline-bar .ed-btn.is-on { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.inline-bar .ed-save { background: #2f9e44; border-color: #2f9e44; color: var(--on-blue); font-weight: 600; }
.inline-bar .ed-save:hover:not(:disabled) { background: #37b24d; }
.inline-bar .ed-sw { width: 24px; height: 24px; min-width: 24px; padding: 0; border-radius: 50%; border: 2px solid #5b7aa6; cursor: pointer; }
.inline-bar .ed-sw:hover { border-color: var(--on-blue); }
.ed-pick { position: relative; }
.ed-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ed-linkrow input[type="text"] { flex: 1 1 320px; min-width: 220px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--blue-line); background: var(--blue-deep); color: var(--on-blue); font-size: 14px; }
.ed-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ed-hint { color: var(--blue-link); font-size: 12px; padding-top: 6px; padding-bottom: 6px; }

.img-dialog { width: min(560px, 94vw); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-1); color: var(--text-strong); }
.img-dialog::backdrop { background: rgba(6,8,12,.72); }
.img-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 16px; }
.img-body { padding: 16px 18px 20px; display: grid; gap: 12px; }
.img-body label { font-size: 13px; color: var(--muted); }
.img-body input[type="text"] { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--code-bg); color: var(--on-blue); font-size: 14px; width: 100%; box-sizing: border-box; }
.img-cur { display: flex; align-items: center; gap: 14px; }
.img-cur img { width: 120px; height: 80px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.img-cur span { font-size: 12px; color: var(--muted); word-break: break-all; }
.img-tabs { display: flex; gap: 6px; }
.img-tabs button { flex: 1; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-0); color: var(--text-soft); cursor: pointer; font-size: 14px; }
.img-tabs button.is-on { border-color: var(--accent-2); color: var(--accent-2); }
.img-pane[hidden] { display: none !important; }
.img-pane { display: grid; gap: 10px; }
.img-drop { display: grid; gap: 6px; place-items: center; text-align: center; padding: 28px 16px; border: 2px dashed #3a4658; border-radius: 12px; cursor: pointer; color: var(--text-strong) !important; font-size: 15px !important; }
.img-drop span { font-size: 12px; color: var(--muted); }
.img-drop.is-over { border-color: var(--accent-2); background: rgba(232,185,58,.08); }
.img-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.img-drop:focus-within { outline: 2px solid var(--accent-2); }
.img-note { margin: 0; font-size: 12px; color: var(--muted); }
.img-status { margin: 0; min-height: 20px; font-size: 13px; color: var(--muted); }
.img-status.is-err { color: var(--danger-soft); }
.img-status.is-ok { color: var(--ok-soft); }

/* --- история, сохранение --- */
.save-state { font-size: 13px; color: var(--muted); }
.save-state.is-dirty { color: var(--accent-2); font-weight: 600; }
.save-state.is-saved { color: var(--ok-soft); font-weight: 600; }
.save-state.is-err { color: var(--danger-soft); font-weight: 600; }
.inline-bar .ed-btn:disabled { opacity: .4; cursor: default; }
.img-hist { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.img-hist span { font-size: 13px; color: #cfd6e0; }
.img-hist .btn:disabled { opacity: .4; cursor: default; }
.img-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.img-thumb { width: 64px; height: 48px; padding: 0; border-radius: 8px; border: 2px solid var(--line); background: #fff; cursor: pointer; overflow: hidden; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb.is-on { border-color: var(--accent-2); }
.img-thumb:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.img-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-1); border-radius: 0 0 14px 14px; }
.img-foot .save-state { flex: 1; line-height: 1.35; }
.img-savebtn { min-height: 42px; padding: 0 18px; font-weight: 700; white-space: nowrap; }
.img-dialog { max-height: 94vh; overflow: auto; }

/* --- библиотека фото: удаление --- */
.up-grid { gap: 12px; }
.up-card { display: flex; flex-direction: column; gap: 4px; width: 104px; }
.up-card .img-thumb { width: 104px; height: 74px; }
.up-badge { font-size: 11px; color: var(--muted); text-align: center; }
.up-badge.is-used { color: var(--ok-soft); }
.up-del { white-space: nowrap; min-height: 30px; border-radius: 8px; border: 1px solid #3a4352; background: #1a202a; color: var(--text-strong); font-size: 12px; cursor: pointer; }
.up-del:hover:not(:disabled) { border-color: var(--danger-soft); color: var(--danger-soft); }
.up-del.is-armed { background: #7a1f1f; border-color: var(--danger-soft); color: var(--on-blue); font-weight: 700; }
.up-del:disabled { opacity: .35; cursor: not-allowed; }
.up-trash { margin-top: 10px; font-size: 13px; color: var(--muted); }
.up-trash summary { cursor: pointer; padding: 6px 0; }


/* ================= Конструктор: страница + код рядом ================= */
.view--builder { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; min-height: 520px; }
.view--builder[hidden] { display: none !important; }
.cb-top { margin-bottom: 0; }
.cb-path { font-size: 14px; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-top .preview-devices button { min-height: 34px; }
.cb-barhost { flex: 0 0 auto; }
.cb-barhost .inline-bar { border: 1px solid var(--blue-sep); border-radius: 10px; background: var(--blue-deep); overflow: hidden; }
.cb-split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 12px; }
.cb-site, .cb-side { min-height: 0; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); }
.cb-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--text-strong); }
.cb-stage iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.cb-seo { flex: 0 0 auto; padding: 10px 12px 6px; border-bottom: 1px solid var(--border); background: var(--panel-2); max-height: 46%; overflow: auto; }
.cb-seo__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cb-help-btn { background: none; border: 1px solid var(--blue-line); color: var(--blue-link); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; min-height: 28px; }
.cb-help-btn:hover, .cb-help-btn[aria-expanded="true"] { background: var(--blue-bg); color: var(--on-blue); }
.cb-help { margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--blue-line); border-radius: 8px; background: var(--blue-deep); font-size: 13px; line-height: 1.5; color: var(--blue-text); }
.cb-help ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.cb-seo__row { display: grid; gap: 3px; padding: 6px 8px; margin: 0 -8px 2px; border-radius: 8px; border-left: 3px solid transparent; transition: background .25s, border-color .25s; }
.cb-seo__row.is-changed { background: rgba(232,185,58,.12); border-left-color: var(--accent-2); }
.cb-seo__row label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.cb-seo__row input, .cb-seo__row textarea { width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--blue-line); background: var(--blue-deep); color: var(--on-blue); font: inherit; font-size: 14px; resize: vertical; }
.cb-seo__row input:focus, .cb-seo__row textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.cb-ln { font-weight: 400; color: var(--blue-link); cursor: pointer; text-decoration: underline dotted; }
.cb-ln:empty { display: none; }
.cb-tag { font-size: 11px; font-weight: 600; background: var(--accent-2); color: var(--accent-ink); padding: 1px 8px; border-radius: 999px; }
.cb-cnt { font-size: 11px; color: var(--blue-link); }
.cb-cnt.is-over { color: var(--accent-2); }
.cb-h1 { padding: 7px 9px; border-radius: 8px; background: var(--blue-deep); border: 1px dashed var(--blue-line); font-size: 14px; min-height: 34px; }
.cb-h1 .is-none { color: var(--danger-soft); }
.cb-h1 .is-multi { color: var(--accent-2); font-size: 12px; }
.cb-codehead { flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.cb-codehead h2 { margin-right: 4px; }
.cb-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cb-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.cb-key--c { background: var(--accent-2); } .cb-key--a { background: var(--ok); } .cb-key--r { background: var(--danger); }
.cb-diffcount { font-size: 12px; color: var(--muted); margin-left: auto; }
.cb-diffcount.is-on { color: var(--accent-2); font-weight: 600; }
.cb-follow { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.cb-follow input { accent-color: var(--accent-2); }
.cb-mini { padding: 4px 10px; min-height: 30px; font-size: 12px; }
.cb-warn { flex: 0 0 auto; padding: 6px 12px; font-size: 12px; color: var(--accent-ink); background: var(--accent-2); }
.cb-code { flex: 1 1 auto; min-height: 0; overflow: auto; background: #0b0f15; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #cfd8e6; padding: 4px 0 24px; outline: none; }
.cb-code:focus-visible { box-shadow: inset 0 0 0 2px #2f81f7; }
.cb-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); border-left: 3px solid transparent; }
.cb-row > b { text-align: right; padding: 0 10px 0 4px; color: #55637a; font-weight: 400; user-select: none; }
.cb-row > code { white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 12px; font: inherit; tab-size: 2; }
.cb-row.c { background: rgba(232,185,58,.16); border-left-color: var(--accent-2); }
.cb-row.c > b { color: var(--accent-2); }
.cb-row.a { background: rgba(70,201,138,.16); border-left-color: var(--ok); }
.cb-row.a > b { color: var(--ok); }
.cb-row.r { background: rgba(255,107,94,.13); border-left-color: var(--danger); }
.cb-row.r > b { color: var(--danger); }
.cb-row.r > code { text-decoration: line-through; text-decoration-color: rgba(255,107,94,.7); opacity: .85; }
.cb-row.is-flash { animation: cbflash 1.1s ease-out; }
@keyframes cbflash { 0% { box-shadow: inset 0 0 0 2px #fff; } 100% { box-shadow: inset 0 0 0 2px transparent; } }
.cb-code .t-t { color: #7cc4ff; } .cb-code .t-a { color: #d7b8ff; } .cb-code .t-s { color: #a5d6a7; } .cb-code .t-c { color: #6b7a90; font-style: italic; }
.cb-code.is-busy { opacity: .75; }
@media (max-width: 1100px) {
  .view--builder { height: auto; }
  .cb-split { grid-template-columns: 1fr; }
  .cb-site { height: 70vh; }
  .cb-side { height: 80vh; }
}
@media (max-width: 720px) {
  .cb-path { max-width: 100%; }
  .cb-row { grid-template-columns: 40px minmax(0, 1fr); }
}

.cb-stage #previewFrame { min-height: 0; }
.cb-scale { font-size: 12px; color: var(--muted); }

.cb-barhost #inlineSave, .cb-barhost #inlineRevert, .cb-barhost #inlineCount { display: none; }

.cb-stage { touch-action: none; }
.cb-stage.is-hand { cursor: grab; }
.cb-stage:active.is-hand { cursor: grabbing; }
.cb-zoom { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(15,27,48,.94); border: 1px solid var(--blue-line); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.cb-zoom button { background: none; border: 0; color: var(--blue-text); font: inherit; font-size: 13px; min-width: 34px; min-height: 34px; padding: 0 9px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.cb-zoom button:hover { background: var(--blue-bg); color: var(--on-blue); }
.cb-zoom button.is-on { background: var(--accent-2); color: var(--accent-ink); font-weight: 600; }
.cb-zoom button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.cb-zoom .cb-zoom__val { min-width: 54px; font-variant-numeric: tabular-nums; color: var(--on-blue); cursor: default; }
@media (max-width: 720px) { .cb-zoom button { min-width: 38px; min-height: 38px; padding: 0 7px; } }

.cb-visualbar, #bVisualPanel { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.cb-visualbar { padding:6px 12px; background:var(--blue-deep); color:var(--blue-text); font-size:13px; }
.cb-visualbar .btn { min-height:36px; }
#bVisualMode.is-on { background:var(--accent-2); color:var(--accent-ink); }
#bVisualPanel label { display:inline-flex; align-items:center; gap:6px; }
#bVisualWidth { width:78px; font:inherit; }
.cb-visualbar .cb-visual-delete { color:var(--danger-soft); }
.cb-resize { position:absolute; z-index:2; width:28px; height:34px; transform:translate(-50%,-50%); cursor:ew-resize; touch-action:none; }
.cb-resize::after { content:''; position:absolute; inset:9px 9px; background:#216fe0; border:2px solid #fff; border-radius:3px; }

.cb-stage.is-resizing iframe { pointer-events:none; }

/* Keep builder controls reachable on narrow admin viewports. */
#bVisualPanel { min-width:0; }
#bVisualLabel { overflow-wrap:anywhere; }
@media (max-width: 540px) {
  .cb-top .toolbar__right { width:100%; margin-left:0; flex-wrap:wrap; align-items:center; }
  .cb-top .preview-devices { flex-wrap:wrap; max-width:100%; }
  .cb-visualbar { align-items:flex-start; }
  #bVisualPanel, #bVisualLabel { width:100%; }
  .cb-stage .cb-zoom { flex-wrap:wrap; max-width:calc(100% - 20px); }
  .cb-split { grid-template-columns:minmax(0, 1fr); }
}

/* Перемещение блоков — ручка над блоком, всегда доступна в конструкторе */
.cb-move { position:absolute; z-index:5; display:flex; align-items:stretch; gap:1px; background:#216fe0; border-radius:8px 8px 0 0; box-shadow:0 4px 14px rgba(8,20,45,.35); overflow:hidden; font-size:13px; white-space:nowrap; max-width:calc(100% - 8px); }
.cb-move[hidden], .cb-dropline[hidden] { display:none; }
.cb-move button { all:unset; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:36px; min-width:36px; padding:0 10px; color:#fff; font:600 13px/1 system-ui,sans-serif; cursor:pointer; background:#216fe0; }
.cb-move button:hover:not(:disabled) { background:#1a5bc0; }
.cb-move button:focus-visible { outline:2px solid #fff; outline-offset:-3px; }
.cb-move button:disabled { opacity:.4; cursor:default; }
.cb-move .cb-move__grip { cursor:grab; min-width:150px; font-size:14px; }
.cb-move .cb-move__grip span { font-weight:400; opacity:.8; }
.cb-move .cb-move__del { background:#b3261e; }
.cb-move .cb-move__del:hover { background:#8f1d17; }
.cb-dropline { position:absolute; z-index:6; height:4px; border-radius:2px; background:var(--accent-2); box-shadow:0 0 0 2px rgba(232,185,58,.35); pointer-events:none; }
.cb-stage.is-moving, .cb-stage.is-moving * { cursor:grabbing !important; }
.cb-stage.is-moving iframe { pointer-events:none; }
@media (max-width:540px) { .cb-move .cb-move__grip { min-width:0; } .cb-move .cb-move__grip span { display:none; } }

.versions-dialog { width: min(760px, 96vw); max-height: 86vh; padding: 0; }
.versions-dialog[open] { display: flex; flex-direction: column; }
.versions-list { overflow: auto; padding: 8px 14px 14px; }
.versions-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--border, var(--line)); }
.versions-act { display: flex; gap: 8px; flex-wrap: wrap; }
.versions-sum { grid-column: 1 / -1; font-size: 13px; }
@media (max-width: 600px) { .versions-row { grid-template-columns: 1fr; } }

.newpage-dialog { width: min(560px, 94vw); height: min(800px, 92vh); padding: 0; overflow: hidden; }
.newpage-dialog[open] { display: flex; flex-direction: column; }
.newpage-dialog form { display: flex; flex-direction: column; gap: 0; min-height: 0; height: 100%; }
.newpage-dialog form > h2 { flex: 0 0 auto; margin: 0; padding: 16px 18px 10px; }
.newpage-dialog .np-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 18px 12px; display: grid; align-content: start; gap: 12px; }
.newpage-dialog form > menu { position: sticky; bottom: 0; flex: 0 0 auto; margin: 0; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); background: var(--card, #171b22); border-top: 1px solid var(--border, var(--line)); z-index: 2; }
.newpage-dialog label small { display: block; margin-top: 3px; }
.newpage-dialog textarea { width: 100%; }
.np-count { float: right; font-size: 12px; color: var(--muted); }
.np-count.is-warn { color: #e0a84a; }
.np-mode { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.np-error { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(224,84,84,.14); color: var(--danger-soft); font-size: 13px; }
label.check input[type="radio"] { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; accent-color: var(--accent-2); }
@media (max-width: 720px) {
  .newpage-dialog { position: fixed; inset: auto; left: calc(var(--vv-left, 0px) + 12px); top: calc(var(--vv-top, 0px) + 12px); width: calc(var(--vv-width, 100vw) - 24px); height: calc(var(--vv-height, 100dvh) - 24px); max-width: none; max-height: none; margin: 0; }
  .newpage-dialog .np-scroll { padding-right: 14px; padding-left: 14px; }
  .newpage-dialog form > h2 { padding: 14px 14px 8px; }
  .newpage-dialog form > menu { padding-right: 14px; padding-left: 14px; }
}

.np-tpl { display: grid; gap: 6px; }
.np-tpl__label { font-size: 13px; }
.np-tpl__body { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; align-items: start; }
.np-tpl__list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--border, var(--line)); border-radius: 8px; }
.np-tpl__list li { padding: 7px 10px; cursor: pointer; display: grid; gap: 1px; border-bottom: 1px solid var(--border, var(--line)); }
.np-tpl__list li:last-child { border-bottom: 0; }
.np-tpl__list li b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.np-tpl__list li span { font-size: 12px; color: var(--muted); }
.np-tpl__list li:hover, .np-tpl__list li:focus-visible { background: rgba(232,185,58,.10); outline: 0; }
.np-tpl__list li.is-on { background: rgba(232,185,58,.20); box-shadow: inset 3px 0 0 var(--accent-2); }
.np-tpl__empty { cursor: default !important; color: var(--muted); }
.np-tpl__preview { position: sticky; top: 0; }
.np-tpl__frame { width: 190px; height: 220px; overflow: hidden; border: 1px solid var(--border, var(--line)); border-radius: 8px; background: #fff; position: relative; }
.np-tpl__frame iframe { width: 1280px; height: 1480px; border: 0; transform: scale(.1484); transform-origin: 0 0; pointer-events: none; }
.np-tpl__cap { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 720px) { .np-tpl__body { grid-template-columns: 1fr; } .np-tpl__preview { position: static; } .np-tpl__frame { width: 100%; height: 150px; } .np-tpl__frame iframe { transform: scale(.28); } }

.np-start { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.np-start__opt { text-align: left; padding: 9px 12px; border: 1px solid var(--border, var(--line)); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; display: grid; gap: 2px; font: inherit; }
.np-start__opt b { font-size: 14px; } .np-start__opt span { font-size: 12px; color: var(--muted); }
.np-start__opt:hover { background: rgba(232,185,58,.08); }
.np-start__opt.is-on { border-color: var(--accent-2); background: rgba(232,185,58,.16); }
.np-note { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.np-design-toggle em { font-style: normal; color: var(--muted); font-size: 12px; }
#npAgent[hidden], #npH1Box[hidden], #npMetaBox[hidden], #npDesignBox[hidden], #npTplBox[hidden], #npModeBox[hidden], #npDesignHint[hidden] { display: none !important; }
@media (max-width: 720px) { .np-start { grid-template-columns: 1fr; } }

.seo-dialog { width: min(760px, 96vw); max-height: 92vh; overflow: auto; }
.seo-grid { display: grid; gap: 10px; padding: 10px 14px; }
.seo-grid label { display: grid; gap: 4px; font-size: 13px; }
.seo-grid input, .seo-grid textarea, .seo-grid select { width: 100%; box-sizing: border-box; }
.seo-hints { padding: 8px 14px 0; display: grid; gap: 4px; }
.seo-hint { font-size: 13px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border, #333); }
.seo-hint--bad { color: var(--danger-soft); } .seo-hint--warn { color: var(--accent-2); } .seo-hint--ok { color: var(--ok); }
.seo-actions { padding: 6px 14px 14px; display: flex; gap: 12px; align-items: center; }

.theme-pick { display: inline-flex; gap: 6px; align-items: center; }
.theme-pick select { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 13px; }
.auth-theme { position: fixed; top: 10px; right: 10px; }

.ho-list { display: grid; gap: 6px; padding: 12px 0; }
.ho-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; background: var(--panel); }
.ho-item summary { cursor: pointer; }
.ho-item--ok summary { color: var(--ok); } .ho-item--warn summary { color: var(--accent-2); }
.ho-item--bad summary { color: var(--danger); } .ho-item--info summary { color: var(--muted); }
.ho-item div { margin-top: 6px; font-size: 13px; overflow-wrap: anywhere; }

.cn-table{width:100%;border-collapse:collapse;margin-bottom:14px}
.cn-table th,.cn-table td{padding:8px 10px;border-bottom:1px solid var(--line,#444);text-align:left;vertical-align:middle}
.cn-table td:last-child{display:flex;gap:6px;flex-wrap:wrap}
.cn-table select{width:100%;min-width:180px}

/* тарифы */
.plan-chip{font-size:11px;padding:2px 8px;border-radius:99px;border:1px solid var(--line,#444);margin-left:6px;opacity:.85;vertical-align:middle}
#nav button.is-locked,.btn.is-locked{opacity:.55}
#nav button.is-locked::after,.btn.is-locked::after{content:"🔒 " attr(data-lock);font-size:11px;margin-left:8px;opacity:.9}
.lock-card{padding:20px;border:1px dashed var(--line,#555);border-radius:12px;max-width:560px}
.lock-card__t{font-size:17px;margin-bottom:8px}
.plan-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:6px 0}

/* левая колонка в стиле чат-платформ */
.side__nav button{display:flex;align-items:center;gap:12px;padding:9px 10px;font-size:15px}
.side__nav button svg{flex:none;opacity:.8}
#nav button.is-locked::after{margin-left:auto}
.side__foot{position:relative;padding:12px 0 0;border-top:1px solid var(--border);gap:0}
.acc{display:flex;align-items:center;gap:4px}
.acc__main{flex:1;min-width:0;display:flex;align-items:center;gap:10px;background:none;border:0;color:var(--text);font:inherit;padding:6px;border-radius:10px;cursor:pointer;text-align:left}
.acc__main:hover,.acc__dl:hover{background:var(--panel-2)}
.avatar{flex:none;width:32px;height:32px;border-radius:50%;background:#2fa58c;color:#fff;display:inline-grid;place-items:center;font-weight:600}
.acc__txt{min-width:0;display:grid}
.acc__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
.acc__plan{color:var(--muted);font-size:12px}
.acc__dl{flex:none;width:36px;height:36px;border:1px solid var(--border);background:none;color:var(--muted);border-radius:10px;cursor:pointer;display:grid;place-items:center}
.acc-menu{position:absolute;left:0;right:0;bottom:64px;background:var(--panel-2);border:1px solid var(--border);border-radius:14px;padding:6px;box-shadow:0 12px 32px rgba(0,0,0,.45);z-index:50}
.acc-menu hr{border:0;border-top:1px solid var(--border);margin:6px 0}
.acc-menu button{width:100%;display:flex;align-items:center;gap:10px;background:none;border:0;color:var(--text);font:inherit;padding:9px 10px;border-radius:8px;cursor:pointer;text-align:left}
.acc-menu button:hover{background:var(--panel)}
.acc-menu__head{display:flex;align-items:center;gap:10px;padding:6px 8px}
.plan-opt{padding:10px 12px;border:1px solid var(--border);border-radius:10px;margin-bottom:8px}
.plan-opt.is-cur{border-color:var(--accent)}
#personalDialog label{display:grid;gap:6px;margin:12px 0}
@media (max-width:760px){.side__foot{border:0;padding:0}.acc__txt{display:none}.acc-menu{bottom:auto;top:56px;left:auto;right:8px;width:240px}.side__nav button span{display:none}}

/* левая колонка зафиксирована, скроллится только правая часть и список пунктов */
@media (min-width: 901px) {
  .app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .side { height: 100%; min-height: 0; overflow: hidden; }
  .side__brand, .side__foot { flex: none; }
  .side__nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; scrollbar-width: thin; }
  .main { height: 100%; min-height: 0; overflow-y: auto; }
}

/* проекты */
.proj{position:relative;margin:0 0 10px;flex:none}
.proj__btn{width:100%;display:flex;align-items:center;gap:8px;background:var(--panel-2);border:1px solid var(--border);color:var(--text);font:inherit;padding:8px 10px;border-radius:10px;cursor:pointer;text-align:left}
.proj__lbl{color:var(--muted);font-size:12px}.proj__name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.proj__list{position:absolute;left:0;right:0;top:46px;z-index:60;background:var(--panel-2);border:1px solid var(--border);border-radius:12px;padding:6px;box-shadow:0 12px 32px rgba(0,0,0,.45);max-height:60vh;overflow:auto}
.proj__list button{width:100%;display:grid;background:none;border:0;color:var(--text);font:inherit;padding:8px 10px;border-radius:8px;cursor:pointer;text-align:left}
.proj__list button:hover{background:var(--panel)}.proj__list button.is-cur{outline:1px solid var(--accent)}
.proj__list hr{border:0;border-top:1px solid var(--border);margin:6px 0}.proj-new{color:var(--accent)!important}
.np-tabs{display:flex;gap:6px;margin:10px 0}.np-tabs button{flex:1;padding:8px;border:1px solid var(--border);background:none;color:var(--text);border-radius:8px;cursor:pointer}
.np-tabs button.is-active{border-color:var(--accent);background:var(--panel-2)}
#newProjectDialog label{display:grid;gap:6px;margin:12px 0}

.steps{border:1px solid var(--accent);background:var(--panel-2);border-radius:12px;padding:14px 16px;margin:0 0 14px}
.steps p{margin:6px 0 10px}

#projMgrDialog{min-width:min(560px,92vw)}
.pm-row{display:flex;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--border)}
.pm-row>div{flex:1;min-width:0}
.pm-del{border-color:#c0504d;color:#e57373}

.auth-tabs{display:flex;gap:6px;margin-bottom:14px}
.auth-tabs button{flex:1;padding:9px;border:1px solid var(--border);background:transparent;color:inherit;border-radius:8px;cursor:pointer}
.auth-tabs button.is-active{background:var(--accent,#4f8cff);border-color:transparent;color:#fff}
.social{display:grid;gap:10px;margin-bottom:6px}
.social__btn{display:flex;align-items:center;gap:12px;justify-content:center;padding:11px;text-decoration:none;border:1px solid var(--border);border-radius:10px;color:inherit}
.social__btn.is-off{opacity:.45;cursor:not-allowed}
.social__ic{width:22px;height:22px;border-radius:50%;display:inline-grid;place-items:center;color:#fff;font-weight:700;font-size:13px}
.social__or{text-align:center;color:var(--muted,#8a8f98);font-size:12px;margin:6px 0;display:flex;align-items:center;gap:10px}
.social__or::before,.social__or::after{content:"";flex:1;height:1px;background:var(--border)}
