/* Справочник (Mini App) */
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  height: 54px; padding: 0 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.tb-btn {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer;
}
.tb-btn:active { background: var(--surface-2); }
.tb-brand { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none !important; flex: 1; }
.tb-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 900; letter-spacing: -.02em; }
.tb-title { flex: 1; font-weight: 650; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }

.view { max-width: 760px; margin: 0 auto; padding: 12px 14px 40px; }
.view.enter { animation: viewIn .22s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- главная ---------- */
.hero {
  position: relative; overflow: hidden;
  margin: 4px 0 18px; padding: 22px 20px 20px;
  border-radius: 22px; color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .18), transparent 55%),
    linear-gradient(135deg, #e3262f 0%, #a8121a 60%, #6d0b11 100%);
  box-shadow: 0 12px 32px rgba(214, 32, 42, .28);
}
.hero::after {
  content: "NC"; position: absolute; right: -10px; bottom: -36px;
  font-size: 150px; font-weight: 900; letter-spacing: -.06em; opacity: .09; line-height: 1;
}
.hero h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.hero p { margin: 4px 0 16px; opacity: .88; font-size: 14px; }
.hero-search {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 46px; padding: 0 14px; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .96); color: #6b7280; font-size: 15px; text-align: left; cursor: text;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.section-title { margin: 22px 4px 10px; font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 10px; min-height: 104px;
  padding: 14px; border-radius: 18px; background: var(--surface);
  color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-1);
  transition: transform .12s, box-shadow .12s;
}
.tile:active { transform: scale(.98); }
@media (hover: hover) { .tile:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); } }
.tile-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); }
.tile-title { font-weight: 650; font-size: 15px; line-height: 1.25; }
.tile-sub { font-size: 12px; color: var(--text-3); margin-top: auto; }

/* ---------- списки ---------- */
.list { background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-1); }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px;
  color: var(--text); text-decoration: none !important; cursor: pointer;
  border: 0; background: transparent; width: 100%; text-align: left;
}
.row + .row { border-top: 1px solid var(--border); }
.row:active { background: var(--surface-2); }
@media (hover: hover) { .row:hover { background: var(--surface-2); } }
.row-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 560; font-size: 15px; line-height: 1.3; }
.row-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-chev { flex: none; color: var(--text-3); }
.row.link .row-ico { background: color-mix(in srgb, var(--link) 14%, transparent); color: var(--link); }

/* ---------- раздел ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 2px 8px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.node-head { display: flex; align-items: center; gap: 12px; margin: 4px 2px 16px; }
.node-ico { flex: none; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 26px; background: var(--accent-soft); }
.node-head h1 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.015em; }

.blocks { display: flex; flex-direction: column; gap: 10px; }
.block { background: var(--surface); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-1); font-size: 15px; line-height: 1.55; }
.block.media { padding: 8px; }
.block .cap { padding: 8px 8px 4px; }
.gallery { display: grid; gap: 6px; grid-template-columns: repeat(2, 1fr); }
.gallery.one { grid-template-columns: 1fr; }
.gallery.three > :first-child { grid-column: span 2; }
.gallery img {
  width: 100%; height: 100%; max-height: 420px; object-fit: cover; border-radius: 12px;
  background: var(--surface-2); cursor: zoom-in; aspect-ratio: 4 / 3;
}
.gallery.one img { aspect-ratio: auto; max-height: 520px; object-fit: contain; background: var(--surface-2); }
.block video { width: 100%; border-radius: 12px; background: #000; max-height: 480px; }

.nav-title { margin: 22px 4px 10px; font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.foot-nav { display: flex; gap: 8px; margin-top: 22px; justify-content: center; flex-wrap: wrap; }

/* ---------- поиск ---------- */
.search-box { position: sticky; top: 62px; z-index: 5; margin-bottom: 12px; }
.search-box input {
  width: 100%; height: 48px; padding: 0 16px 0 44px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 16px; outline: none; box-shadow: var(--shadow-1);
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box svg { position: absolute; left: 14px; top: 14px; color: var(--text-3); }
.empty { text-align: center; color: var(--text-3); padding: 48px 16px; }
.empty .big { font-size: 44px; margin-bottom: 8px; }
