:root {
  --акцент: #10395c;
  --кнопка: #f5a524;
  --фон: #f4f7fa;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: "Segoe UI", Tahoma, Arial, sans-serif; color: #17222e; background: var(--фон); }

header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--акцент); color: #fff; flex-wrap: wrap;
}
header h1 { margin: 0; font-size: 20px; line-height: 1.2; }
header p { margin: 2px 0 0; font-size: 13px; opacity: .85; }
.knopki { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 8px 12px; }
button.glavnaya { background: var(--кнопка); color: #2a1a00; font-weight: 600; }
button.vtorichnaya { background: #e6edf4; color: var(--акцент); }
.knopka-ssylka { color: #fff; background: rgba(255,255,255,.15); padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; }

/* закладки */
.zakladki { display: flex; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid #dbe4ee; flex-wrap: wrap; }
.zakladka { background: #eef2f7; color: var(--акцент); font-size: 13.5px; }

#karta-oblomok { display: flex; height: calc(100% - 66px); position: relative; }
#karta { flex: 1; min-height: 300px; }
.podpis-vnizu { position: absolute; right: 8px; bottom: 4px; z-index: 400; font-size: 11px; color: #7b8a99; background: rgba(255,255,255,.8); padding: 2px 6px; border-radius: 4px; }

#panel {
  width: 340px; background: #fff; border-right: 1px solid #dbe4ee;
  display: flex; flex-direction: column; overflow: hidden;
}
.poisk { padding: 10px; border-bottom: 1px solid #eef2f7; }
.poisk input { width: 100%; padding: 9px 11px; border: 1px solid #cfdae6; border-radius: 8px; font: inherit; }
.filtry { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-bottom: 1px solid #eef2f7; }
.filtry button { padding: 5px 9px; font-size: 12.5px; background: #eef2f7; color: #30475e; border-radius: 20px; }
.filtry button.vybran { background: var(--акцент); color: #fff; }
.statistika { padding: 8px 12px; font-size: 12.5px; color: #5a6b7c; border-bottom: 1px solid #eef2f7; }
.spisok { overflow: auto; flex: 1; }
.zapis { padding: 10px 12px; border-bottom: 1px solid #f0f4f8; cursor: pointer; }
.zapis:hover { background: #f7fbff; }
.zapis .nazvanie { font-weight: 600; font-size: 14.5px; }
.zapis .mesto { font-size: 12.5px; color: #5a6b7c; margin-top: 2px; }
.zapis .metka { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; margin-top: 5px; }
.metka.opisano { background: #e3f6e8; color: #1c6b32; }
.metka.naydi { background: #fff3d6; color: #8a5b00; }

#knopka-paneli { display: none; position: absolute; left: 10px; top: 10px; z-index: 500; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }

.kartochka {
  position: absolute; right: 12px; top: 12px; bottom: 12px; width: 420px; max-width: calc(100% - 24px);
  background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(9,30,50,.25);
  padding: 18px 18px 24px; overflow: auto; z-index: 900;
}
.kartochka h2 { margin: 0 30px 4px 0; font-size: 19px; }
.kartochka .teg { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 12px; background: #eef2f7; color: #30475e; margin-bottom: 10px; }
.kartochka .adres { color: #5a6b7c; font-size: 13.5px; margin-bottom: 10px; }
.kartochka .blok { margin-top: 14px; }
.kartochka .blok .zagolovok { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #7b8a99; margin-bottom: 3px; }
.kartochka p { margin: 0 0 8px; line-height: 1.5; white-space: pre-line; font-size: 14.5px; }
.kartochka ul { margin: 0; padding-left: 18px; }
.kartochka li { font-size: 14.5px; line-height: 1.45; }
.zakryt { position: absolute; right: 10px; top: 8px; font-size: 22px; line-height: 1; background: transparent; color: #6b7b8c; }

/* формы — панели, которые НЕ закрывают карту */
.okno { position: fixed; inset: 0; background: transparent; pointer-events: none; display: flex; align-items: flex-start; justify-content: flex-end; padding: 12px; overflow: auto; z-index: 1000; }
.okno-vnutri { pointer-events: auto; background: #fff; border-radius: 12px; padding: 20px; width: 620px; max-width: 100%; max-height: calc(100vh - 24px); overflow: auto; position: relative; box-shadow: 0 10px 40px rgba(9,30,50,.35); }
.okno-vnutri.maloe { width: 440px; }
.okno-vnutri h2 { margin: 0 0 4px; font-size: 19px; }
.okno-vnutri label { display: block; font-size: 13px; color: #46586b; margin-top: 10px; }
.okno-vnutri input, .okno-vnutri textarea, .okno-vnutri select {
  width: 100%; padding: 8px 10px; border: 1px solid #cfdae6; border-radius: 8px; font: inherit; margin-top: 4px;
}
.okno-vnutri .dve { display: flex; gap: 10px; }
.okno-vnutri .dve label { flex: 1; }
.rad { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.podskazka { font-size: 12.5px; color: #6b7b8c; }
#f-otvet { color: #1c6b32; font-weight: 600; }
.podskazka-karty { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; background: var(--акцент); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 1100; font-size: 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 22px rgba(0,0,0,.35); max-width: calc(100% - 24px); }
.podskazka-karty button { background: rgba(255,255,255,.2); color: #fff; }
#f-tochka-otvet:not(:empty) { color: #1c6b32; font-weight: 600; }
.skryto { display: none !important; }

.metka-krug { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 15px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.metka-tochki { width: 34px; height: 34px; border-radius: 50%; background: #d9480f; color: #fff; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.obryv { padding: 20px; font-size: 15px; color: #8a2c2c; }

/* редактор */
.redaktor {
  position: fixed; left: 0; top: 0; bottom: 0; width: 520px; max-width: 100%; background: #fff;
  box-shadow: 6px 0 30px rgba(9,30,50,.3); z-index: 1200; display: flex; flex-direction: column;
}
.redaktor-shapka { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--акцент); color: #fff; }
.redaktor-shapka button { background: rgba(255,255,255,.18); color: #fff; }
#redaktor-tel { padding: 12px 14px 40px; overflow: auto; flex: 1; }
.vkladki { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.vkladka { background: #eef2f7; color: #30475e; font-size: 13px; }
.vkladka.vybran { background: var(--акцент); color: #fff; }
.r-spisok { margin-top: 10px; border-top: 1px solid #eef2f7; }
.r-stroka { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f0f4f8; font-size: 14px; }
.r-knopki { display: flex; gap: 6px; flex-wrap: wrap; }
.r-knopki button, .r-stroka button { padding: 5px 9px; font-size: 12.5px; }
.r-dve { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.r-dve input { width: auto; margin-top: 0; }
#redaktor-tel label { display: block; font-size: 13px; color: #46586b; margin-top: 10px; }
#redaktor-tel input, #redaktor-tel select { width: 100%; padding: 7px 9px; border: 1px solid #cfdae6; border-radius: 8px; font: inherit; margin-top: 4px; }
.plasha { position: fixed; left: 50%; transform: translateX(-50%); bottom: 70px; background: #1c6b32; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 1300; font-size: 14px; box-shadow: 0 6px 22px rgba(0,0,0,.3); max-width: calc(100% - 24px); }

@media (max-width: 820px) {
  #panel { position: absolute; z-index: 600; height: 100%; left: -360px; transition: left .2s; box-shadow: 4px 0 18px rgba(0,0,0,.15); }
  #panel.otkryta { left: 0; }
  #knopka-paneli { display: block; }
  .kartochka { left: 12px; right: 12px; width: auto; top: auto; bottom: 12px; max-height: 70%; }
  .redaktor { width: 100%; }
  header h1 { font-size: 17px; }
}

@media print {
  header, #panel, .kartochka .zakryt, .redaktor, .zakladki { display: none; }
}

/* медиа в карточках и форме */
.zag-media { font-size: 13px; color: #46586b; margin-top: 10px; }
.media-список { margin-top: 6px; }
.media-stroka { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.media-stroka img { width: 74px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid #dbe4ee; }
.media-stroka button { padding: 4px 8px; font-size: 12px; }
.imya-file { font-size: 13px; color: #46586b; }
.syuzhet-redaktor { border: 1px solid #dbe4ee; border-radius: 8px; padding: 8px; margin-top: 8px; }
.syuzhet-redaktor input, .syuzhet-redaktor textarea { margin-top: 0; }
.syuzhet-redaktor button { margin-top: 6px; }
.galereya { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.foto-mini { width: 100%; height: 96px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid #dbe4ee; }
.video-blok { width: 100%; max-height: 320px; border-radius: 8px; margin-bottom: 8px; background: #000; }
.knopka-video { display: inline-block; background: var(--акцент); color: #fff; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; }
.syuzhet { border-left: 3px solid var(--кнопка); padding-left: 10px; margin-bottom: 10px; }
.syuzhet-zag { font-weight: 600; font-size: 14.5px; }
.metka-foto { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; margin-top: 5px; background: #eef2f7; color: #30475e; }
.znachok-foto { position: absolute; margin-left: 20px; margin-top: -32px; font-size: 12px; }
.laytbox { position: fixed; inset: 0; background: rgba(8,18,30,.88); z-index: 1400; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.laytbox img { max-width: 96%; max-height: 84vh; border-radius: 8px; }
.podskazka-vnutri { color: #fff; font-size: 13px; margin-top: 12px; }

.palitra { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.palitra button.malenka { padding: 2px 6px; font-size: 15px; line-height: 1.2; }

.upravlenie-kategoriyami { border: 1px dashed #b9c7d6; border-radius: 8px; padding: 8px 10px; margin: -2px 0 10px; background: #f7fafd; }
.upravlenie-kategoriyami .rad { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.palitra button.malenka { font-size: 15px; padding: 2px 7px; line-height: 1.3; }
.palitra button.malenka.vybran-znachok { outline: 2px solid var(--акцент); }
