/* ЯКатолик — редакция. iOS-first: крупный тап, 16px поля, drawer, safe-area */
:root {
  color-scheme: light;
  --ff: 'Manrope', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --ground: #ede9e2;
  --surface: #FBFAF7;
  --surface-2: #E8E3DA;
  --ink: #2B241E;
  --stone-700: #675C52;
  --stone-500: #897C70;
  --bronze: #A9784E;
  --bronze-dark: #85562F;
  --accent: #AC5633;
  --accent-soft: rgba(172, 86, 51, .12);
  --line: #DDD6CA;
  --line-strong: #CBC3B6;
  --ok: #3f6b4a;
  --ok-soft: rgba(63, 107, 74, .12);
  --warn: #9a6b2f;
  --warn-soft: rgba(154, 107, 47, .14);
  --rose: #A84F65;
  --rose-soft: rgba(168, 79, 101, .12);
  --info: #4778AC;
  --info-soft: rgba(71, 120, 172, .12);
  --shadow: 0 1px 2px rgba(68, 45, 27, .06), 0 10px 28px rgba(68, 45, 27, .08);
  --sidebar: 272px;
  --tap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; overflow-x: hidden; }
html, body { margin: 0; }
body {
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--ff);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.nav-open { overflow: hidden; }
a { color: var(--bronze-dark); }
button, input, select, textarea {
  font: inherit;
  font-size: 16px;
  max-width: 100%;
}

/* ----- Login ----- */
.login-page {
  min-height: 100dvh; display: grid; place-items: center;
  padding: max(24px, var(--safe-t)) max(20px, var(--safe-r)) max(24px, var(--safe-b)) max(20px, var(--safe-l));
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(172,86,51,.12), transparent 55%),
    var(--ground);
}
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 24px 22px;
  box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand img { width: 40px; height: 40px; }
.login-brand strong { display: block; font-size: 18px; }
.login-brand span { color: var(--stone-500); font-size: 13px; }
.login-card h1 {
  margin: 0 0 8px; font-family: var(--serif); font-weight: 600; font-size: 32px;
}
.login-card .lead { margin: 0 0 20px; color: var(--stone-700); font-size: 15px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--stone-500); }
.field input, .field select, .field textarea, .input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 14px;
  background: #fff; color: var(--ink); padding: 12px 14px;
  font-size: 16px; min-height: var(--tap);
  appearance: none; -webkit-appearance: none;
}
.field textarea, .textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--bronze); box-shadow: 0 0 0 4px var(--accent-soft);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; color: inherit;
  touch-action: manipulation;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); }
.btn-danger { background: var(--rose-soft); color: var(--rose); border-color: transparent; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; pointer-events: none; }
.login-error {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--rose-soft); color: var(--rose); font-size: 13px; font-weight: 600;
}
.login-hint {
  margin-top: 16px; padding: 12px; border-radius: 12px; background: var(--surface-2);
  font-size: 12px; color: var(--stone-700); line-height: 1.45;
}
.login-hint code { font-size: 11px; }

/* ----- App shell ----- */
.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100dvh; }
.nav-scrim {
  display: none; position: fixed; inset: 0; z-index: 25;
  background: rgba(24, 18, 14, .36);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 16px 12px calc(16px + var(--safe-b));
  display: flex; flex-direction: column; gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 4px; }
.side-brand img { width: 34px; height: 34px; }
.side-brand strong { display: block; font-size: 15px; }
.side-brand small { color: var(--stone-500); font-size: 11px; }
.side-nav { display: grid; gap: 2px; }
.nav-group {
  margin: 12px 10px 4px; font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--stone-500);
}
.nav-group:first-child { margin-top: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 0 12px; border-radius: 14px;
  text-decoration: none; color: var(--stone-700);
  font-weight: 600; font-size: 15px;
}
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.active { background: var(--accent-soft); color: var(--bronze-dark); }
.side-user {
  margin-top: auto; padding: 12px; border-radius: 16px; background: var(--surface-2);
  display: grid; gap: 8px;
}
.side-user .name { font-weight: 700; font-size: 14px; }
.side-user .role { font-size: 12px; color: var(--stone-500); }
.main {
  min-width: 0;
  padding: 20px 24px calc(40px + var(--safe-b));
}
.topbar {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.topbar h1 {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(28px, 3vw, 36px); letter-spacing: -.02em;
}
.topbar p { margin: 6px 0 0; color: var(--stone-700); font-size: 14px; max-width: 560px; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 16px;
}
.panel + .panel { margin-top: 12px; }
.panel-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.panel-head h2 { margin: 0; font-size: 16px; }
.grid-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat-card .label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--stone-500); }
.stat-card .value { margin-top: 8px; font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1; }
.stat-card .hint { margin-top: 6px; font-size: 12px; color: var(--stone-500); }

