/* ==========================================================================
   App shell: announcement, header, tab bar, footer, section scaffolding
   ========================================================================== */

.announce {
  background: var(--ink);
  color: #f6efe2;
  font-size: 13.5px;
  text-align: center;
  padding: 8px var(--gutter);
}
.announce b { color: var(--saffron); }

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 20px -18px rgb(23 37 60 / 0.5); }
.header__inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand__mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 4px 4px;
  background: var(--lapis);
  color: var(--saffron);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.18);
}
.brand__mark .ic { width: 24px; height: 24px; }
.brand__name { font-family: var(--font-display); font-size: 23px; font-weight: 650; letter-spacing: -0.02em; }
.brand__name i { font-style: normal; color: var(--saffron-600); }

.nav { display: none; margin-left: 12px; gap: 2px; }
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 550;
  font-size: 15px;
  color: var(--ink-2);
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current='page'] { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current='page']::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--saffron); }
.count-pill {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--saffron);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.count-pill:empty, .count-pill[data-n='0'] { display: none; }

.header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14.5px;
  transition: border-color 0.15s;
}
.search-trigger:hover { border-color: var(--ink-2); color: var(--ink-2); }
.search-trigger kbd { font: 600 11px var(--font-ui); padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--muted); }
.search-trigger .label-long { display: none; }
.header__cta { display: none; }

@media (min-width: 900px) {
  .nav { display: flex; }
  .header__cta { display: inline-flex; }
}
@media (min-width: 1100px) {
  .search-trigger { width: 230px; }
  .search-trigger .label-long { display: inline; }
  .search-trigger kbd { margin-left: auto; }
}
@media (max-width: 1099px) {
  .search-trigger { width: 44px; padding: 0; justify-content: center; }
  .search-trigger kbd { display: none; }
}

/* ---- Mobile tab bar ---------------------------------------------------- */
.tabbar {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}
.tabbar a span:not(.count-pill) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding-inline: 2px; }
.tabbar a .ic { width: 23px; height: 23px; }
.tabbar a[aria-current='page'] { color: var(--lapis); }
.tabbar a[aria-current='page'] .ic { stroke-width: 2.2; }
.tabbar .count-pill { position: absolute; top: 6px; left: calc(50% + 6px); height: 17px; min-width: 17px; font-size: 10px; padding: 0 4px; }
.tabbar__main .tabbar__fab {
  width: 50px;
  height: 50px;
  margin-top: -22px;
  border-radius: 16px 16px 8px 8px;
  display: grid;
  place-items: center;
  background: var(--lapis);
  color: #fff;
  box-shadow: 0 8px 18px -6px rgb(29 78 158 / 0.65), inset 0 -3px 0 rgb(0 0 0 / 0.18);
  transition: transform 0.15s var(--ease);
}
.tabbar__main:active .tabbar__fab { transform: scale(0.94); }
.tabbar__main[aria-current='page'] .tabbar__fab { background: var(--saffron); color: var(--ink); }
.tabbar__main .tabbar__fab .ic { width: 24px; height: 24px; }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ---- Main & sections --------------------------------------------------- */
.main { min-height: 60vh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.main:focus { outline: none; }
.section { padding-block: 44px; }
@media (min-width: 900px) { .section { padding-block: 72px; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(28px, 4.2vw, 42px); font-weight: 600; letter-spacing: -0.02em; margin-top: 10px; }
.section-head h2 em { font-style: italic; font-weight: 500; color: var(--lapis); }
.section-head p { color: var(--muted); max-width: 52ch; margin: 8px 0 0; }

.page-head { padding-top: 22px; padding-bottom: 8px; }
@media (min-width: 900px) { .page-head { padding-top: 40px; } }
.page-head h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 50px); letter-spacing: -0.025em; font-weight: 600; }
.page-head h1 em { font-style: italic; font-weight: 500; color: var(--lapis); }
.page-head p { color: var(--muted); margin: 10px 0 0; max-width: 60ch; font-size: 16.5px; }

.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; margin-bottom: 12px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs .ic { width: 14px; height: 14px; }

/* ---- Footer ------------------------------------------------------------ */
.footer {
  margin-top: 40px;
  background: var(--lapis-900) var(--girih-light);
  background-size: 64px;
  color: #dfe6f3;
  padding: 48px 0 calc(28px + var(--tabbar-h) + env(safe-area-inset-bottom));
}
.footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer__grid { display: grid; gap: 32px; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer .brand__name { color: #fff; }
.footer .brand__mark { background: var(--saffron); color: var(--lapis-900); }
.footer h3 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--saffron); margin-bottom: 14px; }
.footer ul { display: grid; gap: 9px; font-size: 15px; }
.footer__note { margin-top: 14px; font-size: 14px; line-height: 1.6; color: #b8c5dd; max-width: 46ch; }
.footer__bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / 0.12); display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: 13px; color: #9fb0cf; }
.footer__contact { display: flex; align-items: center; gap: 8px; }
.footer__contact .ic { width: 16px; height: 16px; color: var(--saffron); }

/* ---- Quick search ------------------------------------------------------ */
.qs-results { display: grid; gap: 4px; margin-top: 14px; }
.qs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  transition: background 0.12s;
}
.qs-item:hover, .qs-item.is-active { background: var(--surface); box-shadow: var(--shadow-1); }
.qs-thumb { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; position: relative; flex: none; background: var(--paper-2); }
.qs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qs-thumb .cover__mono { font-size: 13px; padding: 0; }
.qs-item b { display: block; font-weight: 650; line-height: 1.3; }
.qs-item small { color: var(--muted); font-size: 13px; }
.qs-item mark { background: var(--saffron-50); color: inherit; border-radius: 3px; padding: 0 1px; }
.footer__grid > * { min-width: 0; }

