/* =========================================================
   Hammasi birda — yagona uslublar fayli
   1. Asos  2. Yuqori panel  3. Qidiruv  4. Sahifa sarlavhasi
   5. Filtrlar  6. Postlar  7. Lightbox  8. Info sahifasi
   9. Planshet va telefon
   ========================================================= */

/* ---------- 1. Asos ---------- */
:root {
  --bg: #f3f3f2;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #70757d;
  --line: rgba(17, 24, 39, 0.12);
  --soft: #f8f8f7;
  --shadow: rgba(15, 23, 42, 0.05);
  --accent: #0a66ff;
  --accent-soft: rgba(10, 102, 255, 0.08);
  --sans: "Asap", "Segoe UI", Roboto, Arial, sans-serif;
  --serif: var(--sans);
  --header-h: 72px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-text-size-adjust: 100%;
}
html::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  padding-top: var(--header-h);
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 var(--sans);
}

a { color: var(--ink); text-decoration: none; }
a:hover { opacity: 0.8; }
button { font-family: inherit; }
::selection { background: var(--ink); color: #fff; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
}

/* ---------- 2. Yuqori panel ---------- */
.masthead {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(17, 17, 17, 0.02);
}

.masthead-top {
  position: relative;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-name {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ink);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex: 1;
}

.main-nav a {
  position: relative;
  color: #2b2f35;
  font-size: 1.08rem;
  font-weight: 500;
  padding: 10px 0;
  white-space: nowrap;
}

.main-nav a.active {
  color: var(--accent);
  font-weight: 700;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 180px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Undov (!) tugmasi: dasturchi haqida */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: #384456;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.info-btn:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
.info-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 3. Qidiruv ---------- */
.header-search { position: relative; }

.search-toggle,
.result-nav,
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: #384456;
  cursor: pointer;
}

.search-toggle { position: relative; }
.search-toggle:hover { border-color: var(--accent); color: var(--accent); }
.search-toggle::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-2px, -2px);
}
.search-toggle::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  top: 24px;
  left: 22px;
  transform: rotate(45deg);
  background: currentColor;
}

.header-search-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px 34px;
  grid-template-rows: auto auto;
  width: min(520px, calc(100vw - 24px));
  min-height: 54px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(20, 30, 45, 0.16);
}

.header-search-panel[hidden] { display: none; }
.search-clear[hidden] { display: none; }
.header-search-panel input {
  grid-row: 1;
  grid-column: 1 / -1;
  min-width: 80px;
  height: 38px;
  padding: 0 3px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 0.95rem/1.3 var(--sans);
}
.search-count { grid-row: 2; grid-column: 1; min-width: 0; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.result-nav, .search-clear { width: 34px; height: 34px; font-size: 1.1rem; }
#result-prev { grid-row: 2; grid-column: 2; }
#result-next { grid-row: 2; grid-column: 3; }
#clear { grid-row: 2; grid-column: 4; }
.result-nav:disabled { cursor: default; opacity: 0.35; }
.search-clear { border: 0; font-size: 1.35rem; }

/* ---------- 4. Sahifa sarlavhasi ---------- */

/* Kanal avatarlari (tanlagich, post sarlavhasi, joriy kanal) */
.channel-avatar,
.all-channels-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.channel-avatar { display: block; object-fit: cover; background: var(--soft); }
.channel-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}
.all-channels-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--accent);
  font-size: 1.1rem;
}
.channel-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
  text-align: left;
}
.channel-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 600;
}
.channel-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- 5. Filtrlar ---------- */
.toolbar { margin: 16px 0 20px; }
.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}


.filters input[type="number"] {
  width: 150px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 0.92rem/1 var(--sans);
  -moz-appearance: textfield;
}
.filters input[type="number"]::-webkit-outer-spin-button,
.filters input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.filters input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 102, 255, 0.1);
}
#order {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.9rem/1 var(--sans);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
#order:hover { background: var(--ink); color: #fff; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chips:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: #2b2f35;
  font: 500 0.85rem/1.2 var(--sans);
}
.chip b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.chip b:hover { background: var(--ink); color: #fff; }

.newbar {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  z-index: 10;
  display: block;
  margin: 0 auto 16px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 600 0.9rem/1 var(--sans);
  box-shadow: 0 8px 22px rgba(10, 102, 255, 0.32);
  cursor: pointer;
}
.newbar[hidden] { display: none; }

/* ---------- 6. Postlar ---------- */
#feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  --feed-gap: 18px;
  column-gap: var(--feed-gap);
  row-gap: 0;
  grid-auto-rows: 1px;   /* masonry: har bir post balandligiga qarab qator egallaydi (JS) */
  align-items: start;
}