.desk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.desk-card {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.desk-card:active { transform: scale(.98); }
.desk-card strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}
.desk-where {
  font-size: 12px;
  font-weight: 700;
  color: var(--bronze-dark);
}
.desk-card span { font-size: 13px; color: var(--stone-700); line-height: 1.4; }
.desk-form { max-width: 720px; }

.god-band { margin: 0 0 28px; }
.god-band-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px 16px;
  margin: 0 0 12px; flex-wrap: wrap;
}
.god-band-head h2 {
  margin: 0; font-family: var(--serif); font-size: clamp(22px, 5vw, 28px); font-weight: 600;
}
.god-band-head em {
  font-style: normal; font-family: var(--ff); font-size: 14px; color: var(--stone-500); font-weight: 700;
}
.god-band-head a { font-weight: 700; font-size: 14px; text-decoration: none; }
.archive-bar { margin-bottom: 14px; display: grid; gap: 10px; }
.archive-bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.archive-status { color: var(--stone-500); font-size: 13px; }
.archive-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.god-rail, .god-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.god-card {
  display: grid;
  grid-template-rows: 120px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 188px;
}
.god-card:active { transform: scale(.98); }
.god-thumb {
  display: block; background: #d8cfc3 center/cover no-repeat;
}
.god-thumb.is-empty { background: linear-gradient(160deg, #cfc6b8, #8f8578); }
.god-copy { display: grid; gap: 4px; padding: 10px 12px 12px; min-width: 0; }
.god-copy strong {
  font-size: 14px; line-height: 1.3;
  overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.god-copy small { color: var(--stone-500); font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.god-miss { margin: 0; padding: 16px; color: var(--stone-500); background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; }
.god-edit { display: grid; grid-template-columns: minmax(160px, 280px) 1fr; gap: 16px; align-items: start; }
.god-preview {
  min-height: 200px; border-radius: 16px; background: #d8cfc3 center/cover; border: 1px solid var(--line);
}
@media (max-width: 720px) {
  .god-edit { grid-template-columns: 1fr; }
  .god-rail, .god-grid { grid-template-columns: repeat(2, 1fr); }
}
.dev-box {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.dev-box summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  min-height: var(--tap);
  display: flex;
  align-items: center;
}

.list-stack { display: grid; gap: 8px; }
.list-item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  min-height: var(--tap); padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); text-decoration: none; color: inherit;
}
.list-item strong { display: block; font-size: 14px; }
.list-item small { color: var(--stone-500); font-size: 12px; }

.badge {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em;
  background: var(--surface-2); color: var(--stone-700);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.rose { background: var(--rose-soft); color: var(--rose); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--surface-2); color: var(--stone-500); }

.filters {
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 8px; margin-bottom: 12px;
}
.table-wrap {
  overflow: auto; border-radius: 14px; border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
table.data {
  width: 100%; border-collapse: collapse; min-width: 820px; background: #fff;
}
table.data th, table.data td {
  padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle;
  font-size: 13px;
}
table.data th {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--stone-500);
  background: var(--surface-2); position: sticky; top: 0;
}
table.data tr:hover td { background: rgba(237, 233, 226, .45); }
table.data .title-link { font-weight: 700; color: var(--ink); text-decoration: none; }
table.data .title-link:hover { color: var(--accent); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; display: grid; place-items: center;
  color: var(--stone-700); font-size: 14px; text-decoration: none;
}
.icon-btn:hover { border-color: var(--bronze); color: var(--bronze-dark); }

.editor-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start;
}
.editor-main, .editor-side { display: grid; gap: 12px; }
.editor-title {
  width: 100%; border: 0; background: transparent; font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px); font-weight: 600; padding: 0; color: var(--ink);
}
.editor-title:focus { outline: none; }
.autosave {
  font-size: 12px; color: var(--stone-500); display: flex; align-items: center; gap: 8px;
}
.autosave.ok { color: var(--ok); }
.server-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px;
  border-radius: 999px; background: var(--surface-2); font-size: 11px; font-weight: 700;
}
.server-pill.on { background: var(--ok-soft); color: var(--ok); }
.server-pill.off { background: var(--rose-soft); color: var(--rose); }

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.photo-card {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface);
}
.photo-card .ph {
  height: 120px; background: #d8cfc3 center/cover;
}
.photo-card .in { padding: 12px; display: grid; gap: 6px; }
.photo-card strong { font-size: 13px; }
.photo-card .tags { font-size: 11px; color: var(--stone-500); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.tabs .tab {
  font-family: var(--ff); font-weight: 700; font-size: 14px; color: var(--stone-700);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  min-height: 36px; padding: 0 14px; cursor: pointer;
}
.tabs .tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.hint-note {
  margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: var(--stone-700);
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.form-grid { display: grid; gap: 12px; padding: 16px; }
.form-grid label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--stone-700); }
.filters-2 { grid-template-columns: 1fr 220px; }
.cycle-list { display: grid; gap: 8px; }
.cycle-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; }
.title-link { color: inherit; text-decoration: none; font-weight: 700; }
.title-link:hover { color: var(--bronze-dark); }