/* v2 header extras */
.saved-trigger { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); transition: border-color 0.15s, color 0.15s, transform 0.2s var(--spring); flex: none; }
.saved-trigger:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.saved-trigger[aria-current='page'] { border-color: var(--brand); color: var(--brand); }
.saved-trigger .count-pill { position: absolute; top: -5px; right: -5px; }
.brand__name { font-weight: 800; letter-spacing: -0.04em; }
.brand__mark { border-radius: 13px 13px 6px 6px; }
.nav a { font-weight: 600; }
.search-trigger { border-width: 1.5px; }
.footer { background-color: var(--ink); }

/* ---- Grantim brand mark (v3) ------------------------------------------ */
.brand { gap: 11px; }
.brand__mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.18), 0 8px 18px -10px rgb(43 89 255 / 0.9);
  transition: transform 0.35s var(--spring);
}
.brand__mark .ic { width: 32px; height: 32px; }
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.05); }
.brand__name { font-size: 25px; font-weight: 800; letter-spacing: -0.045em; color: var(--ink); }
.brand__name i { font-style: normal; color: var(--brand); }
.footer .brand__mark, .adm-side .brand__mark, .login__card .brand__mark { background: var(--brand); color: inherit; }
.footer .brand__name i, .adm-side .brand__name i { color: var(--sun); }
@media (max-width: 380px) { .brand__name { font-size: 22px; } .brand__mark { width: 40px; height: 40px; } .brand__mark .ic { width: 29px; height: 29px; } }

/* ---- Language switch + tighter header for longer (Russian) labels ------------ */
.lang-switch {
  display: inline-flex; align-items: center; gap: 5px; height: 42px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font: 750 13px var(--font-ui); letter-spacing: 0.02em; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.lang-switch:hover { border-color: var(--ink-2); color: var(--ink); }
.lang-switch .ic { width: 18px; height: 18px; }
.nav a, .header__cta { white-space: nowrap; }
@media (min-width: 900px) and (max-width: 1239px) {
  .nav { margin-left: 6px; }
  .nav a { padding: 0 10px; font-size: 14px; }
  .header__cta { display: none; }
}
@media (max-width: 420px) {
  .lang-switch { padding: 0 9px; }
  .lang-switch .ic { display: none; }
}
.search-trigger .label-long { white-space: nowrap; }
@media (min-width: 1100px) and (max-width: 1359px) {
  .search-trigger { width: 44px; padding: 0; justify-content: center; }
  .search-trigger .label-long, .search-trigger kbd { display: none; }
}
@media (max-width: 360px) {
  .header__actions { gap: 5px; }
  .lang-switch { height: 40px; padding: 0 8px; }
  .search-trigger, .saved-trigger { width: 40px; height: 40px; }
}

/* ---- Footer: "Biz haqimizda" + founders ----------------------------------- */
@media (min-width: 760px) and (max-width: 1023px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer__grid { grid-template-columns: 1.3fr 0.9fr 1fr 1.3fr; } }
.footer__about .footer__note { margin-top: 0; }
.footer__team-title { margin: 16px 0 10px; font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: #9fb0cf; }
.footer__team { display: grid; gap: 10px; }
.footer__team a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: rgb(255 255 255 / 0.06); border: 1px solid rgb(255 255 255 / 0.08); text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s;
}
.footer__team a:hover { background: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.18); }
.footer__team .ic { width: 20px; height: 20px; flex-shrink: 0; color: #4fc3f7; }
.footer__team span { display: grid; min-width: 0; line-height: 1.25; }
.footer__team b { color: #fff; font-size: 14.5px; font-weight: 700; }
.footer__team small { color: #9fb0cf; font-size: 13px; overflow-wrap: anywhere; }
#biz-haqimizda { scroll-margin-top: calc(var(--header-h, 64px) + 16px); }

/* Telegram channel: header icon + home band (shown only when Admin → Sozlamalar has the channel link) */
.tg-link[hidden] { display: none; }
.tg-link { color: #229ed9; }
.tg-band { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r-xl, 20px); text-decoration: none; color: inherit;
  background: linear-gradient(135deg, #e8f6fd, #f4fbff); border: 1px solid #c9e9f8; }
.tg-band:hover { border-color: #229ed9; }
.tg-band__ic { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #229ed9; color: #fff; display: grid; place-items: center; }
.tg-band__ic .ic { width: 22px; height: 22px; }
.tg-band__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tg-band__txt small { color: var(--muted); font-size: 13.5px; }
.tg-band__btn { flex: none; background: #229ed9; color: #fff; border-color: #229ed9; }
@media (max-width: 520px) { .tg-band__btn { display: none; } }
@media (max-width: 359px) { .tg-link { display: none; } }

/* Admin → Bot boshqaruvi: file drop zone */
.dropzone { display: block; border: 2px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer; background: var(--bg); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-over { border-color: var(--brand); background: var(--brand-50); outline: none; }
.dropzone #dz-file { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.dropzone #dz-file[hidden] { display: none; }
.dz-bar { flex-basis: 100%; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.dz-bar span { display: block; height: 100%; background: var(--brand); transition: width .2s; }
