/* =========================================================
   Медресе Сары-Алтын — светлый «стеклянный» стиль
   Mobile-first: телефон → планшет (720px) → компьютер (1024px)
   ========================================================= */

:root {
  --green: #0F7A4A;
  --green-2: #1FA067;
  --green-dark: #0B5E39;
  --mint: #8FCBA9;
  --mint-2: #CDEBD9;
  --mint-3: #EDF6F0;
  --ink: #0E1A14;
  --ink-2: #2C3A33;
  --ink-3: #3D5247;
  --muted: #5B6B63;
  --line: #D3E4D9;
  --warn-bg: #FFF3D6; --warn: #7A4F00; --warn-dot: #D99A00;
  --bad-bg: #FDECEC;  --bad: #9B2C2C;
  --ok-bg: rgba(15,122,74,.1);
  --radius: 26px;
  --radius-sm: 16px;
  --shadow: 0 12px 36px rgba(16,80,50,.08);
  --shadow-lg: 0 20px 50px rgba(16,80,50,.16);
  --grad: linear-gradient(160deg, var(--green-2) 0%, var(--green) 100%);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arabic: "Amiri", "Noto Naskh Arabic", serif;
  --gap: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #EAF6EE 0%, #FFFFFF 26%, #F2FAF5 55%, #FFFFFF 78%, #EEF8F2 100%);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(15,122,74,.45); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@font-face { font-family: "CertSerif"; src: url("../fonts/DejaVuSerif-Bold.ttf") format("truetype"); font-display: swap; }

/* мягкие световые пятна за стеклом */
.blobs { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.blobs span { position: absolute; border-radius: 50%; filter: blur(8px); }
.blobs span:nth-child(1) { width: 420px; height: 420px; top: -120px; right: -140px; background: radial-gradient(circle, rgba(46,170,106,.22), rgba(46,170,106,0) 70%); }
.blobs span:nth-child(2) { width: 460px; height: 460px; top: 45%; left: -200px; background: radial-gradient(circle, rgba(120,205,160,.2), rgba(120,205,160,0) 70%); }
.blobs span:nth-child(3) { width: 380px; height: 380px; bottom: -140px; right: -100px; background: radial-gradient(circle, rgba(46,170,106,.14), rgba(46,170,106,0) 70%); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 800; }
.green { color: var(--green); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- стекло ---------- */
.glass {
  background: rgba(255,255,255,.62);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.card { padding: 20px; }
.card-sm { padding: 14px; border-radius: 20px; }
.tint { background: rgba(15,122,74,.06); border-radius: var(--radius-sm); padding: 12px 14px; }
.divider { height: 1px; background: rgba(15,122,74,.12); border: 0; margin: 0; }

/* ---------- типографика ---------- */
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--green); }
.h1 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.1; font-weight: 800; letter-spacing: -.025em; }
.h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.h3 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.lead { font-size: clamp(15px, 1.4vw, 17px); line-height: 1.6; color: var(--ink-2); }
.arabic { font-family: var(--arabic); color: var(--green); line-height: 1.2; }
.section { padding: 28px 0; }
.section-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; padding: 0 4px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 16px; border: 1px solid transparent;
  font-size: 15px; font-weight: 800; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(15,122,74,.28); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 30px rgba(15,122,74,.36); }