.empty {
  padding: 28px; text-align: center; color: var(--stone-500); font-size: 14px;
}
.toast {
  position: fixed; left: 50%; bottom: calc(16px + var(--safe-b)); z-index: 50;
  transform: translate(-50%, 8px);
  max-width: min(92vw, 420px);
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 16px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); opacity: 0;
  transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #7a2f3d; }

.mobile-bar { display: none; }
.menu-btn {
  min-width: var(--tap); min-height: var(--tap); padding: 0 14px;
  border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 700; font-size: 15px;
}

@media (max-width: 1100px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .nav-scrim { display: block; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: min(86vw, 320px); z-index: 30; height: auto;
    padding-top: calc(14px + var(--safe-t));
    transform: translateX(-105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
    box-shadow: none; border-right: 0;
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 20;
    margin: 0 -16px 14px; padding: calc(8px + var(--safe-t)) 16px 10px;
    background: color-mix(in srgb, var(--ground) 86%, transparent);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border-bottom: 1px solid var(--line);
  }
  .main { padding: 0 16px calc(28px + var(--safe-b)); }
  .topbar { margin-bottom: 14px; }
  .topbar h1 {
    font-size: clamp(22px, 6.4vw, 28px);
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 12px;
    font-size: 14px;
    white-space: nowrap;
  }
  .topbar-actions .btn-back {
    flex: 0 0 auto;
  }
  .sidebar { padding-left: calc(12px + var(--safe-l)); }
  .grid-cards { grid-template-columns: 1fr 1fr; }
  .filters-2 { grid-template-columns: 1fr; }
  .cycle-row { grid-template-columns: 1fr; }
  table.data { min-width: 0; }
  table.data thead { display: none; }
  .table-wrap { border: 0; overflow: visible; background: transparent; }
  table.data, table.data tbody { display: block; width: 100%; background: transparent; }
  table.data tr {
    display: grid; gap: 4px; margin-bottom: 10px; padding: 14px;
    border-radius: 16px; background: #fff; border: 1px solid var(--line);
  }
  table.data td {
    border: 0; padding: 2px 0; font-size: 14px;
  }
  table.data td:first-child { font-weight: 700; }
  table.data .row-actions { margin-top: 8px; }
  .icon-btn { width: 40px; height: 40px; }
}
@media (max-width: 520px) {
  .grid-cards { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .god-rail, .god-grid { grid-template-columns: 1fr; gap: 10px; }
  .god-card {
    min-height: 0;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: auto;
    border-radius: 14px;
  }
  .god-thumb { min-height: 96px; }
  .god-copy { padding: 10px 12px; align-content: center; }
  .god-copy strong { font-size: 15px; -webkit-line-clamp: 3; }
  .form-grid { padding: 12px; }
  .desk-form { max-width: none; }
}

.posts-toolbar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
}
.posts-toolbar .input { flex: 1; min-width: 0; }
.posts-toolbar .btn { flex: 0 0 auto; white-space: nowrap; }

.post-editor { display: grid; gap: 12px; }
.post-editor-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.post-editor-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pub-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 18px; align-items: start; }
.pub-rubrics { margin: 0 0 14px; display: grid; gap: 12px; }
.pub-rubrics .rubric-group strong { display: block; font-size: 12px; margin: 0 0 6px; color: var(--stone-700); }
.pub-rubrics .hint-note { margin: 6px 0 0; font-size: 12px; color: var(--stone-500); }
.pub-meta { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; margin: 0 0 14px; align-items: start; }
.pub-cover { display: grid; gap: 6px; }
.pub-cover .cover-frame { aspect-ratio: 16 / 9; border-radius: 12px; }
.pub-meta-col { display: grid; gap: 8px; align-content: start; }
@media (max-width: 1100px) {
  .pub-layout { grid-template-columns: 1fr; }
}
.slug-quiet {
  display: flex; align-items: center; gap: 10px; margin: 2px 0 14px;
  font-size: 12px; color: var(--stone-500); font-weight: 700;
}
.slug-path {
  display: flex; align-items: center; flex: 1; min-width: 0;
  font-weight: 600; color: var(--stone-500);
}
.slug-path input {
  border: 0; background: transparent; font: inherit; color: var(--ink);
  padding: 2px 4px; min-width: 0; width: 100%; outline: none;
}
.slug-path input:focus { background: var(--surface-2); border-radius: 6px; }
.excerpt-input { margin: 0 0 14px; resize: vertical; min-height: 72px; }
.lead-rte { margin: 0 0 14px; }
.lead-rte .rte-body {
  min-height: 88px; padding: 12px 14px 16px; font-size: 16px; line-height: 1.55;
}
.lead-rte .rte-bar { position: static; }
.lead-rte a { color: #2a5bd7; text-decoration: underline; }
.rubric-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.rubric-pill { cursor: pointer; margin: 0; }
.rubric-pill input { position: absolute; opacity: 0; pointer-events: none; }
.rubric-pill span {
  display: block; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 700; color: var(--stone-700);
}
.rubric-pill input:checked + span {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
}
.author-search { position: relative; }
.author-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  max-height: 240px; overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
}
.author-suggest-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; text-align: left; cursor: pointer; font: inherit;
}
.author-suggest-item:hover { background: var(--surface-2); }
.author-chip-name { flex: 1; min-width: 0; }
.author-chip-x {
  border: 0; background: transparent; color: var(--stone-500);
  font: 700 12px var(--ff); cursor: pointer; padding: 4px 6px;
}
.side-date { display: grid; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--stone-500); }
.post-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start;
}
.post-main.panel { padding: 22px 24px 28px; }
.post-side { display: grid; gap: 12px; position: sticky; top: 12px; }
.post-card { padding: 14px 16px; display: grid; gap: 10px; }
.post-card h3 {
  margin: 0; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--stone-500); font-weight: 800;
}
.post-card h3 em { font-style: normal; font-weight: 600; color: var(--rose); margin-left: 6px; text-transform: none; letter-spacing: 0; }
.post-side-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.slug-row { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: center; }
.slug-row label { margin: 0; font-size: 12px; font-weight: 700; color: var(--stone-500); }
.slug-prefix { color: var(--stone-500); font-weight: 700; }
.cover-frame {
  aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  display: grid; place-items: center; color: var(--stone-500); font-size: 13px;
}
.cover-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-frame.is-empty { }
.rubric-groups { display: grid; gap: 12px; }
.rubric-group { display: grid; gap: 6px; }
.rubric-group strong { font-size: 12px; }
.check-row {
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
  color: var(--ink);
}
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.author-chip-wrap { margin-top: 8px; }
.author-chip, .preview-author {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2);
  text-decoration: none; color: inherit; width: 100%;
}
.preview-author { width: fit-content; margin: 0 0 10px; }
.author-chip strong, .preview-author span:last-child { font-size: 14px; }
.author-chip small { display: block; color: var(--stone-500); font-size: 12px; }
.author-chip-ava {
  width: 36px; height: 36px; border-radius: 50%; background: #d9d0c4 center/cover no-repeat; flex: 0 0 auto;
}
.author-chip-ava.is-empty {
  display: grid; place-items: center; font-weight: 700; color: #6b5e52; background: #efe8dc;
}
.seo-count { font-size: 11px; color: var(--stone-500); }
.input.is-auto, .textarea.is-auto { background: var(--surface-2); }
.post-publish { display: grid; gap: 8px; }
.post-publish .btn { width: 100%; justify-content: center; }

