/* Редактор на сайте (кнопка ✎, пароль). Все классы с префиксом ed-. */

.ed-fab { position: fixed; left: 16px; bottom: 16px; z-index: 45; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; opacity: .55; box-shadow: var(--shadow); transition: opacity .2s, transform .2s var(--ease); }
.ed-fab:hover, .ed-fab:focus-visible { opacity: 1; color: var(--ink); }
.ed-fab:active { transform: scale(.94); }
body:has(.mbar.is-on) .ed-fab { bottom: 86px; }
.ed-on .ed-fab { display: none; }

.ed-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px/1.1 var(--body); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .15s var(--ease); touch-action: manipulation; }
.ed-btn:hover { border-color: var(--sky); }
.ed-btn:active { transform: scale(.97); }
.ed-btn:disabled { opacity: .6; cursor: progress; }
.ed-btn:focus-visible { outline: 3px solid rgba(43, 143, 214, .45); outline-offset: 1px; }
.ed-primary { background: var(--sky); border-color: var(--sky); color: #fff; }
.ed-primary:hover { background: #1f7fc4; border-color: #1f7fc4; }
.ed-ico { width: 38px; padding: 0; font-size: 17px; }
.ed-danger { background: #fff; border-color: #f1b3a8; color: #c2361f; }
.ed-danger:hover { background: #fdeeea; border-color: #e0614c; }
.ed-danger-t { color: #c2361f; }
.ed-muted { color: var(--muted); font-size: 14px; margin: 0; }
.ed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ed-row-end { justify-content: flex-end; }

/* top bar */
.ed-on { padding-top: 56px; }
.ed-on .hdr { top: 56px; }
.ed-topbar { position: fixed; inset: 0 0 auto 0; z-index: 60; height: 56px; background: #0f2f4b; color: #fff; box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .5); }
.ed-topbar-in { height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.ed-topbar-in::-webkit-scrollbar { display: none; }
.ed-bar-t { margin-right: auto; font-size: 15px; white-space: nowrap; padding-right: 8px; }
.ed-topbar .ed-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; }
.ed-topbar .ed-btn:hover { background: rgba(255, 255, 255, .18); }
.ed-topbar .ed-primary { background: var(--sun); border-color: var(--sun); color: #0f2f4b; }
.ed-topbar .ed-primary:hover { background: #ffd35f; }
.ed-topbar .ed-exit { background: transparent; }
.ed-pop { position: fixed; top: 62px; right: 16px; z-index: 61; width: min(360px, calc(100% - 32px)); background: #fff; color: var(--ink); border-radius: 14px; padding: 16px; box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .45); display: grid; gap: 10px; }
.ed-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* sections */
.ed-sec { position: relative; outline: 2px dashed transparent; outline-offset: -6px; transition: outline-color .2s; }
.ed-sec:hover { outline-color: rgba(43, 143, 214, .45); }
.ed-secbar { position: sticky; top: calc(var(--hdr-h) + 66px); z-index: 30; width: fit-content; max-width: calc(100% - 24px); margin: 0 12px -52px auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; padding: 6px; border-radius: 14px; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 24px -10px rgba(18, 58, 92, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ed-sec-name { font: 600 13px/1 var(--body); color: var(--muted); padding: 0 6px 0 8px; }
.adm .ed-secbar { background: rgba(255, 255, 255, .96); }
.ed-empty { opacity: .75; }
.ed-empty::after { content: "Блок пуст и не виден посетителям. Нажмите «✎ Изменить», чтобы добавить содержимое."; display: block; width: min(1180px, 100% - 40px); margin: 0 auto; padding: 18px; border: 2px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; font-size: 15px; }
.ed-chrome { outline: 2px dashed rgba(43, 143, 214, .35); outline-offset: -4px; }
.ftr.ed-chrome { position: relative; }
.ed-secbar.ed-secbar-chrome { position: absolute; z-index: 31; margin: 0; padding: 4px; }
.hdr .ed-secbar-chrome { top: calc(100% + 6px); left: 12px; }
.ftr .ed-secbar-chrome { top: 12px; right: 12px; }
.ed-card { position: relative; }
.ed-card-btn { position: absolute; top: 10px; left: 10px; z-index: 3; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5); }

/* panel */
.ed-shade { position: fixed; inset: 0; z-index: 70; background: rgba(8, 28, 46, .45); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.ed-shade.is-open { opacity: 1; visibility: visible; }
.ed-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(600px, 100%); display: flex; flex-direction: column; background: var(--bg); color: var(--ink); box-shadow: -20px 0 60px -20px rgba(0, 0, 0, .45); transform: translateX(104%); visibility: hidden; transition: transform .32s var(--ease), visibility .32s; font-size: 16px; }
.ed-panel.is-open { transform: none; visibility: visible; }
.ed-phead { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px 20px; background: #fff; }
.ed-phead h2 { flex: 1; font-size: 21px; margin: 0; line-height: 1.2; }
.ed-tabs { display: flex; gap: 6px; padding: 0 20px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.ed-tabs[hidden] { display: none; }
.ed-tabs button { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 600 15px/1 var(--body); cursor: pointer; }
.ed-tabs button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ed-pbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 28px; display: grid; gap: 16px; align-content: start; }
.ed-pfoot { display: flex; align-items: center; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.ed-pfoot .ed-save { min-width: 150px; min-height: 44px; font-size: 15px; }
.ed-status { flex: 1; font-size: 14px; color: var(--mint); font-weight: 600; }
.ed-status.is-err { color: #c2361f; }
.ed-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--sun-l); font-size: 14px; }
.ed-group { background: #fff; border-radius: 16px; padding: 18px; display: grid; gap: 16px; box-shadow: 0 1px 2px rgba(18, 58, 92, .06); }
.ed-group > h3 { margin: 0; font-size: 17px; }
.ed-add { justify-self: start; }
.ed-field { display: grid; gap: 6px; }
.ed-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.ed-lang { font-size: 11px; letter-spacing: .04em; padding: 3px 6px; border-radius: 6px; background: var(--tint); color: var(--muted); }
.ed-hint { margin: 0; font-size: 13px; color: var(--muted); }
.ed-input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c9dbe9; border-radius: 10px; background: #fff; color: var(--ink); font: 400 16px/1.45 var(--body); }
textarea.ed-input { resize: vertical; }
.ed-input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(43, 143, 214, .2); }
.ed-input::placeholder { color: #8aa0b2; }
.ed-date { max-width: 220px; }
.ed-pick { display: inline-flex; }
.ed-img { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ed-img img, .ed-img .ed-img-empty { width: 150px; height: 108px; object-fit: cover; border-radius: 12px; background: var(--tint); }
.ed-img-empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.ed-img-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-gal { display: grid; gap: 12px; }
.ed-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ed-gal-it { display: grid; gap: 6px; }
.ed-gal-it img, .ed-gal-it .ed-img-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--tint); }
.ed-gal-acts { display: flex; justify-content: space-between; gap: 4px; }
.ed-gal-acts .ed-ico { width: 34px; min-height: 32px; flex: 1; }
.ed-pairs { display: grid; gap: 10px; justify-items: start; }
.ed-pair { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: start; width: 100%; padding: 10px; border-radius: 12px; background: var(--bg); }
.ed-pair-n { font-weight: 700; color: var(--muted); padding-top: 11px; text-align: center; }
.ed-pair-f { display: grid; gap: 6px; }
.ed-pair-acts { display: grid; gap: 4px; }
.ed-pair-acts .ed-ico { width: 34px; min-height: 32px; }
.ed-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ed-item { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 12px; background: var(--bg); }
.ed-item img { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; flex: none; }
.ed-item-main { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; padding: 6px 8px; border: 0; background: none; color: var(--ink); font: 500 15px/1.3 var(--body); cursor: pointer; border-radius: 8px; }
.ed-item-main:hover { background: #fff; }
.ed-item-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-item-main small { color: var(--muted); font-size: 12px; }
.ed-item .ed-ico { width: 34px; min-height: 34px; flex: none; }
.ed-danger-zone { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 6px; }
.ed-help { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; line-height: 1.5; }

/* login */
.ed-login { border: 0; border-radius: 20px; padding: 0; width: min(400px, calc(100% - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); color: var(--ink); }
.ed-login::backdrop { background: rgba(8, 28, 46, .55); backdrop-filter: blur(3px); }
.ed-login form { display: grid; gap: 12px; padding: 26px; }
.ed-login h2 { margin: 0; font-size: 22px; }
.ed-login .ed-input { font-size: 20px; letter-spacing: .2em; text-align: center; }
.ed-err { margin: 0; min-height: 1.2em; color: #c2361f; font-size: 14px; }

/* toast */
.ed-toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: #0f2f4b; color: #fff; font: 500 15px/1.35 var(--body); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; transition: opacity .2s, transform .25s var(--ease), visibility .2s; }
.ed-toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.ed-toast.is-err { background: #b4321d; }
body:has(.ed-panel.is-open) .ed-toast { bottom: 90px; }

@media (max-width: 900px) {
  .ed-on { padding-top: 52px; }
  .ed-on .hdr { top: 52px; }
  .ed-on .hdr-nav { top: calc(var(--hdr-h) + 52px); }
  .ed-topbar { height: 52px; }
  .ed-topbar-in { padding: 0 10px; gap: 6px; }
  .ed-bar-t { display: none; }
  .ed-topbar .ed-btn { min-height: 36px; padding: 0 11px; font-size: 13px; }
  .ed-secbar { top: calc(var(--hdr-h) + 58px); margin: 0 10px 10px auto; max-width: calc(100% - 20px); }
  .ed-sec-name { display: none; }
  .ed-panel { width: 100%; }
  .ed-pbody { padding: 14px 12px 24px; }
  .ed-group { padding: 14px; }
  .ed-pfoot .ed-btn:not(.ed-save) { display: none; }
  .ed-pfoot .ed-save { flex: none; }
}
