/* ===== «Чиним город» (pages/chinim-gorod.html, блок на главной, pages/sluzhba.html)
   Стиль редизайна: квадратные углы, рамки 2px бирюзы, Open Sans. Оранжевый — ТОЛЬКО главная кнопка «Сообщить о проблеме». ===== */
.pg-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 64px; padding: 14px 28px; border: 0; border-radius: 0; cursor: pointer;
  background: #c24e1d; color: #fff !important; font: inherit; font-weight: 800; font-size: 19px; line-height: 1.2;
  text-decoration: none !important; box-shadow: none; transition: background .15s ease;
}
.pg-cta:hover, .pg-cta:focus-visible { background: #a8410f; }
.pg-cta .pg-cta-ico { font-size: 24px; line-height: 1; }
html[data-theme] .pg-cta:focus-visible { outline: 3px solid #c24e1d; outline-offset: 3px; }
.pg-link2 {
  display: inline-flex; align-items: center; min-height: 56px; padding: 10px 22px; border: 2px solid var(--rd-accent, #0B7F87);
  color: var(--rd-accent, #0B7F87) !important; background: var(--rd-bg, #fff); font-weight: 700; font-size: 16px; text-decoration: none !important;
}
.pg-link2:hover { background: var(--teal-soft, #E6F3F4); }
.pg-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 18px; }
@media (max-width: 600px) { .pg-actions > .pg-cta, .pg-actions > .pg-link2 { width: 100%; justify-content: center; } }

/* --- герой страницы --- */
html[data-theme] .page-hero.pg-hero { background: var(--teal-soft); border-bottom: 2px solid var(--rd-accent); padding: 36px 0 32px; }
html[data-theme] .page-hero.pg-hero h1 { color: var(--rd-accent); font-size: clamp(32px, 5vw, 48px); margin: 6px 0 8px; }
.pg-hero .lead { max-width: 640px; }
.pg-hero .pg-small { margin: 12px 0 0; font-size: 14px; color: var(--rd-muted); max-width: 640px; }

/* --- секции --- */
.pg-sec-h { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.pg-sec-h h2 { margin: 0; }
.pg-sec-h .pg-count { color: var(--rd-muted); font-weight: 700; }
html[data-theme] .section.pg-sec { padding: 40px 0; }
.pg-empty { border: 2px dashed var(--rd-accent); padding: 22px; text-align: center; font-weight: 600; color: var(--rd-text); background: var(--rd-bg); }
.pg-empty b { display: block; font-size: 18px; color: var(--rd-head); margin-bottom: 6px; }
.pg-err { border-left: 5px solid #B3261E; background: var(--rd-alt); padding: 12px 16px; font-weight: 600; }

/* --- до/после --- */
.pg-fixed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.pg-ba-card { border: 2px solid var(--rd-accent); background: var(--surface); }
.pg-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--rd-accent); }
.pg-ba figure { margin: 0; position: relative; background: var(--rd-alt); aspect-ratio: 4 / 3; overflow: hidden; }
.pg-ba img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-ba figcaption { position: absolute; left: 0; top: 0; background: var(--rd-cap); color: var(--rd-head); font-weight: 800; font-size: 13px; padding: 4px 10px; text-transform: uppercase; letter-spacing: .04em; }
.pg-ba figure.after figcaption { background: var(--rd-accent); color: var(--rd-on-accent); }
.pg-ba-body { padding: 14px 16px 16px; }
.pg-ba-body h3 { margin: 6px 0 4px; font-size: 17px; }
.pg-meta { color: var(--rd-muted); font-size: 14px; font-weight: 600; margin: 2px 0; }
.pg-reply { margin: 10px 0 0; padding: 10px 12px; background: var(--rd-alt); border-left: 4px solid var(--rd-accent); font-size: 15px; }
.pg-reply b { display: block; font-size: 13px; color: var(--rd-muted); }

/* --- фильтры, карта, лента --- */
.pg-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-chips .chip { cursor: pointer; font: inherit; font-weight: 700; font-size: 15px; }
html[data-theme] .pg-chips .chip.on { background: var(--rd-accent); color: var(--rd-on-accent); }
.pg-map { height: 380px; border: 2px solid var(--rd-accent); background: var(--rd-alt); z-index: 0; }
@media (max-width: 600px) { .pg-map { height: 300px; } }
html[data-theme="dark"] .pg-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
.pg-map .leaflet-control-attribution { font-size: 11px; }
html[data-theme="dark"] .pg-map .leaflet-control-attribution, html[data-theme="dark"] .pg-map .leaflet-bar a { background: #12222a; color: #d9e3e5; }
.pg-map .leaflet-popup-content-wrapper, .pg-map .leaflet-popup-tip { border-radius: 0; }
.pg-map .leaflet-popup-content { margin: 10px 12px; font: 600 14px/1.4 var(--font-body); }
.pg-map .leaflet-popup-content img { width: 180px; height: 120px; object-fit: cover; display: block; margin-bottom: 6px; }
.pg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 18px; }
.pg-item { border: 2px solid var(--rd-accent); background: var(--surface); display: flex; flex-direction: column; }
.pg-item > .pg-pic { aspect-ratio: 4 / 3; background: var(--rd-alt); overflow: hidden; }
.pg-item > .pg-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-item .pg-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pg-item h3 { margin: 4px 0 0; font-size: 17px; }
.pg-item p { margin: 0; }
.pg-item .pg-desc { overflow-wrap: anywhere; }
.pg-item .pg-showmap { margin-top: auto; align-self: flex-start; }
.pg-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; padding: 3px 10px; border: 2px solid currentColor; }
.pg-badge.st-new { color: #B3261E; }
.pg-badge.st-in_progress { color: #8a6500; }
.pg-badge.st-fixed { color: var(--rd-accent); }
html[data-theme="dark"] .pg-badge.st-new { color: #ff8a80; }
html[data-theme="dark"] .pg-badge.st-in_progress { color: #ffd166; }
.pg-badge.tp { color: var(--rd-text); border-color: var(--rd-line); }
.pg-dot { width: 10px; height: 10px; display: inline-block; background: currentColor; }
.pg-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; font-weight: 700; margin-top: 8px; }
.pg-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* --- как это работает --- */
.pg-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: st; padding: 0; margin: 0; list-style: none; }
.pg-steps li { border: 2px solid var(--rd-accent); padding: 16px 18px 16px 64px; position: relative; background: var(--surface); }
.pg-steps li::before { counter-increment: st; content: counter(st); position: absolute; left: 0; top: 0; bottom: 0; width: 46px; display: grid; place-items: center; background: var(--rd-accent); color: var(--rd-on-accent); font-weight: 800; font-size: 22px; }
.pg-steps b { display: block; color: var(--rd-head); }

/* --- форма --- */
.pg-form-wrap { background: var(--rd-alt); border-top: 2px solid var(--rd-accent); border-bottom: 2px solid var(--rd-accent); }
.pg-form { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.pg-form fieldset { border: 2px solid var(--rd-accent); background: var(--rd-bg); padding: 16px 18px 18px; margin: 0; min-width: 0; }
.pg-form legend { font-weight: 800; font-size: 18px; color: var(--rd-head); padding: 0 8px; }
.pg-form legend small { font-weight: 600; color: var(--rd-muted); font-size: 14px; }
.pg-hint { font-size: 14px; color: var(--rd-muted); margin: 6px 0 0; }
.pg-photo-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; width: 100%; border: 2px dashed var(--rd-accent); background: var(--teal-soft); color: var(--rd-accent); font-weight: 800; font-size: 18px; cursor: pointer; padding: 12px; text-align: center; }
.pg-photo-btn:hover { border-style: solid; }
.pg-photo-btn:focus-within { outline: 3px solid var(--rd-accent); outline-offset: 3px; }
.pg-photo-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pg-preview { margin-top: 12px; display: flex; gap: 12px; align-items: center; }
.pg-preview img { width: 140px; height: 105px; object-fit: cover; border: 2px solid var(--rd-accent); }
.pg-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pg-type { position: relative; }
.pg-type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pg-type span { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 14px; border: 2px solid var(--rd-accent); background: var(--rd-bg); color: var(--rd-text); font-weight: 700; font-size: 16px; cursor: pointer; }
.pg-type span i { font-style: normal; font-size: 22px; }
.pg-type input:checked + span { background: var(--rd-accent); color: var(--rd-on-accent); }
.pg-type input:focus-visible + span { outline: 3px solid var(--rd-accent); outline-offset: 3px; }
.pg-form-map { height: 300px; border: 2px solid var(--rd-accent); margin: 10px 0; z-index: 0; }
.pg-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pg-form input[type="text"], .pg-form textarea, .pg-login input {
  width: 100%; font: inherit; font-size: 17px; color: var(--rd-text); background: var(--rd-bg);
  border: 2px solid var(--rd-line); border-radius: 0; padding: 12px 14px; min-height: 52px;
}
.pg-form input[type="text"]:focus, .pg-form textarea:focus, .pg-login input:focus { border-color: var(--rd-accent); outline: none; }
.pg-form textarea { min-height: 110px; resize: vertical; }
.pg-counter { font-size: 13px; color: var(--rd-muted); text-align: right; margin-top: 4px; }
.pg-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.pg-submit-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
html[data-theme] .pg-submit-row .btn, html[data-theme] .pg-big { min-height: 60px; font-size: 18px; padding: 12px 30px; cursor: pointer; }
@media (max-width: 600px) { html[data-theme] .pg-submit-row .btn { width: 100%; } }
.pg-status { font-weight: 700; padding: 12px 16px; border-left: 5px solid var(--rd-accent); background: var(--rd-bg); }
.pg-status.err { border-left-color: #B3261E; }
.pg-done { border: 2px solid var(--rd-accent); background: var(--rd-bg); padding: 22px; text-align: center; }
.pg-done b { display: block; font-size: 22px; color: var(--rd-accent); margin-bottom: 6px; }

/* --- блок на главной --- */
html[data-theme] .section.pg-home-sec { padding: 28px 0 0; }
.pg-home { border: 2px solid var(--rd-accent); background: var(--teal-soft); padding: 26px 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; position: relative; }
.pg-home::before { content: ""; position: absolute; left: -2px; top: -2px; bottom: -2px; width: 10px; background: var(--rd-accent); }
.pg-home h2 { margin: 0; color: var(--rd-accent) !important; font-size: clamp(28px, 4vw, 38px); }
.pg-home .pg-pitch { margin: 4px 0 0; font-size: 18px; color: var(--rd-text); max-width: 640px; }
.pg-week { margin-top: 20px; border-top: 2px solid var(--rd-accent); padding-top: 16px; }
.pg-week h3 { margin: 0 0 12px; }
.pg-week-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pg-week-list a { text-decoration: none !important; color: inherit !important; }
@media (max-width: 600px) { .pg-home { padding: 20px 18px 20px 24px; } }

/* --- служба --- */
.pg-login { max-width: 440px; display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--rd-accent); padding: 22px; background: var(--rd-bg); }
.pg-login label { font-weight: 700; }
.pg-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 2px solid var(--rd-accent); margin: 10px 0 18px; }
.pg-tabs button { border: 2px solid var(--rd-accent); border-bottom: 0; background: var(--rd-bg); color: var(--rd-accent); font: inherit; font-weight: 700; min-height: 52px; padding: 8px 18px; cursor: pointer; margin-right: -2px; }
.pg-tabs button.on { background: var(--rd-accent); color: var(--rd-on-accent); }
.pg-adm-item { border: 2px solid var(--rd-accent); background: var(--surface); display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 0; margin-bottom: 18px; }
@media (max-width: 700px) { .pg-adm-item { grid-template-columns: 1fr; } }
.pg-adm-item .pg-pic img { width: 100%; height: 100%; max-height: 320px; object-fit: cover; display: block; }
.pg-adm-item .pg-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.pg-adm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pg-adm-actions .btn { cursor: pointer; }
.pg-adm-box { border-top: 2px solid var(--rd-line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.pg-adm-box input[type="text"], .pg-adm-box input[type="date"], .pg-adm-box textarea { font: inherit; font-size: 16px; padding: 10px 12px; border: 2px solid var(--rd-line); border-radius: 0; background: var(--rd-bg); color: var(--rd-text); min-height: 48px; width: 100%; }
.pg-adm-box textarea { min-height: 80px; }
.pg-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-reasons button { font: inherit; font-size: 14px; font-weight: 600; border: 2px solid var(--rd-line); background: var(--rd-bg); color: var(--rd-text); padding: 6px 10px; cursor: pointer; }
.btn.pg-danger { background: var(--rd-bg) !important; color: #B3261E !important; border-color: #B3261E !important; }
html[data-theme="dark"] .btn.pg-danger { color: #ff8a80 !important; border-color: #ff8a80 !important; }
.pg-check { background: var(--rd-alt); border-left: 5px solid var(--rd-accent); padding: 12px 16px; font-size: 15px; }

/* Очередь модерации (pages/sluzhba.html): крупное фото, зум по тапу, явные «Одобрить / Отклонить» */
.pg-adm-item.mod { grid-template-columns: 1fr; }
.pg-mod-pic { margin: 0; background: #111; display: flex; flex-direction: column; align-items: center; }
.pg-mod-pic img { width: 100%; max-height: 72vh; object-fit: contain; display: block; cursor: zoom-in; }
.pg-mod-pic figcaption { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--rd-alt); font-weight: 700; font-size: 14px; }
.pg-nophoto { padding: 40px 16px; text-align: center; color: var(--rd-text); background: var(--rd-alt); width: 100%; font-weight: 700; }
.pg-adm-item .pg-pic img { cursor: zoom-in; }
.pg-adm-item .pg-ba img { cursor: zoom-in; }
.btn.pg-big { min-height: 52px; font-size: 18px; padding: 12px 26px; }
.btn.pg-ok { background: #1E7B34 !important; border-color: #1E7B34 !important; color: #fff !important; }
.pg-badge.pg-flag { color: #fff; background: #C62828; border-color: #C62828; }
.pg-reasons button.pol { border-color: #C62828; color: #C62828; font-weight: 800; }
html[data-theme="dark"] .pg-reasons button.pol { border-color: #ff8a80; color: #ff8a80; }
.pg-rules ul { margin: 6px 0 8px; padding-left: 20px; }
.pg-rules li { margin: 2px 0; }
.pg-rules p { margin: 6px 0 0; }
.pg-zoom { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pinch-zoom pan-x pan-y; }
.pg-zoom img { max-width: 100vw; max-height: 100vh; object-fit: contain; cursor: zoom-in; }
.pg-zoom.full { align-items: flex-start; justify-content: flex-start; }
.pg-zoom.full img { max-width: none; max-height: none; cursor: zoom-out; }
.pg-zoom-x { position: fixed !important; top: 12px; right: 12px; z-index: 2; min-height: 48px; }
.pg-zoom-h { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 12px; color: #fff; background: rgba(0,0,0,.6); font-size: 14px; text-align: center; pointer-events: none; }
html.pg-noscroll, html.pg-noscroll body { overflow: hidden; }