.rte { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.rte-bar {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px;
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 2;
}
.rte-bar button {
  min-height: 36px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; font: 700 13px var(--ff); color: var(--stone-700); cursor: pointer;
}
.rte-bar button:hover { background: var(--surface-2); color: var(--ink); }
.rte-sep { width: 1px; background: var(--line); margin: 4px 6px; }
.rte-body {
  min-height: 420px; padding: 18px 20px 40px; outline: none;
  font-size: 17px; line-height: 1.7;
}
.rte-body:empty:before, .rte-body p:only-child:empty:before {
  content: attr(data-placeholder); color: var(--stone-500);
}
.rte-body u { text-decoration: underline; }
.rte-body h2 { font-family: var(--serif); font-size: 28px; margin: 1.2em 0 .4em; }
.rte-body h3 { font-family: var(--serif); font-size: 22px; margin: 1.1em 0 .35em; }
.rte-body blockquote {
  margin: 1em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--bronze);
  color: var(--stone-700); font-family: var(--serif); font-size: 22px;
}
.rte-figure, .rte-gallery { margin: 1.2em 0; }
.rte-figure img, .rte-gallery img {
  width: 100%; border-radius: 12px; display: block; object-fit: cover;
}
.rte-figure figcaption, .rte-caption {
  margin: 8px 2px 0; min-height: 1.4em; outline: none;
  font-size: 13px; line-height: 1.45; color: var(--stone-500);
}
.rte-caption:empty:before {
  content: attr(data-placeholder); color: var(--stone-400); font-style: italic;
}
.cycle-art-list { display: grid; gap: 8px; margin-top: 12px; }
.cycle-art-row {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 10px;
  align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px;
}
.cycle-art-row small { display: block; color: var(--stone-500); font-size: 12px; }
.lib-dl-edit { margin-top: 18px; }
.lib-dl-edit h3 { margin: 0 0 10px; font-size: 15px; }
.lib-dl-edit .cycle-art-row { grid-template-columns: 1fr auto; }
.guide-live figcaption {
  margin: 6px 0 0; font-size: 12.5px; color: var(--stone-500);
}
.rte-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.rte-embed { margin: 1.2em 0; }
.rte-embed-inner { position: relative; aspect-ratio: 16 / 9; background: #111; border-radius: 12px; overflow: hidden; }
.rte-embed-inner iframe, .rte-embed-inner video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rte-related {
  display: grid; gap: 4px; margin: 1.2em 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
}
.rte-related strong { font-size: 16px; }
.rte-related small, .rte-related em { font-size: 13px; color: var(--stone-500); font-style: normal; }

.gal-overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(43, 36, 30, .45);
  display: grid; place-items: center; padding: 20px;
}
.gal-modal {
  width: min(920px, 100%); max-height: 86vh; overflow: auto;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow);
}
.gal-modal header, .gal-modal footer {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
}
.gal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
  padding: 0 16px 16px;
}
.gal-item {
  padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); cursor: pointer; aspect-ratio: 1;
}
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-item.is-on { border-color: var(--accent); }