.btn-ghost { background: rgba(255,255,255,.8); border-color: var(--line); color: var(--green); }
.btn-ghost:hover { background: #fff; }
.btn-soft { background: rgba(15,122,74,.08); color: var(--green); }
.btn-soft:hover { background: rgba(15,122,74,.13); }
.btn-danger { background: #B42F2F; color: #fff; }
.btn-danger:hover { color: #fff; background: #9B2626; }
.btn-danger-ghost { background: rgba(255,255,255,.85); border-color: #F1CACA; color: var(--bad); }
.btn-lg { min-height: 56px; font-size: 16px; border-radius: 18px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 15px; display: inline-flex; align-items: center;
  justify-content: center; color: var(--ink); text-decoration: none; cursor: pointer;
  background: rgba(255,255,255,.7); border: 1px solid rgba(15,122,74,.12);
}
.icon-btn:hover { background: #fff; color: var(--ink); }

/* ---------- шапка ---------- */
.topbar { position: sticky; top: 0; z-index: 30; padding: 12px 0; }
.topbar-inner {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 6px 6px 12px;
  border-radius: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 15px; font-weight: 800; }
.brand-text span { font-size: 11px; font-weight: 600; color: var(--muted); }
.topnav { display: none; gap: 4px; }
.topnav a { padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--ink-3); text-decoration: none; }
.topnav a:hover { background: rgba(15,122,74,.07); color: var(--green); }
.topbar .btn-cta { display: none; }
.lang-switch { display: flex; padding: 3px; gap: 2px; border-radius: 13px; background: rgba(15,122,74,.08); flex: none; }
.lang-switch a { min-width: 40px; height: 38px; padding: 0 8px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--ink-3); text-decoration: none; }
.lang-switch a.on { background: #fff; color: var(--green); box-shadow: 0 3px 10px rgba(16,80,50,.12); }
@media (max-width: 360px) { .brand-text span { display: none; } .lang-switch a { min-width: 34px; padding: 0 6px; } }

/* ---------- флеш-сообщения ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.flash { padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 700; display: flex; gap: 10px; align-items: flex-start; }
.flash-ok { background: rgba(15,122,74,.1); color: var(--green-dark); }
.flash-error { background: var(--bad-bg); color: var(--bad); }

/* ---------- чипы, пилюли ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(15,122,74,.08); color: var(--green); font-size: 12px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 7px 11px; border-radius: 999px; background: rgba(15,122,74,.07); font-size: 12px; font-weight: 700; color: var(--green-dark); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-pending { background: var(--warn-bg); color: var(--warn); }
.pill-pending::before { background: var(--warn-dot); }
.pill-approved { background: var(--ok-bg); color: var(--green-dark); }
.pill-rejected { background: var(--bad-bg); color: var(--bad); }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #5BE39A; animation: ring 1.6s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(91,227,154,.6); } 100% { box-shadow: 0 0 0 10px rgba(91,227,154,0); } }
@keyframes ring-green { 0% { box-shadow: 0 0 0 0 rgba(15,122,74,.35); } 100% { box-shadow: 0 0 0 10px rgba(15,122,74,0); } }

/* =========================================================
   ГЛАВНАЯ
   ========================================================= */
.hero { display: grid; gap: 20px; padding-top: 4px; }
.bismillah { text-align: center; font-size: 22px; margin-bottom: 10px; }

.media {
  position: relative; border-radius: 30px; overflow: hidden; background: #DCEBE3;
  aspect-ratio: 4 / 5; box-shadow: var(--shadow-lg); isolation: isolate;
}
.media-panel { position: absolute; inset: 0; }
.media-stage, .media-cover { position: absolute; inset: 0; }
.media-panel img, .media-panel video, .media-panel iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.media-panel video { background: #0E1A14; object-fit: contain; }
.media-panel video.fill { object-fit: cover; }   /* вертикальное видео — на всю площадь, без чёрных полос */

/* Анимация загрузки: в мечеть со всех сторон летят «данные», мечеть наполняется зеленью */
.media-loader { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 14px; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.18), rgba(8,30,20,.55) 70%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: ml-in .3s ease both; }
.media-loader[hidden] { display: none; }
.ml-orbit { position: relative; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.88); box-shadow: 0 18px 50px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.9); }
.ml-orbit::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.45); animation: ml-spin 12s linear infinite; }
.ml-mosque { width: 92px; height: 92px; position: relative; z-index: 1; overflow: visible; }
.ml-base { fill: #E7F4EC; }
.ml-line, .ml-door { fill: none; stroke: #0F7A4A; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ml-door { stroke: #fff; fill: rgba(255,255,255,.35); }
.ml-moon { fill: #C99A2E; animation: ml-glow 1.6s ease-in-out infinite; transform-origin: 60px 12px; }
.ml-level { animation: ml-fill 2.4s cubic-bezier(.5,0,.3,1) infinite; }
.ml-orbit i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 3px;
  background: linear-gradient(135deg, #3FBF7F, #0F7A4A); box-shadow: 0 0 10px rgba(63,191,127,.8);
  transform: rotate(var(--a)) translateY(-120px); opacity: 0; animation: ml-data 1.6s cubic-bezier(.55,0,.75,.4) var(--d) infinite; }
.ml-orbit i:nth-child(3n) { background: linear-gradient(135deg, #F2D27A, #C99A2E); box-shadow: 0 0 10px rgba(242,210,122,.85); border-radius: 50%; }
.ml-orbit i:nth-child(4n) { width: 6px; height: 6px; margin: -3px; }
.ml-text { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink, #10241A);
  font-size: 13px; font-weight: 800; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.ml-text b { padding: 2px 8px; border-radius: 999px; background: var(--green, #0F7A4A); color: #fff; font-size: 11px; }
.ml-text b:empty { display: none; }
.ml-text span::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: ml-dots 1.2s steps(4) infinite; }
@keyframes ml-data {
  0% { transform: rotate(var(--a)) translateY(-130px) scale(1); opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(-14px) scale(.3); opacity: 0; }
}
@keyframes ml-fill { 0% { transform: translateY(100px); } 70%, 100% { transform: translateY(0); } }
@keyframes ml-glow { 50% { transform: scale(1.18); filter: drop-shadow(0 0 6px #F2D27A); } }
@keyframes ml-spin { to { transform: rotate(360deg); } }
@keyframes ml-in { from { opacity: 0; } }
@keyframes ml-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (max-width: 360px) { .ml-orbit { width: 124px; height: 124px; } .ml-mosque { width: 76px; height: 76px; } }
.media-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,30,20,.05) 0%, rgba(8,30,20,0) 40%, rgba(8,30,20,.72) 100%); pointer-events: none; }
.media-badge {
  position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 999px; color: #fff; font-size: 12px; font-weight: 700;
  background: rgba(8,30,20,.32); border: 1px solid rgba(255,255,255,.4);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.media-caption { position: absolute; left: 18px; right: 18px; bottom: 18px; color: #fff; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.media-caption small { font-size: 12px; font-weight: 600; opacity: .9; }
.media-caption strong { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -62%);
  width: 86px; height: 86px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); cursor: pointer;
  background: rgba(255,255,255,.3); -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  transition: transform .2s ease;
}
.play:hover { transform: translate(-50%, -62%) scale(1.05); }
.play span { width: 62px; height: 62px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--green); }
.media-toast { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.94); font-size: 12px; font-weight: 800; box-shadow: 0 6px 20px rgba(0,0,0,.12); }

.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.thumb {
  padding: 4px; border-radius: 16px; cursor: pointer; text-align: center;
  background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 6px 18px rgba(16,80,50,.08);
}
.thumb[aria-selected="true"] { background: rgba(255,255,255,.95); border: 1.5px solid var(--green); }
.thumb-img { position: relative; display: block; }
.thumb-img img { width: 100%; height: 56px; object-fit: cover; border-radius: 12px; }
.thumb-play { position: absolute; inset: 0; border-radius: 12px; background: rgba(8,40,25,.35); display: flex; align-items: center; justify-content: center; }
.thumb-play i { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.94); display: flex; align-items: center; justify-content: center; color: var(--green); }
.thumb b { display: block; padding: 6px 0 2px; font-size: 12px; font-weight: 800; }

.archive { display: flex; gap: 6px; overflow-x: auto; margin: 10px -16px 0; padding: 2px 16px 4px; scrollbar-width: none; }
.archive button { flex: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(15,122,74,.15); background: rgba(255,255,255,.75); font-size: 12px; font-weight: 700; color: var(--ink-3); cursor: pointer; }
.archive button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }

.quality { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quality button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(15,122,74,.15); background: rgba(255,255,255,.8); font-size: 12px; font-weight: 800; color: var(--ink-3); cursor: pointer; }
.quality button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.quality small { align-self: center; font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.cta-bar {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 12px 12px 18px; border-radius: 24px;
  background: var(--grad); color: #fff; text-decoration: none; box-shadow: 0 14px 30px rgba(15,122,74,.28);
  transition: transform .15s ease, box-shadow .2s;
}
.cta-bar:hover { color: #fff; box-shadow: 0 18px 36px rgba(15,122,74,.36); }
.cta-bar:active { transform: scale(.99); }
.cta-bar .arabic { color: #fff; font-size: 17px; opacity: .95; line-height: 1; }
.cta-bar b { font-size: 17px; font-weight: 800; }
.cta-arrow { width: 48px; height: 48px; flex: none; border-radius: 16px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; }

.about { display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 0; }
.location { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.location svg { flex: none; margin-top: 2px; color: var(--green); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 16px; }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--green); line-height: 1.2; }
.stat span { font-size: 13px; font-weight: 600; color: var(--muted); }

/* прогресс сбора */
.progress { height: 12px; border-radius: 999px; background: rgba(15,122,74,.1); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5CCB8E 0%, var(--green) 100%); transition: width .8s ease; }
.big-num { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-stats > div { padding: 12px; border-radius: 16px; background: rgba(15,122,74,.06); }
.mini-stats b { display: block; font-size: 16px; font-weight: 800; }
.mini-stats span { font-size: 12px; font-weight: 600; color: var(--muted); }

/* этапы */
.timeline { list-style: none; margin: 0; padding: 8px 20px; }
.timeline li { display: flex; gap: 14px; min-height: 60px; }
.tl-axis { display: flex; flex-direction: column; align-items: center; width: 24px; padding-top: 14px; flex: none; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid #C9DDD1; color: #fff; }
.tl-line { flex: 1; width: 2px; margin-top: 4px; border-radius: 2px; background: #DDEAE2; }
.timeline li:last-child .tl-line { background: transparent; }
.timeline .done .tl-dot { background: var(--green); border-color: var(--green); }
.timeline .done .tl-line { background: var(--green); }
.timeline .current .tl-dot { border: 6px solid var(--green); animation: ring-green 1.6s ease-out infinite; }
.tl-text { display: flex; flex-direction: column; gap: 2px; padding: 13px 0 10px; }
.tl-text b { font-size: 15px; font-weight: 700; }
.tl-text span { font-size: 12px; font-weight: 600; color: var(--muted); }
.timeline .current .tl-text span { color: var(--green); }

/* галерея */
.gallery { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { flex: none; width: min(80vw, 320px); margin: 0; border-radius: 22px; overflow: hidden; scroll-snap-align: start; background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 10px 28px rgba(16,80,50,.1); }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery figcaption { padding: 10px 14px 12px; font-size: 13px; font-weight: 700; }

/* планировка */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: rgba(15,122,74,.07); }
.tabs button, .tabs a { min-height: 42px; border: 0; border-radius: 12px; background: transparent; font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.tabs [aria-selected="true"], .tabs .active { background: #fff; color: var(--green); font-weight: 800; box-shadow: 0 4px 12px rgba(16,80,50,.1); }
.plan-layout { display: grid; gap: 14px; }
.plan { position: relative; width: 100%; border-radius: 10px; background: #B7D2C3; box-shadow: inset 0 0 0 2px #9FC2AE; }
.plan button {
  position: absolute; border: 0; border-radius: 5px; padding: 0; margin: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: clamp(9px, 1.1vw, 13px); font-weight: 800; color: var(--ink-3);
  transition: background .2s, color .2s;
}
.plan .t-room { background: #fff; }
.plan .t-corr { background: #EDF6F0; }
.plan .t-wet { background: #DDEDE4; }
.plan .t-stair { background: repeating-linear-gradient(90deg, #E2ECE6 0 3px, #F7FBF8 3px 6px); }
.plan .t-prayer { background: var(--mint-2); color: var(--green-dark); }
.plan button.on { background: var(--green); color: #fff; }
.plan button:hover:not(.on) { filter: brightness(.96); }
.room-sel { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(120deg, rgba(15,122,74,.1), rgba(15,122,74,.04)); }
.room-num { flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--green); color: #fff; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.room-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.room-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 8px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.room-list button:hover { background: rgba(15,122,74,.05); }
.room-list button.on { background: rgba(15,122,74,.09); }
.room-list i { flex: none; width: 24px; height: 24px; border-radius: 8px; font-size: 11px; font-style: normal; font-weight: 800; display: flex; align-items: center; justify-content: center; background: rgba(15,122,74,.08); color: var(--green-dark); }
.room-list button.on i { background: var(--green); color: #fff; }
.room-list span { flex: 1; font-size: 13px; font-weight: 600; }
.room-list em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }

/* участок */
.landbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 3px; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; }
.legend div { display: flex; align-items: center; gap: 10px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* финальный блок садака */
.sadaqa { padding: 24px 20px; border-radius: 28px; background: linear-gradient(160deg, rgba(31,160,103,.14) 0%, rgba(255,255,255,.72) 60%); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 14px 40px rgba(16,80,50,.1); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

.footer { padding: 28px 0 40px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.footer a { color: var(--muted); }

/* =========================================================
   ФОРМЫ
   ========================================================= */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.input {
  width: 100%; min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.9);
  padding: 0 14px; font-size: 16px; font-weight: 600; color: var(--ink); outline: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { padding: 12px 14px; min-height: 90px; resize: vertical; font-size: 16px; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233D5247' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.input::placeholder { color: #8A9A91; font-weight: 500; }
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,122,74,.14); }
.field.has-error .input, .field.has-error .drop { border-color: #D06A6A; }
.error-text { font-size: 12px; font-weight: 700; color: var(--bad); }
.hint { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(15,122,74,.06); font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
input[type=range] { width: 100%; accent-color: var(--green); }
input[type=color] { width: 48px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; }

.drop {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; cursor: pointer;
  border: 2px dashed #A9D6BC; background: rgba(255,255,255,.6); transition: border-color .2s, background .2s;
}
.drop:hover { border-color: var(--green); }
.drop.has-file { border-color: var(--green); background: rgba(15,122,74,.08); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-icon { width: 48px; height: 48px; flex: none; border-radius: 15px; background: #fff; color: var(--green); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(16,80,50,.1); overflow: hidden; }
.drop-icon img { width: 100%; height: 100%; object-fit: cover; }
.drop-icon.solid { background: var(--grad); color: #fff; }
.drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.drop-text b { font-size: 14px; font-weight: 800; color: var(--ink); }
.drop-text span { font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   ВНУТРЕННИЕ СТРАНИЦЫ
   ========================================================= */
.page { padding-top: 8px; padding-bottom: 40px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head .title { font-size: 16px; font-weight: 800; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.steps > div { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 18px; background: rgba(15,122,74,.08); }
.steps > div:first-child { background: var(--green); color: #fff; }
.steps small { font-size: 12px; font-weight: 800; color: var(--green); }
.steps > div:first-child small { color: #fff; opacity: .85; }
.steps b { font-size: 13px; font-weight: 700; line-height: 1.25; }
.donate-grid { display: grid; gap: 16px; }
.qr-box { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 24px; background: #fff; box-shadow: 0 8px 24px rgba(16,80,50,.08); }
.qr-box img { width: 220px; height: 220px; object-fit: contain; border-radius: 12px; }
.qr-empty { width: 210px; height: 210px; border-radius: 16px; border: 2px dashed #A9D6BC; background: repeating-linear-gradient(45deg, #F4FAF6 0 10px, #fff 10px 20px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px; color: var(--ink-3); }
.or { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(15,122,74,.12); }
.copy-row { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 18px; background: rgba(15,122,74,.06); }
.copy-row b { font-size: 17px; font-weight: 800; letter-spacing: .01em; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv > div { padding: 12px 14px; border-radius: 16px; background: rgba(15,122,74,.06); min-width: 0; }
.kv span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.kv b { display: block; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }

.success-icon { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto; background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.95); display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 34px rgba(16,80,50,.14); animation: pop .5s ease-out; }
.success-icon span { width: 68px; height: 68px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.pin-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border-radius: 22px; background: #fff; border: 2px dashed var(--green); text-align: center; }
.pin-box b { font-size: 40px; letter-spacing: .3em; font-weight: 800; color: var(--green); padding-left: .3em; }

.avatar { width: 62px; height: 62px; flex: none; border-radius: 22px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; box-shadow: 0 10px 22px rgba(15,122,74,.25); }
.avatar-sm { width: 46px; height: 46px; border-radius: 15px; font-size: 15px; background: rgba(15,122,74,.1); color: var(--green-dark); box-shadow: none; }
.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat3 > div { padding: 12px; border-radius: 16px; background: rgba(15,122,74,.07); }
.stat3 b { display: block; font-size: 18px; font-weight: 800; color: var(--green); }
.stat3 span { font-size: 11px; font-weight: 700; color: var(--muted); }
.donation { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.reason { padding: 10px 12px; border-radius: 12px; background: #FFF7F7; font-size: 13px; font-weight: 600; color: #6B2A2A; }
.cert-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 24px; text-decoration: none; color: var(--ink); background: linear-gradient(130deg, rgba(31,160,103,.16) 0%, rgba(255,255,255,.78) 70%); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 12px 30px rgba(16,80,50,.09); }
.cert-card:hover { color: var(--ink); }
.cert-thumb { width: 78px; height: 56px; flex: none; border-radius: 10px; overflow: hidden; background: #fff; border: 2px solid var(--mint-2); }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cert-preview { padding: 10px; border-radius: 22px; background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.95); box-shadow: var(--shadow-lg); }
.cert-preview img { width: 100%; border-radius: 10px; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; }

/* =========================================================
   АДМИНКА
   ========================================================= */
.admin-shell { display: grid; gap: 18px; padding-top: 16px; padding-bottom: 40px; }
.admin-side { display: flex; flex-direction: column; gap: 14px; }
.admin-side .brand { margin: 0; }
.admin-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: rgba(15,122,74,.07); }
.admin-nav a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--ink-3); text-decoration: none; }
.admin-nav a.active { background: #fff; color: var(--green); font-weight: 800; box-shadow: 0 4px 12px rgba(16,80,50,.1); }
.admin-nav a svg { display: none; }
.admin-nav .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-dot); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.admin-side .side-extra { display: none; }
.admin-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.admin-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-title h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-cards .glass { padding: 14px 12px; border-radius: 20px; }
.stat-cards b { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.stat-cards span { font-size: 11px; font-weight: 700; color: var(--muted); }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 800; text-decoration: none; border: 1px solid rgba(15,122,74,.15); background: rgba(255,255,255,.7); color: var(--ink-3); }
.filter-chips a.active { background: var(--green); border-color: var(--green); color: #fff; }
.filter-chips a span { opacity: .7; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 22px; text-decoration: none; color: var(--ink); }
.list-item:hover { color: var(--ink); background: rgba(255,255,255,.85); }
.list-item .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.receipt-view { border-radius: 18px; background: linear-gradient(160deg, #DCEBE3 0%, #EEF5F1 100%); min-height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.receipt-view img { max-height: 70vh; width: auto; margin: 0 auto; }
.review-grid { display: grid; gap: 16px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.reasons label { cursor: pointer; }
.reasons input { position: absolute; opacity: 0; pointer-events: none; }
.reasons span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid #EBD3D3; background: #fff; color: #6B2A2A; }
.reasons input:checked + span { background: var(--bad); border-color: var(--bad); color: #fff; }
.reasons input:focus-visible + span { outline: 3px solid rgba(155,44,44,.35); }
details.reject > summary { list-style: none; }
details.reject > summary::-webkit-details-marker { display: none; }
details.donor > summary { list-style: none; cursor: pointer; }
details.donor > summary::-webkit-details-marker { display: none; }
details.donor[open] { background: rgba(255,255,255,.85); }
.donor-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.kvline { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.kvline b { color: var(--ink); }
.settings-grid { display: grid; gap: 16px; align-items: start; }
.video-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(15,122,74,.06); }
.video-row form { margin: 0; }
.cert-editor { position: relative; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 8px 22px rgba(16,80,50,.1); user-select: none; touch-action: none; }
.cert-editor img { width: 100%; }
.name-box {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; cursor: grab; padding: 2px 12px;
  font-family: "CertSerif", Georgia, serif; font-weight: 700; line-height: 1.1;
  border: 1.5px dashed var(--green); border-radius: 6px; background: rgba(15,122,74,.1);
}
.name-box:active { cursor: grabbing; }
.name-box::after { content: "Перетащите"; position: absolute; left: 50%; top: -22px; transform: translateX(-50%); height: 18px; padding: 0 7px; border-radius: 999px; background: var(--green); color: #fff; font: 800 10px/18px var(--font); }
.req-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) 44px; gap: 6px; align-items: center; }
@media (max-width: 480px) { .req-row { grid-template-columns: minmax(0, 1fr) 44px; } .req-row input[name=req_value] { grid-column: 1; grid-row: 2; } .req-row .icon-btn { grid-row: 1 / span 2; grid-column: 2; } }
@media (max-width: 719px) { .form-grid.two:has(textarea) { grid-template-columns: 1fr; } }
.otp-input { text-align: center; font-size: 30px; font-weight: 800; letter-spacing: .5em; padding-left: .5em; min-height: 64px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(14,26,20,.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s ease-out; }
.modal { width: 100%; max-width: 420px; background: rgba(255,255,255,.92); animation: pop .25s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 700; }

/* =========================================================
   ПЛАНШЕТ ≥ 720px
   ========================================================= */
@media (min-width: 720px) {
  .wrap { padding: 0 24px; }
  .media { aspect-ratio: 16 / 11; }
  .thumb-img img { height: 74px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 4px 0 12px; overflow: visible; }
  .gallery figure { width: auto; }
  .bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
  .donate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .stat-cards .glass { padding: 18px; }
  .stat-cards b { font-size: 26px; }
  .stat-cards span { font-size: 12px; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid .span-2 { grid-column: span 2; }
  .review-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .profile-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
  .archive { margin: 10px 0 0; padding: 2px 0 4px; }
}

/* =========================================================
   КОМПЬЮТЕР ≥ 1024px
   ========================================================= */
@media (min-width: 1024px) {
  :root { --gap: 18px; }
  .topnav { display: flex; }
  .topbar .btn-cta { display: inline-flex; }
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 12px; }
  .hero-info { position: sticky; top: 100px; }
  .media { aspect-ratio: 4 / 3.4; }
  .bismillah { text-align: left; }
  .about { padding: 6px 0 0; gap: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding: 44px 0; }
  .plan-layout { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  .room-list { max-height: 420px; }
  .admin-shell { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding-top: 24px; }
  .admin-side { position: sticky; top: 24px; align-self: start; padding: 18px; }
  .admin-nav { grid-template-columns: 1fr; background: transparent; padding: 0; gap: 2px; }
  .admin-nav a { justify-content: flex-start; padding: 0 14px; min-height: 46px; font-size: 14px; }
  .admin-nav a svg { display: block; }
  .admin-nav .count { margin-left: auto; }
  .admin-side .side-extra { display: flex; }
  .admin-title h1 { font-size: 30px; }
  .list-item { padding: 16px 18px; }
}

@media (min-width: 1280px) {
  .gallery figure img { aspect-ratio: 16 / 9.5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Защита от выхода за край экрана на телефонах ---- */
html, body { max-width: 100%; overflow-x: clip; }
[class*="-grid"] > *, .glass, .stack > *, .field, .drop { min-width: 0; }
.drop-text span, .drop-text b { white-space: normal; overflow-wrap: anywhere; }
.drop input[type=file] { min-width: 0; max-width: 100%; }
/* iPhone приближает экран, если в поле ввода шрифт меньше 16px */
@media (max-width: 1023px) { input, textarea, select { font-size: 16px !important; } }
.name-box small { font-size: .62em; opacity: .78; }
.name-box small:empty { display: none; }
.video-thumb { width: 44px; height: 54px; flex: none; border-radius: 10px; object-fit: cover; background: #0E1A14; }
.hero > *, .hero-media, .hero-info { min-width: 0; }
.archive::-webkit-scrollbar { display: none; }

/* Быстрый переход сайт ⇄ админка */
.admin-jump { position: relative; color: var(--green); }
.admin-jump .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warn-dot, #E0892B); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.comment-card { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--green); }
.comment-card p { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-line { display: flex; align-items: center; gap: 5px; color: var(--ink-3); font-weight: 600; }
.comment-line svg { flex: none; color: var(--green); }
@media (max-width: 400px) {
  .topbar-inner:has(.admin-jump) { gap: 6px; }
  .topbar-inner:has(.admin-jump) .icon-btn { width: 40px; height: 40px; flex: none; }
  .topbar-inner:has(.admin-jump) .lang-switch a { min-width: 34px; padding: 0 6px; }
}
@media (max-width: 370px) {
  .topbar-inner:has(.admin-jump) .brand-text { display: none; }
}
