/* Админка Dobry Kod. */
:root {
  /* Палитра публичного сайта: светло-серый фон, белые карточки, один синий акцент. */
  color-scheme: light;
  --ink: #1d1d1f; --ink-2: #424245; --muted: #6e6e73; --bg: #f5f5f7; --card: #fff; --line: #e1e1e6; --line-soft: #ececf0; --soft: #f5f5f7;
  --accent: #0071e3; --accent-hover: #0077ed; --accent-soft: #e8f1fc; --accent-ink: #0066cc;
  --red: #d70015; --amber: #b25000; --green: #1b7f3b;
  --radius: 18px; --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* , *::before, *::after { box-sizing: border-box; }
/* hidden всегда прячет, даже если у блока свой display (галерея, сетка и т. п.) */
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.47 var(--font); letter-spacing: -0.01em; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.9rem; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); padding: 1px 5px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 860px) { .admin { grid-template-columns: 1fr; } .side { position: static !important; height: auto !important; } }
.side { min-width: 0; overflow: hidden; position: sticky; top: 0; height: 100vh; background: rgba(251, 251, 253, 0.9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--line); color: var(--ink); display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; }
.side-brand { display: flex; align-items: center; gap: 8px; padding: 4px 10px; color: var(--ink); font-weight: 600; }
.side-brand svg { width: 26px; height: 26px; }
.side-brand:hover { text-decoration: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-site { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 8px 10px; border-radius: 9px; font-weight: 500; }
.side-nav svg, .side-site svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.side-nav a[aria-current] svg { opacity: 1; }
.side-site:hover { background: rgba(0,0,0,.05); color: var(--ink); text-decoration: none; }
.side-foot { margin-top: auto; display: grid; gap: 8px; min-width: 0; }
.side-nav a:hover { background: rgba(0,0,0,.05); color: var(--ink); text-decoration: none; }
.side-nav a[aria-current] { background: rgba(0,0,0,.07); color: var(--ink); font-weight: 600; }
.side-user { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 12px 6px 0; font-size: .88rem; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 600; font-size: .85rem; }
.side-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-who strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-who small { color: var(--muted); }
.side-user { min-width: 0; }
.side-user form { flex: none; }
.side-user .link { color: var(--accent-ink); font-size: .85rem; }
.content { padding: 32px clamp(16px, 3vw, 48px) 64px; min-width: 0; width: 100%; max-width: 1280px; margin: 0 auto; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.flash { background: #e9f6ed; color: var(--green); border: 1px solid #bfe9d7; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; }
.error { background: #fdeaea; color: var(--red); border: 1px solid #f6c5c5; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.warn { background: #fff5e0; color: var(--amber); border: 1px solid #ffe2a8; padding: 8px 12px; border-radius: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 18px; border-radius: 980px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 400 .92rem var(--font); letter-spacing: -0.01em; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: .85rem; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; color: var(--accent-ink); font: inherit; cursor: pointer; padding: 0; }
.link input[type=file] { display: none; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); }

.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.form label { display: block; font-weight: 600; margin-bottom: 14px; }
.form label.check, .check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 16px 8px 0; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 12px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; font: 400 .95rem var(--font); color: var(--ink);
}
textarea { resize: vertical; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 113, 227, .15); }
.hint { display: block; font-weight: 500; color: var(--muted); font-size: .82rem; margin-top: 4px; }
label > .hint:first-child, label > small.hint { display: inline; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 10px; margin: 0 0 16px; }
legend { font-weight: 600; padding: 0 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-2.tight { gap: 0 16px; align-items: end; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check-row { display: flex; flex-wrap: wrap; }
.narrow-field { max-width: 200px; }
.input-prefix { display: flex; align-items: stretch; margin-top: 6px; }
.input-prefix span { padding: 9px 10px; background: var(--soft); border: 1px solid #d2d2d7; border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.input-prefix input { margin: 0; border-radius: 0 10px 10px 0; }
.inline-note { background: var(--accent-soft); border: 1px solid #cfe2f8; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-note select { width: auto; margin: 0; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .choice-grid { grid-template-columns: 1fr; } }
.choice { display: flex !important; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-weight: 500 !important; margin-bottom: 10px !important; }
.choice:has(input:checked) { border-color: var(--accent); background: #f5f9fe; }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice strong { display: block; }
.choice small { color: var(--muted); }
.choice input { margin-top: 4px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; margin: 0; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th { font-size: .78rem; font-weight: 600; color: var(--muted); background: #fbfbfd; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-disabled td { opacity: .5; }
.app-cell { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.app-cell img, .app-cell .icon-ph { width: 36px; height: 36px; border-radius: 22%; flex: none; }
.app-cell small { display: block; color: var(--muted); }
.icon-ph { display: inline-block; width: 36px; height: 36px; border-radius: 22%; background: linear-gradient(135deg, #e6e6eb, #d2d2d7); }
.icon-ph.big { width: 48px; height: 48px; }
.icon-ph.huge { width: 128px; height: 128px; }
.status { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #eee; }
.status-draft { background: var(--line-soft); color: var(--ink-2); }
.status-review { background: #fff4e0; color: var(--amber); }
.status-soon { background: var(--accent-soft); color: var(--accent-ink); }
.status-published { background: #e3f5e8; color: var(--green); }
.empty-box { background: #fff; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; }

.app-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.app-head img { border-radius: 22%; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 980px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 500; font-size: .9rem; }
.step:hover { border-color: var(--accent); text-decoration: none; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line-soft); font-size: .75rem; }
.step.is-done .step-n { background: var(--green); color: #fff; }
.step.is-done .step-n { font-size: 0; }
.step.is-done .step-n::after { content: "✓"; font-size: .75rem; }
.step.is-active { border-color: var(--accent); background: var(--accent-soft); }
.step.is-active .step-n { background: var(--accent); color: #fff; }
.next-step { text-align: right; font-weight: 500; }
.lang-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.lang-tabs.sub .tab { font-size: .85rem; padding: 5px 10px; }
.tab { padding: 7px 16px; border-radius: 980px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 400; }
.tab:hover { border-color: var(--accent); text-decoration: none; }
.tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.icon-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 18px; margin-top: 6px; border: 1.5px dashed var(--line); border-radius: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.icon-drop:hover, .icon-drop.is-over { border-color: var(--accent); background: #f5f9fe; }
.icon-drop img { width: 128px; height: 128px; border-radius: 22%; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.icon-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.features { display: grid; gap: 10px; margin: 10px 0; }
.feature-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.feature-row textarea { grid-column: 2; grid-row: 2; }
.feature-row .row-tools { grid-column: 3; grid-row: 1; }
.feature-row > * { margin: 0 !important; }
@media (max-width: 900px) { .feature-row { grid-template-columns: 1fr; } .feature-row textarea, .feature-row .row-tools { grid-column: auto; grid-row: auto; } }
.row-tools { display: flex; gap: 4px; }
.plans-edit { display: grid; gap: 8px; margin: 10px 0; }
.plan-row { display: grid; grid-template-columns: 1fr 1fr 1fr 2fr auto; gap: 8px; }
.plan-row > * { margin: 0 !important; }
@media (max-width: 900px) { .plan-row { grid-template-columns: 1fr 1fr; } }

.dropzone { border: 2px dashed #d2d2d7; background: #fbfbfd; text-align: center; }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dz-body svg { width: 40px; height: 40px; color: var(--accent); }
.dz-lang { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 600; margin-top: 4px; }
.dz-lang select { width: auto; margin: 0; }
.dz-progress { list-style: none; padding: 0; margin: 10px 0 0; text-align: left; display: grid; gap: 4px; }
.dz-progress li { padding: 6px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: .88rem; }
.dz-progress li.ok { border-color: #bfe9d7; color: var(--green); }
.dz-progress li.bad { border-color: #f6c5c5; color: var(--red); }
.sizes { text-align: left; margin-top: 10px; }
.sizes summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; }
.shot-group { margin: 24px 0; }
.shot-group h2 .count { font-size: .8rem; background: var(--line-soft); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.shot-group.is-unknown h2 { color: var(--amber); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.shot { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.shot-img { display: grid; place-items: center; background: var(--soft); border-radius: 8px; height: 220px; overflow: hidden; }
.shot-img img { max-height: 220px; max-width: 100%; object-fit: contain; }
.shot select, .shot input { margin: 0; padding: 6px 8px; font-size: .85rem; }
.shot-tools { display: flex; gap: 4px; align-items: center; }
.shot-tools .btn { flex: 1; }

.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li { padding: 6px 0 6px 28px; position: relative; }
.checklist li::before { position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; color: #fff; }
.checklist li.ok::before { content: "✓"; background: var(--green); }
.checklist li.bad::before { content: "!"; background: var(--red); }
.checklist li.warn::before { content: "–"; background: #c7c7cc; }
.checklist small { color: var(--red); font-weight: 700; }
.danger-zone { border-color: #f6c5c5; }
.secret { border-color: #bfe3c9; background: #f3faf5; }
code.big { font-size: 1.2rem; padding: 4px 10px; user-select: all; }
.docs { align-items: start; }
.prose-preview .prose { font-size: .92rem; }
.prose-preview .prose h1 { font-size: 1.3rem; }
.prose blockquote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid #f0a500; background: #fff8e8; }
.prose table { border-collapse: collapse; font-size: .85rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--bg); }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 28px; padding: 40px 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.08); }
.login-card label { display: block; font-weight: 600; margin-bottom: 14px; }
.login-mark { width: 44px; height: 44px; margin-bottom: 14px; }

/* ── Карточки приложений на главной админки ── */
.app-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.app-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.app-tile:hover { box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.tile-main { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.tile-main:hover { text-decoration: none; }
.tile-main img { border-radius: 22%; flex: none; }
.tile-title { flex: 1; min-width: 0; }
.tile-title strong { display: block; font-size: 1.1rem; font-weight: 600; }
.tile-title small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.tile-missing { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.tile-missing li { padding-left: 20px; position: relative; }
.tile-missing li:not(.muted)::before { content: "!"; position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #ffe7c2; color: var(--amber); font-size: .65rem; font-weight: 800; display: grid; place-items: center; }
.tile-ok { margin: 0; color: var(--green); font-weight: 500; font-size: .9rem; }
.tile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.tile-time { margin-left: auto; }

/* ── Шапка приложения ── */
.app-head { flex-wrap: wrap; }
.app-head > div:nth-child(2) { flex: 1; min-width: 200px; }
.head-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 2px; font-size: .82rem; font-weight: 600; color: var(--muted); }

/* ── Правка: разделы слева, форма справа ── */
.edit-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .edit-layout { grid-template-columns: 1fr; } .sections { position: static !important; flex-direction: row !important; flex-wrap: wrap; } }
.sections { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.section-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink); font-weight: 500; }
.section-link:hover { background: var(--soft); text-decoration: none; }
.section-link[aria-current] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.section-link .mark { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .7rem; font-weight: 800; }
.section-link.is-done .mark { background: var(--green); color: #fff; }
.section-link.is-done .mark::after { content: "✓"; }
.section-link.is-todo .mark { background: #ffe7c2; color: var(--amber); }
.section-link.is-todo .mark::after { content: "!"; }
.section-link.is-settings { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; padding-top: 12px; }
.section-link.is-settings .mark { background: var(--line-soft); color: var(--muted); }
.section-link.is-settings .mark::after { content: "⋯"; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Кнопка «Сохранить» всегда видна внизу формы ── */
.form-actions.sticky { position: sticky; bottom: 0; z-index: 5; margin: 10px -20px -20px; padding: 12px 20px; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); align-items: center; }
.dirty-note { color: var(--amber); font-weight: 500; font-size: .9rem; }
.dirty-note::before { content: "● "; }
.next-step .btn { margin-top: 8px; }

/* ── Список приложений: сводка, фильтры, таблица ── */
.summary { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; font-size: .9rem; }
.summary-item { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.summary-item:hover { color: var(--ink); text-decoration: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c7c7cc; }
.dot-published { background: #34c759; }
.dot-soon { background: var(--accent); }
.dot-review { background: #ff9f0a; }
.toolbar { align-items: center; }
.toolbar input[type=search] { flex: 0 1 360px; min-width: 200px; }
.toolbar .reset { font-size: .9rem; margin-left: 4px; }
.table-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.table-card .table { border: 0; border-radius: 0; margin: 0; }
.apps-table td { padding-top: 14px; padding-bottom: 14px; }
.apps-table tbody tr:hover { background: #fbfbfd; }
.apps-table .app-cell img, .apps-table .app-cell .icon-ph { width: 40px; height: 40px; }
.apps-table .app-cell strong { display: block; font-weight: 600; }
.apps-table .app-cell:hover { text-decoration: none; }
.apps-table .app-cell:hover strong { color: var(--accent-ink); }
.fill { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.fill .progress { flex: 1; max-width: 140px; }
.fill-n { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.next-hint { display: block; margin-top: 4px; font-size: .82rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-hint.ok { color: var(--green); }
.apps-table .actions { text-align: right; white-space: nowrap; }
.apps-table time { white-space: nowrap; }
.icon-link { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: 4px; border-radius: 50%; color: var(--muted); vertical-align: middle; }
.icon-link:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
@media (max-width: 1100px) { .col-hide-md { display: none; } }
@media (max-width: 640px) { .col-hide-sm { display: none; } }

/* Переключатель «Главное приложение» на всю ширину */
.switch-row { display: flex !important; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; cursor: pointer; font-weight: 400 !important; }
.switch-row input { margin-top: 3px; }
.switch-row strong { display: block; font-weight: 600; }
.switch-row .hint { margin-top: 2px; }

/* Заглушка иконки: первая буква на цветном фоне — как на сайте */
.icon-ph { display: inline-grid; place-items: center; color: #fff; font-weight: 600; font-size: .95rem; }
.icon-ph.big { font-size: 1.3rem; }
.icon-ph.huge { font-size: 3rem; }
.icon-ph.tone-0 { background: linear-gradient(135deg, #5e5ce6, #8e8cf0); }
.icon-ph.tone-1 { background: linear-gradient(135deg, #0a84ff, #5ac8fa); }
.icon-ph.tone-2 { background: linear-gradient(135deg, #30b0c7, #63e6be); }
.icon-ph.tone-3 { background: linear-gradient(135deg, #ff9f0a, #ffd60a); }
.icon-ph.tone-4 { background: linear-gradient(135deg, #ff375f, #ff8aa5); }
.icon-ph.tone-5 { background: linear-gradient(135deg, #636366, #aeaeb2); }

/* «Опубликовано, но на сайте Скоро» */
.status-note { display: block; margin-top: 4px; font-size: .75rem; color: var(--amber); white-space: nowrap; }
.status.status-note { display: inline-block; margin: 0; background: #fff4e0; color: var(--amber); }

/* Всплывающее подтверждение внизу справа, само исчезает */
.flash.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; margin: 0; padding: 12px 18px; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); animation: toast-in .25s ease-out, toast-out .4s ease-in 3.6s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); visibility: hidden; } }

/* Показать пароль */
.pw-wrap { position: relative; display: block; margin-top: 6px; }
.pw-wrap input { margin-top: 0 !important; }
.pw-wrap input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--accent-ink); font: 500 .85rem var(--font); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.pw-toggle:hover { background: var(--soft); }

/* ── Загрузка: крутилка в кнопке, полоса сверху, окно для долгих операций ── */
.spinner { display: inline-block; width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; vertical-align: -2px; }
.spinner.lg { width: 36px; height: 36px; border-width: 3px; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { pointer-events: none; opacity: .85; }
form[aria-busy="true"] button, form[aria-busy="true"] input, form[aria-busy="true"] select, form[aria-busy="true"] textarea { pointer-events: none; }
.nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.nav-progress.is-on { opacity: 1; }
.nav-progress::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--accent); border-radius: 0 3px 3px 0; animation: nav-progress 1.1s ease-in-out infinite; }
@keyframes nav-progress { from { left: -40%; } to { left: 100%; } }
.busy-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(245, 245, 247, .75); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: toast-in .2s ease-out; }
.busy-card { width: min(420px, 100%); display: grid; justify-items: center; gap: 12px; text-align: center; padding: 32px 28px; background: #fff; border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.12); }
.busy-card strong { font-size: 1.1rem; font-weight: 600; }
.busy-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.busy-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; text-align: left; font-size: .9rem; color: var(--muted); }
.busy-steps li { display: flex; align-items: center; gap: 8px; }
.busy-steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.busy-steps li.is-active { color: var(--ink); }
.busy-steps li.is-active::before { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.busy-steps li.is-done::before { background: var(--green); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .spinner, .nav-progress::before, .busy-steps li.is-active::before { animation-duration: 2.5s; } }

.blockers { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #fff4e0; color: var(--amber); font-size: .9rem; }
.blockers a { color: inherit; font-weight: 600; text-decoration: underline; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); }

/* Шапка приложения: кнопка «Опубликовать» справа */
.app-head-title { flex: 1; min-width: 200px; }
.app-head-title h1 { margin-bottom: 2px; }
.app-head .head-tools form { display: inline; }
.app-head .head-tools { align-items: center; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.blockers.info { background: var(--accent-soft); color: var(--accent-ink); }
.more-fields { margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.more-fields > summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); }
.more-fields[open] > summary { margin-bottom: 12px; }

/* ── Отметки разделов: «!» только для обязательного, остальное — пустой кружок ── */
.section-link.is-empty .mark { border: 1.5px solid #c7c7cc; }
.status-need { display: block; margin-top: 4px; font-size: .75rem; color: var(--red); white-space: nowrap; }
.quiet-link { color: var(--muted) !important; font-size: .85rem; padding: 6px 8px !important; }
.quiet-link:hover { color: var(--red) !important; text-decoration: underline; }

/* ── Карточка: иконка первой ── */
.icon-row { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.icon-row p { margin: 4px 0 0; }
.icon-drop.compact { width: 112px; height: 112px; flex: none; padding: 8px; margin: 0; justify-content: center; }
.icon-drop.compact img, .icon-drop.compact .icon-ph { width: 96px; height: 96px; }
.icon-drop.compact .icon-ph.huge { font-size: 2.4rem; }

/* ── Описание: превью иконки возможности ── */
.f-icon-pick { display: flex; align-items: center; gap: 8px; }
.f-icon-pick select { margin: 0; }
.f-icon-preview { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── Документы: поля вместо [заготовок] ── */
.fill-card { border-color: #ffd89a; background: #fffaf0; }
.fill-card h2 { font-size: 1.05rem; }
.fill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }

/* ── Порядок перетаскиванием ── */
.col-drag { width: 28px; padding-right: 0 !important; }
.drag-handle { cursor: grab; color: #c7c7cc; font-size: .9rem; letter-spacing: -2px; user-select: none; padding: 4px; }
.drag-handle:hover { color: var(--muted); }
tr.is-dragging { opacity: .4; }
tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.reorder-hint { margin-top: 8px; }

/* ── Мобильная админка: верхняя панель и меню по кнопке ── */
.side-toggle { display: none; }
@media (max-width: 860px) {
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); z-index: 20; }
  .side-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 980px; background: #fff; color: var(--ink); font: 500 .9rem var(--font); cursor: pointer; }
  .side-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .side-body { display: none; width: 100%; flex-direction: column; gap: 12px; padding-top: 6px; }
  .side.is-open .side-body { display: flex; }
  .side-foot { margin-top: 0; }
  .app-head { flex-wrap: wrap; }
  .head-tools { width: 100%; }
  .flash.toast { top: 16px; bottom: auto; right: 16px; left: 16px; text-align: center; animation: toast-down .25s ease-out, toast-out .4s ease-in 3.6s forwards; }
  @keyframes toast-down { from { opacity: 0; transform: translateY(-8px); } }
  .fill-grid { grid-template-columns: 1fr; }
}
@media (min-width: 861px) { .side-body { display: contents; } }
