/* EVENTS CALENDAR — Mini App. Utilita uslubi (referens: Apple Calendar oy ko'rinishi + Telegram UI).
   TO'G'RI BURCHAK hamma joyda (Shaxzod 09-20) — border-radius yo'q. Ranglar Telegram mavzusidan
   (telegram-web-app.js :root ga --tg-theme-* qo'yadi), Telegramsiz — prefers-color-scheme.
   Maydon 16px (iOS zoom qilmasin), bosiladigan joylar ≥44px. */
:root {
  --fon: var(--tg-theme-bg-color, #ffffff);
  --fon2: var(--tg-theme-secondary-bg-color, #f3f4f6);
  --matn: var(--tg-theme-text-color, #111827);
  --matn2: var(--tg-theme-hint-color, #6b7280);
  /* Zaxira ko'k #1c6fc4 — oq matn bilan 5.1:1 (qorovul). Telegram ichida mavzuning o'z tugma rangi ishlatiladi. */
  --asosiy: var(--tg-theme-button-color, #1c6fc4);
  --asosiy-matn: var(--tg-theme-button-text-color, #ffffff);
  --chiziq: rgba(128,128,128,.28);
  --xato: #e5484d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fon: var(--tg-theme-bg-color, #17212b);
    --fon2: var(--tg-theme-secondary-bg-color, #232e3c);
    --matn: var(--tg-theme-text-color, #f5f5f5);
    --matn2: var(--tg-theme-hint-color, #8e9aa6);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; border-radius: 0; }
html, body { margin: 0; background: var(--fon); color: var(--matn); font: 16px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { padding: 0 16px calc(16px + env(safe-area-inset-bottom)); touch-action: manipulation; max-width: 560px; margin: 0 auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Sarlavha: ‹ Sentyabr 2026 › */
.bosh { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.ikon { width: 44px; height: 44px; border: 0; background: transparent; color: var(--asosiy); font-size: 30px; line-height: 1; font-weight: 300; }
.oy-nomi { flex: 1; height: 44px; border: 0; background: transparent; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.ikon:active, .oy-nomi:active { opacity: .6; }

/* To'r: faqat gorizontal ingichka chiziqlar (Apple Calendar) */
.hafta-nomlari, .tor { display: grid; grid-template-columns: repeat(7, 1fr); }
.hafta-nomlari span { text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--matn2); padding: 4px 0 6px; }
.hafta-nomlari span:nth-child(n+6) { color: var(--matn2); opacity: .6; }
.tor { border-top: 1px solid var(--chiziq); }
.kun { position: relative; height: 58px; border: 0; border-bottom: 1px solid var(--chiziq); background: transparent; padding: 5px 3px 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.kun .raqam { width: 28px; height: 28px; line-height: 28px; text-align: center; font-size: 16px; font-variant-numeric: tabular-nums; }
.kun.boshqa-oy .raqam { opacity: .3; }
.kun.otgan .raqam { opacity: .5; }
.kun.bugun .raqam { background: var(--asosiy); color: var(--asosiy-matn); font-weight: 700; font-size: 17px; opacity: 1; }
.kun.tanlangan { box-shadow: inset 0 0 0 2px var(--asosiy); }
.kun.tanlangan.bugun .raqam { outline: 2px solid var(--fon); outline-offset: -2px; }
.kun .chiziqlar { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.kun .chiziq { height: 4px; width: 100%; }

/* Tanlangan kun ro'yxati */
.kun-paneli { margin-top: 14px; }
.kun-sarlavha { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.kun-sarlavha h2 { font-size: 17px; margin: 0; font-weight: 700; }
.qosh { width: 44px; height: 44px; border: 0; background: var(--asosiy); color: var(--asosiy-matn); font-size: 26px; line-height: 1; }
.qosh:active { opacity: .7; }
.royxat { list-style: none; margin: 4px 0 0; padding: 0; }
.royxat li { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--chiziq); }
.royxat .rang { width: 4px; align-self: stretch; margin: 8px 0; flex: none; }
.royxat .vaqt { width: 82px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--matn); }
.royxat .vaqt.yoq { color: var(--matn2); font-weight: 400; }
.royxat .mazmun { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.royxat .kim { font-size: 12px; color: var(--matn2); }
.royxat .bosh-qator { color: var(--matn2); padding: 12px 0; min-height: 0; border: 0; }
.ochir { width: 44px; height: 44px; border: 0; background: transparent; color: var(--matn2); font-size: 22px; flex: none; }
.ochir.tasdiq { background: var(--xato); color: #fff; font-size: 14px; font-weight: 700; width: auto; padding: 0 12px; }

.legenda { display: flex; gap: 16px; margin: 14px 0 0; font-size: 12px; color: var(--matn2); }
.legenda i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.bosh-ekran { margin-top: 14px; width: 100%; height: 44px; border: 1px solid var(--chiziq); background: transparent; color: var(--matn2); font-size: 14px; }

.tugma { height: 46px; padding: 0 16px; border: 0; background: var(--fon2); font-weight: 600; }
.tugma.asosiy { background: var(--asosiy); color: var(--asosiy-matn); }
.tugma:active { opacity: .75; }
.tugma:disabled { opacity: .5; }

.xabar { position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); background: var(--matn); color: var(--fon); padding: 12px 16px; text-align: center; z-index: 30; font-size: 15px; }
.holat { text-align: center; padding: 32px 8px; color: var(--matn2); }
.holat .tugma { margin-top: 8px; }

/* Forma: pastdan chiqadigan varaq — bitta maydon */
.parda { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.varaq { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--fon); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; border-top: 1px solid var(--chiziq); }
.varaq h2 { font-size: 17px; margin: 0 0 12px; font-weight: 700; }
.maydon { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--chiziq); background: var(--fon2); font-size: 16px; }
.maydon:focus { outline: none; border-color: var(--asosiy); }
.xato-matn { color: var(--xato); font-size: 14px; margin: 8px 0 0; }
.tugmalar { display: flex; gap: 10px; margin-top: 12px; }
.tugmalar .tugma { flex: 1; }

/* Tor telefon (≤340px): chekka 6px — kun katagi 44px dan tor bo'lmasin (qorovul: 320px da 41px edi). */
@media (max-width: 340px) { body { padding-left: 6px; padding-right: 6px; } }