@media (max-width: 1100px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-side { position: static; }
}
@media (max-width: 880px) {
  .posts-toolbar { flex-wrap: wrap; }
  .posts-toolbar .btn { flex: 1 1 auto; }
  .post-editor-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .post-editor-bar > .btn,
  .post-editor-bar > a.btn {
    align-self: flex-start;
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 0;
  }
  .post-editor-bar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .post-editor-bar-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }
  .editor-title {
    font-size: clamp(22px, 7vw, 32px);
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* День Церкви — редактор с предпросмотром */
.day-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 18px; align-items: start; }
.day-preview-sticky { position: sticky; top: 16px; }
.day-preview-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--stone-500); margin: 0 0 8px; }
.day-preview {
  border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--surface);
  box-shadow: var(--shadow);
}
.day-preview .dp-date { font-size: 13px; color: var(--stone-500); margin: 0 0 10px; }
.day-preview .dp-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; line-height: 1.15; margin: 10px 0 6px; }
.day-preview .dp-empty { color: var(--stone-400); font-style: italic; }
.day-preview .dp-color { font-size: 13px; color: var(--stone-500); margin: 0 0 6px; }
.day-preview .dp-block { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.day-preview .dp-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--stone-500); margin: 0 0 4px; }
.day-preview .dp-block p { margin: 0; font-size: 15px; line-height: 1.5; }
.day-preview .dp-quote { font-style: italic; color: var(--stone-600); }
.cal-rank {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--stone-600); text-transform: lowercase;
}
.cal-rank-solemn { background: #f6e5c8; color: #8a5a12; }
.cal-rank-feast { background: #f3d9d4; color: #a33b2a; }
.cal-rank-sun { background: #dfeadd; color: #3c6b3f; }
.cal-rank-feria { background: var(--surface-2); color: var(--stone-600); }

@media (max-width: 1100px) {
  .day-editor { grid-template-columns: 1fr; }
  .day-preview-sticky { position: static; }
}

.guides-list { padding: 16px; }
.guide-group { margin: 0 0 22px; }
.guide-group h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--stone-500); margin: 0 0 8px; }
.guide-rows { display: grid; gap: 6px; }
.guide-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2); text-decoration: none; color: inherit;
}
.guide-row:hover { border-color: var(--accent); }
.guide-row-copy { display: grid; gap: 2px; min-width: 0; }
.guide-row-copy strong { font-size: 16px; }
.guide-row-copy small { color: var(--stone-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-live .guide-body { font-size: 15px; line-height: 1.55; }
.guide-live .guide-lead { font-size: 16px; margin: 0 0 12px; line-height: 1.5; }
.guide-live .guide-lead a { color: #2a5bd7; text-decoration: underline; }
.guide-live .guide-lead p { margin: 0 0 .4em; }
.guide-live .guide-lead p:last-child { margin: 0; }
.guide-live h2 { font-family: 'Cormorant Garamond', serif; font-size: 20px; margin: 18px 0 8px; }
.guide-live .guide-quote { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid #b08a4a; }
.guide-live .guide-note { padding-left: 12px; border-left: 3px solid #b08a4a; }
.guide-live img { max-width: 100%; border-radius: 10px; }
.prayer-edit { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0 0 10px; display: grid; gap: 8px; }
.prayer-edit-head { display: flex; justify-content: space-between; align-items: center; }

.build-stamp {
  margin: 8px 0 0;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--stone-500);
  opacity: .7;
}

.btn-back {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 0;
}

.net-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--warn-soft);
  border: 1px solid rgba(154, 107, 47, .28);
  color: var(--ink);
}
.net-banner[hidden] { display: none; }
.net-banner p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; flex: 1 1 220px; }
.net-banner .btn { flex: 0 0 auto; }

.yak-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 16px;
  color: var(--stone-700);
  font-size: 14px;
  font-weight: 600;
}
.yak-loading--page {
  min-height: 40vh;
  flex-direction: column;
}
.yak-spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: yak-spin .7s linear infinite;
  flex: 0 0 auto;
}
.yak-spin--sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes yak-spin { to { transform: rotate(360deg); } }

.yak-skel-card { pointer-events: none; }
.yak-skel-card .god-thumb {
  background: linear-gradient(90deg, #ddd6ca 25%, #efe8dc 50%, #ddd6ca 75%);
  background-size: 200% 100%;
  animation: yak-shimmer 1.2s ease infinite;
}
.yak-skel-card .god-copy strong,
.yak-skel-card .god-copy small {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--surface-2);
  -webkit-line-clamp: unset;
}
.yak-skel-card .god-copy small { width: 62%; height: 10px; }
@keyframes yak-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.archive-status { display: inline-flex; align-items: center; gap: 8px; }
.list-item strong, table.data .title-link {
  overflow-wrap: anywhere;
  word-break: break-word;
}