.post[hidden] { display: none !important; }
.post {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 2px 10px var(--shadow);
  transition: box-shadow 0.2s;
}
.post:hover { box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); }
.post.search-result-current { outline: 2px solid var(--accent); outline-offset: 2px; }

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}
.post-head .src {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;      /* kanal nomi kerakli joyni to'liq egallaydi */
  min-width: 0;
}
.post-head .channel-identity { flex: 1 1 auto; min-width: 0; }
.when {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
  text-align: right;
}
.when strong { font-size: 0.8rem; font-weight: 600; color: #3d434b; }
.when strong, .when small { white-space: nowrap; }
.when small { color: var(--muted); font-size: 0.72rem; }

.meta-line { padding: 0 16px 8px; color: var(--muted); font-size: 0.8rem; }

/* Post matni */
.body {
  padding: 0 16px 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.body a { color: var(--accent); }
.body a:hover { opacity: 1; text-decoration: underline; }
.body code,
.body pre {
  border-radius: 6px;
  background: var(--soft);
  font: 0.88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.body code { padding: 1px 5px; }
.body pre { margin: 6px 0; padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; }
.body pre code { padding: 0; background: transparent; }
.body blockquote {
  margin: 6px 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--accent);
  color: #3d434b;
}
tg-spoiler {
  border-radius: 4px;
  background: #cfd3da;
  color: transparent;
  cursor: pointer;
  user-select: none;
}
tg-spoiler.open { background: transparent; color: inherit; user-select: auto; }

/* Media */
.media { position: relative; margin: 0 0 12px; }
.media video, .media img { display: block; }
.m-single img,
.m-single video {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  background: #000;
}
.m-single img { cursor: zoom-in; background: var(--soft); }
.m-single video { object-fit: contain; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.m-grid.many { grid-template-columns: repeat(3, 1fr); }
.m-cell { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--soft); }
.m-grid.n3 .m-cell:first-child { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.m-cell img,
.m-cell video { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.m-cell video { cursor: default; }
.m-single, .m-cell { position: relative; }
.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none;
}
.m-big { position: relative; }
.m-big img { width: 100%; max-height: 420px; object-fit: cover; }
.m-big .over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.m-big.nothumb {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  background: var(--soft);
}
.m-big.nothumb a { color: var(--accent); font-weight: 600; }

.m-round, .m-sticker, .kv, .m-audio, .m-doc, .poll, .wp { margin-left: 16px; margin-right: 16px; }
.m-round video { width: 240px; max-width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; object-fit: cover; background: #000; }
.m-sticker img, .m-sticker video { max-width: 180px; height: auto; }
.kv {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 0.88rem;
}
.kv a { color: var(--accent); }
.m-audio {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.m-audio .t { font-size: 0.92rem; font-weight: 600; }
.m-audio .p { margin-bottom: 6px; color: var(--muted); font-size: 0.78rem; }
.m-audio audio { width: 100%; }
.m-audio a { color: var(--accent); font-size: 0.88rem; }
.m-doc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.m-doc .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.m-doc .n { font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.m-doc .s { color: var(--muted); font-size: 0.78rem; }

.poll {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.poll h4 { margin: 0 0 8px; font-size: 0.95rem; }
.poll .opt {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0;
  padding: 8px 10px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
  font-size: 0.88rem;
}
.poll .opt i {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(10, 102, 255, 0.15);
}
.poll .opt span { position: relative; }
.poll small { color: var(--muted); }

.wp {
  display: block;
  margin-bottom: 12px;
  padding: 12px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--soft);
}
.wp .site { color: var(--accent); font-size: 0.78rem; font-weight: 600; }
.wp .ttl { font-size: 0.92rem; font-weight: 600; line-height: 1.35; }
.wp .dsc { color: #3d434b; font-size: 0.85rem; line-height: 1.45; }
.wp img { width: 100%; max-height: 260px; margin-top: 8px; border-radius: 8px; object-fit: cover; }

/* Post pastki qatori */
.post-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}
.telegram-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.re {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  font-size: 0.8rem;
}
.go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #fff1a8;
  color: inherit;
}

.status {
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.status:empty { display: none; }
#sentinel { height: 1px; }

/* ---------- 7. Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}
.lightbox[hidden] { display: none; }
.lb-body {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 90vh;
}
.lb-body img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}
.lb-close, .lb-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.28); }
.lb-close { top: 16px; right: 16px; width: 44px; height: 44px; font-size: 1.8rem; }
.lb-nav { top: 50%; width: 48px; height: 48px; margin-top: -24px; font-size: 2rem; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* ---------- 8. Info sahifasi ---------- */
.info-page { max-width: 960px; padding-top: 28px; }

.info-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 40px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.22), transparent 42%),
    radial-gradient(circle at 10% 110%, rgba(255, 209, 102, 0.35), transparent 40%),
    linear-gradient(135deg, #0a58e6 0%, #0a66ff 55%, #4d8dff 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(10, 102, 255, 0.25);
}
.info-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font: 700 3.4rem/1 var(--sans);
  backdrop-filter: blur(6px);
}
.info-hero-text { min-width: 0; }
.info-badge {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.info-hero h1 {
  margin: 10px 0 6px;
  font: 700 3rem/1.1 var(--sans);
  letter-spacing: -0.01em;
}
.info-lead { margin: 0 0 20px; max-width: 520px; font-size: 1.05rem; line-height: 1.55; opacity: 0.92; }
.info-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 0.95rem/1 var(--sans);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { opacity: 1; transform: translateY(-1px); }
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-light { background: #fff; color: var(--accent); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.22); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(10, 102, 255, 0.3); }

.info-section { margin-top: 36px; }
.info-section h2,
.info-cta h2 {
  margin: 0 0 14px;
  font: 700 1.9rem/1.2 var(--sans);
}
.info-text { max-width: 680px; margin: 0 0 18px; color: #3d434b; }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 2px 10px var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.contact-card:hover { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1); transform: translateY(-2px); }
.contact-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.contact-main:hover { opacity: 1; }
.contact-ico,
.info-card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.contact-ico svg,
.info-card-ico svg,
.copy-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.contact-text small { color: var(--muted); font-size: 0.78rem; }
.contact-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.98rem; font-weight: 600; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
}
.copy-btn svg { width: 18px; height: 18px; }
.copy-btn:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }

.info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 2px 10px var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.info-card:hover { opacity: 1; border-color: var(--accent); box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1); transform: translateY(-2px); }
.info-card-ico { margin-bottom: 8px; }
.info-card strong { font-size: 1.05rem; }
.info-card small { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }


.info-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 2px 10px var(--shadow);
}
.info-cta h2 { margin-bottom: 6px; }
.info-cta p { margin: 0; color: var(--muted); }
.info-cta .btn { flex: 0 0 auto; }

.info-back { margin: 28px 0 0; text-align: center; font-size: 0.92rem; }
.info-back a { color: var(--accent); font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  transform: translateX(-50%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}
.toast[hidden] { display: none; }

/* ---------- 9. Planshet ---------- */
@media (max-width: 1000px) {
  .brand-wrap, .header-actions { min-width: 0; }
  .main-nav { gap: 20px; }
  .contact-grid,
  .info-cards { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  #feed { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ---------- Telefon ---------- */
@media (max-width: 720px) {
  :root { --header-h: 108px; }
  body { font-size: 15px; }

  /* Yuqori panel ikki qatorga bo'linadi: 1) logo va tugmalar, 2) bo'limlar */
  .masthead-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "nav nav";
    align-content: center;
    gap: 8px 10px;
    width: calc(100% - 24px);
    height: var(--header-h);
  }
  .brand-wrap { grid-area: brand; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 1.25rem; white-space: nowrap; }
  .header-actions { grid-area: actions; }
  .main-nav {
    grid-area: nav;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a {
    padding: 7px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--soft);
    font-size: 0.92rem;
    line-height: 1.4;
  }
  .main-nav a.active { border-color: var(--accent); background: var(--accent); color: #fff; }
  .main-nav a.active::after { display: none; }

  /* Qidiruv paneli butun panel kengligida ochiladi */
  .header-search { position: static; }
  .header-search-panel { top: calc(100% + 6px); left: 0; right: 0; width: auto; }

  .page-shell { width: calc(100% - 24px); }

  .filters { gap: 8px; }
  .filters input[type="number"] { flex: 1 1 calc(50% - 4px); width: auto; min-width: 0; }
  #order { width: 100%; }

  #feed { grid-template-columns: 1fr; --feed-gap: 14px; }
  .post-head { padding: 12px 14px 8px; }
  .when small { display: none; }
  .meta-line, .body { padding-left: 14px; padding-right: 14px; }
  .post-foot { padding: 10px 14px 12px; }
  .m-round, .m-sticker, .kv, .m-audio, .m-doc, .poll, .wp { margin-left: 14px; margin-right: 14px; }
  .m-single img, .m-single video { max-height: 440px; }

  .lb-nav { width: 40px; height: 40px; margin-top: -20px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }

  /* Info sahifasi */
  .info-page { padding-top: 16px; }
  .info-hero { flex-direction: column; align-items: flex-start; gap: 18px; padding: 28px 22px; border-radius: 20px; }
  .info-avatar { width: 84px; height: 84px; font-size: 2.4rem; }
  .info-hero h1 { font-size: 2.3rem; }
  .info-actions { width: 100%; }
  .info-actions .btn { flex: 1 1 100%; }
  .info-section { margin-top: 28px; }
  .info-section h2, .info-cta h2 { font-size: 1.6rem; }
  .info-cta { flex-direction: column; align-items: stretch; padding: 22px 20px; text-align: left; }
  .toast { bottom: 20px; }
}

@media (max-width: 380px) {
  .brand-name { font-size: 1.1rem; }
  .main-nav a { padding: 7px 13px; font-size: 0.88rem; }
}

/* Harakatni kamaytirishni xohlaydiganlar uchun */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Kanallar ro'yxati (filtr tepasida) ---------- */
.channel-bar { margin-bottom: 14px; }
.channel-bar[hidden] { display: none; }
.channel-bar-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.channel-bar-title { font-weight: 700; font-size: 1rem; }
.channel-bar-count { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.channel-list { display: flex; flex-wrap: wrap; gap: 8px; }
.channel-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 6px 14px 6px 6px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.channel-pill .channel-avatar { width: 34px; height: 34px; transition: filter 0.15s, opacity 0.15s; }
.channel-pill { min-width: 0; }
.channel-pill .channel-identity { min-width: 0; }
.channel-pill:hover { border-color: rgba(10, 102, 255, 0.45); }
.channel-pill:active { transform: scale(0.97); }
.channel-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.channel-pill[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 1px 6px rgba(10, 102, 255, 0.14);
}
.channel-pill[aria-pressed="true"] .channel-identity strong { color: var(--accent); }
.channel-pill[aria-pressed="false"] { background: var(--soft); }
.channel-pill[aria-pressed="false"] .channel-avatar { filter: grayscale(1); opacity: 0.55; }
.channel-pill[aria-pressed="false"] .channel-identity { opacity: 0.6; }
.channel-pill .pill-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}
.channel-pill[aria-pressed="false"] .pill-check { display: none; }
.channel-pill.shake { animation: pill-shake 0.35s; }
@keyframes pill-shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (max-width: 720px) {
  .channel-list { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 2px 12px 6px; scrollbar-width: none; }
  .channel-list::-webkit-scrollbar { display: none; }
  .channel-pill { flex: 0 0 auto; max-width: 86vw; }
}

/* ---------- Reklama banneri ---------- */
.ad-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 18px 18px;
  border: 1.5px dashed rgba(10, 102, 255, 0.4);
  border-radius: 14px;
  background: var(--accent-soft);
}
.ad-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ad-title { color: var(--accent); font-size: 1.25rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.ad-text { color: #3d434b; font-size: 0.9rem; font-weight: 500; line-height: 1.3; }
.ad-link {
  flex: 0 0 auto;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- Rasm yuklanishi: xira fon + indikator ---------- */
.ph-loading { position: relative; overflow: hidden; background: var(--soft); }
.m-single.ph-loading { min-height: 260px; }
.ph-loading::before {
  content: "";
  position: absolute;
  inset: -20px;
  background:
    var(--ph, none) center / cover no-repeat,
    linear-gradient(110deg, #e6e8ec 30%, #f4f5f7 50%, #e6e8ec 70%);
  background-size: cover, 200% 100%;
  filter: blur(16px);
  animation: ph-shimmer 1.4s linear infinite;
}
.ph-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 3.5px solid rgba(255, 255, 255, 0.85);
  border-top-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.35);
  animation: ph-spin 0.8s linear infinite;
}
.ph-loading img { position: relative; z-index: 1; opacity: 0; }
.media img { transition: opacity 0.35s; }
@keyframes ph-spin { to { transform: rotate(360deg); } }
@keyframes ph-shimmer { to { background-position: center, -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ph-loading::before { animation: none; } }

/* ---------- Info: Logs paneli ---------- */
.logs-wrap { margin: 28px 0 8px; text-align: center; }
.logs-btn {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 0.72rem/1.6 var(--sans);
  cursor: pointer;
  opacity: 0.7;
}
.logs-btn:hover, .logs-btn[aria-expanded="true"] { opacity: 1; color: var(--ink); background: var(--paper); }
.logs-panel { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); text-align: left; }
.logs-panel[hidden] { display: none; }
.logs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.logs-actions button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font: 600 0.8rem/1 var(--sans);
  cursor: pointer;
}
.logs-actions #logs-copy { background: var(--accent); border-color: var(--accent); color: #fff; }
.logs-msg { margin: 8px 2px; color: var(--muted); font-size: 0.78rem; }
.logs-box {
  max-height: 320px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 10px;
  background: #101418;
  color: #d6dde6;
  font: 0.72rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
