/* ============================================================
   PARVOZ DAVOMAT — ilova dizayn tizimi
   ============================================================ */
:root {
  color-scheme: dark;

  --bg:        #070e20;
  --logo-url:  url(logo-dark.webp);
  --surface:   rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.08);
  --border:    rgba(255,255,255,.1);
  --border-2:  rgba(255,255,255,.2);
  --text:      #eef4ff;
  --muted:     #a4b6d6;
  --faint:     #8d9dba;

  --gold:  #ffb300;
  --gold2: #ffd54f;
  --sky:   #38a8ff;
  --teal:  #22d3ee;
  --violet:#a78bfa;
  --green: #34d399;
  --rose:  #fb7185;
  --red:   #f87171;

  --gold-ink:   #ffc233;
  --sky-ink:    #7cc6ff;
  --green-ink:  #4ade80;
  --red-ink:    #fca5a5;
  --violet-ink: #c4b5fd;

  /* Diagramma bo'laklari — holat tokenlaridan alohida pog'ona: ustunda qizil
     yashilga tegib turadi, shuning uchun uchala juftlik ham deyteranopiya
     simulyatsiyasida ΔE ≥ 9 bo'lishi va sirtga nisbatan ≥ 3:1 bo'lishi tekshirilgan. */
  --viz-in:      #26ad75;
  --viz-excused: #9c7cea;
  --viz-absent:  #c2454d;

  --nav-bg:   rgba(9,17,38,.92);
  --sheet-bg: #0c1630;
  --on-gold:  #14161c;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --shadow: 0 18px 46px -22px rgba(0,0,0,.7);

  --side-w: 248px;
  --bar-h:  64px;
  --tabbar-h: 66px;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg:        #f2f6fd;
  --surface:   rgba(255,255,255,.85);
  --surface-2: #ffffff;
  --border:    rgba(13,27,62,.12);
  --border-2:  rgba(13,27,62,.24);
  --text:      #0b1936;
  --muted:     #4c5e80;
  --faint:     #5a6a88;

  --sky:   #1a7fd4;
  --teal:  #0d9aae;
  --violet:#7c4ddb;
  --green: #12a06c;
  --rose:  #e0526a;
  --red:   #d64545;

  --gold-ink:   #8a5c00;
  --sky-ink:    #125fa8;
  --green-ink:  #0a6e48;
  --red-ink:    #b02a2a;
  --violet-ink: #5b2fb8;

  --viz-in:      #12a06c;
  --viz-excused: #7c4ddb;
  --viz-absent:  #c03033;

  --logo-url: url(logo.webp);
  --nav-bg:   rgba(255,255,255,.92);
  --sheet-bg: #ffffff;
  --shadow: 0 16px 40px -24px rgba(13,27,62,.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  background-image:
    radial-gradient(ellipse 70% 40% at 12% 0%, color-mix(in srgb, var(--sky) 11%, transparent) 0%, transparent 62%),
    radial-gradient(ellipse 55% 35% at 92% 100%, color-mix(in srgb, var(--gold) 9%, transparent) 0%, transparent 62%);
  background-attachment: fixed;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--sky-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ===================== FORMS ===================== */
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; font-size: .76rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 6px;
}
.inp {
  width: 100%; padding: 13px 14px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border-2);
  color: var(--text); transition: border-color .15s;
  min-height: 48px;
}
.inp::placeholder { color: var(--faint); }
.inp:focus { border-color: var(--gold); outline: none; }
select.inp {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 13px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}
/* Native ro'yxat ranglari (qorong'i rejimda ham o'qiladi) */
select.inp option, select.inp optgroup { background: var(--sheet-bg); color: var(--text); }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--r-sm);
  font-weight: 800; font-size: .95rem; min-height: 46px;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text);
  transition: transform .12s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: linear-gradient(135deg, #ffb300, #ffd54f); color: var(--on-gold); border-color: transparent; }
.btn-green   { background: linear-gradient(135deg, #10b981, #34d399); color: #052e1f; border-color: transparent; }
.btn-danger  { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red-ink); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.btn-ghost   { background: transparent; }
.btn-sm { padding: 8px 12px; min-height: 38px; font-size: .86rem; border-radius: 9px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-icon { padding: 0; width: 42px; height: 42px; min-height: 42px; border-radius: 50%; }
.btn-block { width: 100%; }

/* ===================== APP SHELL ===================== */
.app { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--side-w); flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh; padding: 18px 14px;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.side-brand .logo { width: 34px; aspect-ratio: 447/559; background: var(--logo-url) center/contain no-repeat; flex-shrink: 0; }
.side-brand b { font-size: 1.02rem; font-weight: 900; letter-spacing: .01em; }
.side-brand small { display: block; font-size: .7rem; color: var(--faint); font-weight: 700; }

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-weight: 700; font-size: .95rem;
  width: 100%; text-align: left; transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, #ffb300, #ffd54f); color: var(--on-gold); }


/* Mobil yuqori panel */
/* Sahifa sarlavhasi: chapda bo'lim nomi, o'ngda til / rejim / hisob */
.topbar {
  display: flex; position: sticky; top: 0; z-index: 40;
  height: var(--bar-h); align-items: center; gap: 10px; padding: 0 20px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .logo { display: none; width: 28px; aspect-ratio: 447/559; background: var(--logo-url) center/contain no-repeat; flex-shrink: 0; }
.topbar h1 {
  font-size: 1.2rem; font-weight: 900; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Sarlavhadagi tugmalar */
.tb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 11px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-weight: 800; font-size: .82rem;
  transition: background .15s, color .15s, border-color .15s;
}
.tb-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.tb-btn svg { width: 18px; height: 18px; }
.tb-btn .tb-ico { display: inline-flex; }
.tb-btn .tb-code { letter-spacing: .04em; }
.tb-icon { width: 40px; padding: 0; }
.tb-avatar { width: 40px; padding: 0; }
.tb-avatar .avatar { width: 30px; height: 30px; font-size: .72rem; }

/* Ochiladigan menyular */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 210px; padding: 6px;
  background: var(--sheet-bg); border: 1px solid var(--border-2);
  border-radius: var(--r); box-shadow: var(--shadow);
  animation: menuIn .13s ease-out;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } }
.menu[hidden] { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 11px; border-radius: var(--r-sm);
  color: var(--text); font-weight: 700; font-size: .9rem; text-align: left;
}
.menu-item span { flex: 1; min-width: 0; }
.menu-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.menu-item:hover { background: var(--surface); }
.menu-item.on { color: var(--gold-ink); }
.menu-item.on svg { color: var(--gold-ink); }
.menu-item.danger { color: var(--red-ink); }
.menu-item.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }

.menu-user { min-width: 240px; }
.menu-head { display: flex; align-items: center; gap: 11px; padding: 10px 11px 8px; }
.menu-head .avatar { width: 38px; height: 38px; font-size: .82rem; flex-shrink: 0; }
.menu-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.menu-who b { font-weight: 900; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-who small { font-size: .74rem; color: var(--faint); font-weight: 700; }
.menu-mail {
  padding: 0 11px 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: .78rem; color: var(--faint); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Mobil pastki navigatsiya */
.tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar-inner { display: flex; height: var(--tabbar-h); }
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: .68rem; font-weight: 800;
  transition: color .15s;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--gold-ink); }

.main { flex: 1; min-width: 0; }
.page { max-width: 1060px; margin: 0 auto; padding: 24px 20px 40px; }

.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { display: none; }
.page-head p { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.page-head .spacer { flex: 1; }

/* ===================== CARDS ===================== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 1rem; font-weight: 900; }
.card-head .spacer { flex: 1; }
.card-desc { color: var(--muted); font-size: .88rem; margin-bottom: 14px; }

/* ===================== CHIPS / BADGES ===================== */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 8px 14px; border-radius: 99px; min-height: 38px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-weight: 800; font-size: .86rem;
  transition: background .15s, color .15s, border-color .15s;
}
.chip.on {
  background: color-mix(in srgb, var(--acc, var(--sky)) 16%, transparent);
  border-color: color-mix(in srgb, var(--acc, var(--sky)) 45%, transparent);
  color: var(--text);
}
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap;
}
/* Uzun izohli yorliq ("Hech kim ulanmagan — ...") telefonda qatorga o'raladi,
   aks holda Sozlamalar sahifasi yon tomonga siljib qolardi */
.row-sub .badge { white-space: normal; max-width: 100%; border-radius: 12px; line-height: 1.35; }
.badge-course { background: color-mix(in srgb, var(--acc, var(--sky)) 14%, transparent); border-color: color-mix(in srgb, var(--acc, var(--sky)) 35%, transparent); color: var(--text); }
.badge-ok { background: color-mix(in srgb, var(--green) 15%, transparent); border-color: color-mix(in srgb, var(--green) 38%, transparent); color: var(--green-ink); }
.badge-warn { background: color-mix(in srgb, var(--gold) 14%, transparent); border-color: color-mix(in srgb, var(--gold) 38%, transparent); color: var(--gold-ink); }
.badge-admin { background: color-mix(in srgb, var(--violet) 16%, transparent); border-color: color-mix(in srgb, var(--violet) 40%, transparent); color: var(--text); }

/* Kurs belgisidagi bayroq: 🇬🇧 emojisi o'rniga SVG (Windows'da emoji "GB" harflari bo'lib chiqadi) */
.flag {
  display: inline-block; width: 1.5em; height: .75em; flex-shrink: 0;
  border-radius: 2px; vertical-align: -.06em;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .18);
}
.field > .ic-field {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font: inherit; letter-spacing: normal; text-transform: none; color: var(--text);
}
.ic-field .inp { flex: 1; min-width: 0; }
.ic-prev {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  background: var(--surface); border: 1px solid var(--border);
}

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .95rem; color: #08131f;
  background: linear-gradient(135deg, var(--acc, var(--sky)), color-mix(in srgb, var(--acc, var(--sky)) 55%, #fff));
}

/* ===================== STATS ===================== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 12px; text-align: center;
}
.stat b { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1.15; }
.stat span { color: var(--muted); font-size: .76rem; font-weight: 800; }

/* ===================== LIST ROWS ===================== */
.rows { display: flex; flex-direction: column; gap: 9px; }
.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 14px;
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 800; font-size: .98rem; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-sub { color: var(--muted); font-size: .8rem; font-weight: 700; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-actions { display: flex; gap: 7px; flex-shrink: 0; }
.group-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: .76rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint); margin: 18px 0 9px;
}
.group-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Guruh tugmasi katta bosiladigan nishon bo'lsin */
.group-title .btn { flex: none; min-height: 40px; letter-spacing: 0; text-transform: none; }
.group-title:first-child { margin-top: 0; }

/* ===================== KUN TANLAGICH ===================== */
.daybar {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 14px;
}
.daybar-nav {
  flex: none; width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
}
.daybar-nav svg { width: 20px; height: 20px; }
.daybar-nav:disabled { opacity: .35; }
.daybar-nav:not(:disabled):hover { background: var(--surface-2); }

/* Sana maydoni ko'rinmas holda ustiga qo'yiladi — butun maydon bosiladi */
.daybar-mid {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer;
}
.daybar-mid:hover { background: var(--surface-2); }
.daybar-mid { flex-direction: column; gap: 1px; padding: 5px 14px; }
.daybar-label { font-weight: 900; font-size: .95rem; line-height: 1.2; }
.daybar-sub { font-size: .72rem; font-weight: 700; color: var(--muted); line-height: 1.2; }
.daybar-label, .daybar-sub { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daybar-mid input[type="date"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: transparent; background: transparent;
}
.daybar .btn { flex: none; min-height: 44px; }

.daybar-note {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 10px 0 2px; padding: 10px 13px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--violet) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--violet) 32%, transparent);
  color: var(--violet-ink); font-weight: 700; font-size: .84rem; line-height: 1.45;
}
.daybar-note svg { flex: none; width: 17px; height: 17px; }
.daybar-note > span { flex: 1 1 auto; min-width: 0; }
.daybar-back {
  flex: none; margin: -6px -5px -6px 0; padding: 0 12px; min-height: 40px;
  border-radius: var(--r-sm); font: inherit; font-weight: 900; font-size: .8rem;
  color: var(--violet-ink);
  background: color-mix(in srgb, var(--violet) 18%, transparent);
}
.daybar-back:hover { background: color-mix(in srgb, var(--violet) 28%, transparent); }

/* Server javobini kutayotgan qator biroz so'niq turadi */
.row.is-pending { opacity: .62; }

/* ===================== TABLE ===================== */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th {
  text-align: left; font-size: .7rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); padding: 12px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr[data-row] { cursor: pointer; }
table.tbl tbody tr[data-row]:hover { background: var(--surface-2); }
.num { font-weight: 900; text-align: center; white-space: nowrap; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; min-width: 56px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #34d399); }
.day-pills { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 0 8px; }
.day-pill { font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); }

/* ===================== EMPTY / SKELETON ===================== */
.empty { text-align: center; padding: 42px 18px; color: var(--muted); }
.empty .e-ico { font-size: 2.4rem; margin-bottom: 10px; }
.empty b { display: block; font-weight: 900; margin-bottom: 5px; color: var(--text); }
.empty p { font-size: .9rem; margin-bottom: 14px; }
.skel { background: var(--surface); border-radius: var(--r); height: 64px; margin-bottom: 9px; position: relative; overflow: hidden; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface-2), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ===================== SHEET / MODAL ===================== */
.sheet {
  border: 0; padding: 0; background: transparent; max-width: 100%; max-height: 100dvh;
  width: 100%; margin: auto auto 0;
}
.sheet::backdrop { background: rgba(4,9,20,.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-inner {
  background: var(--sheet-bg); border: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.sheet-grab { width: 42px; height: 4px; border-radius: 99px; background: var(--border-2); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet-head h3 { font-size: 1.1rem; font-weight: 900; }
.sheet-head .spacer { flex: 1; }
@media (min-width: 640px) {
  .sheet { max-width: 480px; margin: auto; }
  .sheet-inner { border-radius: var(--r-lg); }
}

.check-list { display: flex; flex-direction: column; gap: 7px; }
.check-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; font-weight: 700;
}
.check-item input { width: 19px; height: 19px; accent-color: var(--gold); flex-shrink: 0; }

/* ===================== TOAST ===================== */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 200;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(94vw, 420px); display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--sheet-bg); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 12px 15px;
  font-weight: 700; font-size: .9rem; box-shadow: var(--shadow);
  animation: toastIn .22s ease;
}
.toast-act {
  flex: none; margin: -8px -7px -8px 0; padding: 10px 12px;
  min-height: 40px; border-radius: var(--r-sm);
  color: var(--gold-ink); font: inherit; font-weight: 900;
  text-transform: uppercase; letter-spacing: .04em; font-size: .78rem;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
}
.toast-act:hover { background: color-mix(in srgb, var(--gold) 24%, transparent); }
.toast.ok  { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.toast.bad { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.spin {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: sp .8s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ===================== AUTH ===================== */
.auth {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 22px;
}
.auth-card {
  width: 100%; max-width: 400px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 34px 26px; box-shadow: var(--shadow);
}
.auth-card .logo { width: 72px; aspect-ratio: 447/559; margin: 0 auto 14px; background: var(--logo-url) center/contain no-repeat; }
.auth-card h1 { font-size: 1.3rem; font-weight: 900; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin: 4px 0 22px; }
.auth-card form { text-align: left; }
.err { color: var(--red-ink); font-size: .87rem; font-weight: 700; min-height: 1.2em; margin-top: 10px; text-align: center; }
.auth-foot { margin-top: 18px; font-size: .82rem; color: var(--faint); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 999px) {
  .sidebar { display: none; }
  .tabbar { display: flex; flex-direction: column; }
  .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 14px; gap: 9px; }
  .topbar .logo { display: block; }
  .topbar h1 { font-size: 1.05rem; }
  .tb-actions { gap: 6px; }
  .tb-btn { height: 38px; padding: 0 9px; font-size: .78rem; }
  .tb-icon, .tb-avatar { width: 38px; }
  .page { padding: 18px 16px 30px; }
  .row { padding: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }

  /* Davomat ekranida statistika bitta qatorda — o'quvchilar ro'yxati
     birinchi ekranda ko'rinishi kerak, asosiy ish shu */
  .stats.stats-compact { grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
  .page-head:has(+ .daybar) { display: none; }
}
@media (max-width: 400px) {
  .topbar .logo { display: none; }
  .topbar { padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Mobil aniqlashtirishlar */
@media (max-width: 999px) {
  /* Sarlavha yuqori panelda bor — takrorlamaymiz */
  .page-head h2 { display: none; }
  .page-head { margin-bottom: 14px; align-items: center; }
}
@media (max-width: 560px) {
  /* Ism to'liq kenglikda, tugmalar alohida qatorda — barmoq uchun qulay */
  .row { flex-wrap: wrap; row-gap: 10px; }
  .row-actions { width: 100%; }
  .row-actions .btn { flex: 1; min-height: 44px; }
  .row-actions .btn.btn-sm { font-size: .9rem; }
  /* Davomatda: asosiy tugma butun kenglikda, ikkilamchilar ostida yonma-yon */
  .rt .row-actions { flex-wrap: wrap; gap: 8px; }
  .rt .btn-act, .rt .act-done { order: -1; flex: 1 0 100%; font-size: 1rem; min-height: 50px; }
  .rt .btn-alt { flex: 1 1 0; min-height: 46px; font-size: .9rem; padding: 10px 8px; }
  .mk-row { flex-wrap: nowrap; }
  .mk-row .btn { width: auto; flex: 0 0 auto; }
  .mk-btn { min-height: 66px; }
}

/* Navigatsiyadagi hisoblagich (yangi arizalar) */
.nav-count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 99px; background: #c62828; color: #fff;
  font-size: .72rem; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
}
/* [hidden] ni display:inline-flex bosib ketmasin */
.nav-count[hidden] { display: none; }
.tab-item { position: relative; }
.tab-item .nav-count {
  position: absolute; top: 6px; left: 50%; margin-left: 6px;
  min-width: 18px; height: 18px; font-size: .66rem;
}
.check-item[data-go-more] { width: 100%; text-align: left; }
.check-item svg { width: 19px; height: 19px; flex-shrink: 0; }

/* ===================== OTA-ONA ULANISHI ===================== */
.link-state {
  text-align: center;
  padding: 18px 14px 4px;
  color: var(--muted);
}
.link-state .link-ico { font-size: 2.2rem; line-height: 1; margin-bottom: 9px; }
.link-state > b { display: block; font-weight: 900; color: var(--text); margin-bottom: 5px; }
.link-state p { font-size: .9rem; margin: 0 0 6px; }
.link-state.ok .link-ico,
.link-state.warn .link-ico { filter: saturate(1.2); }

.link-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  word-break: break-all;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 11px 13px;
  margin: 12px 0;
  color: var(--text);
  user-select: all;
}

.link-steps {
  margin: 16px 0 10px;
  padding-left: 20px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.65;
}
.link-steps li { margin-bottom: 3px; }
.link-steps b { color: var(--text); }

.link-dim { color: var(--faint); font-size: .82rem; line-height: 1.55; margin: 0; }
.link-dim b { color: var(--muted); }

.field .f-hint { display: block; margin-top: 5px; color: var(--faint); font-size: .78rem; line-height: 1.45; }

/* ===================== DAVOMAT HOLATLARI ===================== */
/* Bitta rang tizimi: har bir holatning o'z --tone i bor, qolgan hamma narsa
   (tugma, matn, belgi, kun nuqtasi, statistika) shundan oziqlanadi. */
.tone-green   { --tone: var(--green);    --tone-ink: var(--green-ink);  --tone-grad: linear-gradient(135deg,#10b981,#34d399); --tone-on: #052e1f; }
.tone-gold    { --tone: var(--gold);     --tone-ink: var(--gold-ink);   --tone-grad: linear-gradient(135deg,#ffb300,#ffd54f); --tone-on: var(--on-gold); }
.tone-red     { --tone: var(--red);      --tone-ink: var(--red-ink);    --tone-grad: linear-gradient(135deg,#ef4444,#f87171); --tone-on: #2b0606; }
.tone-violet  { --tone: var(--violet);   --tone-ink: var(--violet-ink); --tone-grad: linear-gradient(135deg,#9b74f7,#a78bfa); --tone-on: #190a33; }
.tone-muted,
.tone-pending { --tone: var(--border-2); --tone-ink: var(--faint);      --tone-grad: none;                                    --tone-on: var(--muted); }

/* Rangli tugma */
.btn-tone { background: var(--tone-grad); color: var(--tone-on); border-color: transparent; }
.btn-tone:disabled { opacity: .4; }

/* Qator: chap chekka + holat matni. Asosiy tugmadan tashqari joyi
   bosilsa holatlar oynasi ochiladi. */
.rt { border-left: 3px solid var(--tone); cursor: pointer; }
.rt.tone-pending { border-left-color: transparent; }
.rt:hover { border-color: var(--border-2); border-left-color: var(--tone); }
.rt.tone-pending:hover { border-left-color: var(--border-2); }
.rt .row-actions { cursor: default; }

/* Holat matni — ayni paytda "o'zgartirish" tugmasi */
.rt-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 7px 3px 6px; margin-left: -6px;
  border-radius: 8px; border: 0; background: transparent;
  color: var(--tone-ink); font-weight: 700; font-size: inherit;
  font-family: inherit; cursor: pointer; text-align: left;
}
.rt-status svg { width: 15px; height: 15px; flex-shrink: 0; }
.rt-status svg:last-child { width: 13px; height: 13px; opacity: .55; margin-left: 1px; }
.rt-status:hover,
.rt:hover .rt-status { background: color-mix(in srgb, var(--tone) 12%, transparent); }
.rt-status:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }

/* Tugmalar: chapda ikkilamchi holatlar, o'ngda keyingi qadam */
.rt .row-actions { gap: 8px; }
.btn-act { min-width: 156px; }
.btn-alt { min-width: 0; padding: 12px 14px; font-size: .88rem; }
.btn-alt svg { width: 16px; height: 16px; }

/* Belgi qo'yilmagan qatorda holat matni oddiy yozuv */
.rt-status.is-plain { cursor: default; padding-left: 0; margin-left: 0; }
.rt-status.is-plain:hover { background: transparent; }
.rt.is-fresh { cursor: default; }

/* Kuni tugadi */
.act-done {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 156px; min-height: 46px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px dashed var(--border-2);
  color: var(--muted); font-weight: 800; font-size: .9rem;
}
.act-done svg { width: 16px; height: 16px; color: var(--green-ink); }

/* Telegramga ulanmagan belgisi */
.badge.b-mute { padding: 2px 5px; color: var(--faint); }
.badge.b-mute svg { width: 13px; height: 13px; display: block; }

/* "⋯" oynasidagi holat tugmalari */
.mk-opts { display: flex; flex-direction: column; gap: 9px; }
.mk-btn {
  justify-content: flex-start; text-align: left;
  min-height: 62px; padding: 12px 15px; gap: 12px;
}
.mk-btn svg { width: 22px; height: 22px; }
.mk-lbl { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mk-lbl b { font-weight: 900; font-size: 1rem; }
.mk-lbl small { font-size: .78rem; font-weight: 700; opacity: .8; white-space: normal; line-height: 1.35; }

/* "⋯" oynasidagi bugungi belgilar */
.mk-sep {
  margin: 18px 0 9px;
  font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint);
}
.mk-row { gap: 11px; border-left: 3px solid var(--tone); }
.mk-row .row-title { font-size: .95rem; color: var(--tone-ink); }
.mk-row .btn { flex: 0 0 auto; }
.mk-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: color-mix(in srgb, var(--tone) 16%, transparent);
  color: var(--tone-ink);
}
.mk-ico svg { width: 17px; height: 17px; }

/* Statistika kartasi */
.stat span { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.stat span svg { width: 13px; height: 13px; opacity: .8; }
.stat.tone-green b, .stat.tone-gold b, .stat.tone-red b, .stat.tone-violet b { color: var(--tone-ink); }
.stat.tone-green span, .stat.tone-gold span, .stat.tone-red span, .stat.tone-violet span { color: var(--tone-ink); }

/* Hisobotdagi kun belgilari */
.day-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--tone, var(--border-2)) 14%, transparent);
  color: var(--tone-ink, var(--muted));
}
.day-pill svg { width: 12px; height: 12px; flex-shrink: 0; }
.th-ico { white-space: nowrap; }
.th-ico span { display: inline-flex; color: var(--tone-ink); }
.th-ico svg { width: 14px; height: 14px; vertical-align: middle; }
.th-ico span + span { margin-left: 6px; }
.num-on { color: var(--tone-ink); font-weight: 900; }
.num-off { color: var(--faint); }


/* ===================== YUKLANISH XATOSI ===================== */
.boot-err-ico { font-size: 2.2rem; line-height: 1; margin-bottom: 10px; color: var(--gold-ink); }
.boot-err-what {
  margin: 14px 0 4px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-weight: 800; font-size: .88rem; word-break: break-word; color: var(--text);
}
.boot-err-detail { color: var(--faint); font-size: .78rem; margin-bottom: 16px; word-break: break-all; }

/* Kirish ekranidagi til tanlash */
.auth-langs { justify-content: center; margin-top: 16px; }
.auth-langs .chip { --acc: var(--sky); font-size: .82rem; padding: 6px 12px; }

/* =========================================================
   OYLIK HISOBOT — filtrlar, bo'limlar, jurnal, diagrammalar
   ========================================================= */
.rep-filters { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.rep-filters .field { max-width: 220px; margin: 0; flex: none; }
.rep-filters .chips { margin: 0; }

/* Qayta yuklashda eski ko'rinish so'niq turadi — skelet miltillamaydi */
#repOut { transition: opacity .15s; }
#repOut.is-loading { opacity: .5; pointer-events: none; }

/* Segmentli tanlagich */
.seg {
  display: flex; gap: 4px; padding: 4px; margin: 4px 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.seg-btn {
  flex: 1; min-height: 44px; padding: 0 10px; border-radius: 8px;
  font: inherit; font-weight: 800; font-size: .9rem; color: var(--muted);
}
.seg-btn:hover { color: var(--text); background: var(--surface-2); }
.seg-btn.on { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-2); }

/* Afsona: rang doim ikonka bilan — qizil/yashil rang ko'rlikda farqlanmaydi */
.viz-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 10px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.lg-item > svg { width: 14px; height: 14px; color: var(--muted); }
.lg-swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--tone); }
.lg-cell {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tone) 20%, transparent); color: var(--tone-ink);
}
.lg-cell svg { width: 13px; height: 13px; }
.lg-cell.is-closed { background: var(--surface-2); border: 1px solid var(--border); }
.viz-hint { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.viz-hint svg { width: 14px; height: 14px; flex: none; }

/* ---------- JURNAL ---------- */
.jg-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
}
.jg { border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.jg th, .jg td { padding: 0; }

/* Ism ustuni yopishqoq — gorizontal siljiganda ham ko'rinib turadi */
.jg-name {
  position: sticky; left: 0; z-index: 2;
  min-width: 150px; max-width: 150px; padding: 0 10px !important; height: 38px;
  text-align: left; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--bg); border-right: 1px solid var(--border);
}
.jg thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); border-bottom: 1px solid var(--border); }
.jg thead .jg-corner { z-index: 3; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.jg-day { min-width: 32px; height: 42px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.jg-day b { display: block; font-size: .8rem; font-weight: 800; color: var(--text); }
.jg-day span { display: block; font-size: .6rem; font-weight: 700; }
.jg-day.is-today b { color: var(--gold-ink); }
.jg-day.is-closed { color: var(--faint); }
.jg-day.is-closed b { color: var(--faint); }

.jg-group th { height: 30px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.jg-group td { background: var(--surface-2); }
.jg-group th { background: var(--surface-2); }
/* Kurs nomi bo'sh qator bo'ylab davom etadi — 112px ustunda qirqilmaydi */
.jg-group .jg-name { overflow: visible; text-overflow: clip; }
/* Ism ikki qatorgacha — "Aziza Kari…" o'rniga "Aziza / Karimova" */
.jg-nm {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; white-space: normal; overflow-wrap: break-word; line-height: 1.2;
}

.jg-cell {
  width: 32px; height: 38px; text-align: center; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.jg-cell svg { width: 15px; height: 15px; display: block; margin: auto; }
/* Rangli katak: fon — holat rangi, ikonka — holat siyohi */
.jg-cell[class*="tone-"] {
  background: color-mix(in srgb, var(--tone) 22%, transparent);
  color: var(--tone-ink);
  box-shadow: inset 0 0 0 1px var(--bg);          /* 1px sirt oralig'i — qo'shni kataklar ajralib turadi */
}
/* Yopiq kun — tekis fon (burchakli naqsh standart holatda ishlatilmaydi) */
.jg-cell.is-closed:not([class*="tone-"]) { background: var(--surface-2); }
.jg-cell.is-future { opacity: .35; }
.jg-cell.is-today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 65%, transparent); }
.jg-cell.is-fix { cursor: pointer; }
.jg-cell.is-fix:hover, .jg-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.jg-sum {
  position: sticky; right: 0; min-width: 56px; padding: 0 8px !important; text-align: right;
  background: var(--bg); border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.jg-sum b { display: block; font-size: .82rem; }
.jg-sum span { display: block; font-size: .66rem; color: var(--muted); font-weight: 700; }
.jg tbody tr:last-child td, .jg tbody tr:last-child th { border-bottom: 0; }

/* ---------- DIAGRAMMALAR ---------- */
.viz-card { margin-bottom: 14px; }
.viz-head h3 { margin: 0; font-size: 1rem; font-weight: 900; }
.viz-head p { margin: 3px 0 12px; font-size: .84rem; color: var(--muted); font-weight: 600; }
.viz-plot { width: 100%; }
.viz { display: block; width: 100%; height: auto; overflow: visible; }
.viz:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 6px; }

/* Chiziqlar — sirtdan bir pog'ona farqli, 1px, to'liq (hech qachon uzuq emas) */
.viz-grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
/* Matn — matn tokenlarida, hech qachon ma'lumot rangida emas */
.viz-axis { fill: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-label { fill: var(--text); font-size: 13px; font-weight: 800; }
.viz-value { fill: var(--muted); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }

.viz-in      { fill: var(--viz-in); }
.viz-excused { fill: var(--viz-excused); }
.viz-absent  { fill: var(--viz-absent); }
.viz-legend .lg-swatch.tone-green  { background: var(--viz-in); }
.viz-legend .lg-swatch.tone-violet { background: var(--viz-excused); }
.viz-legend .lg-swatch.tone-red    { background: var(--viz-absent); }
.viz-closed  { fill: var(--surface-2); }
.viz-cross   { stroke: var(--text); stroke-width: 1; opacity: .45; pointer-events: none; }
.viz-cross[hidden] { display: none; }
.viz-track   { fill: var(--surface-2); }
.viz-bar     { fill: var(--sky); }
.viz-hit { cursor: default; outline: none; }
.viz-hit:hover .viz-bar, .viz-hit:focus-visible .viz-bar { opacity: .82; }
.viz-hit:focus-visible .viz-track { stroke: var(--gold); stroke-width: 2; }

/* Jadval ko'rinishi — har bir diagrammaning ekvivalenti */
.viz-table { margin-top: 12px; }
.viz-table summary {
  display: inline-flex; align-items: center; min-height: 40px; cursor: pointer;
  font-size: .84rem; font-weight: 800; color: var(--sky-ink);
}
.viz-table .table-wrap { margin-top: 8px; max-height: 320px; overflow: auto; }
.viz-note { margin: 8px 0 0; font-size: .78rem; font-weight: 600; color: var(--muted); line-height: 1.45; }

/* Ko'rsatkich: avval qiymat (kuchli), keyin nom (ikkilamchi) */
.viz-tip {
  position: fixed; z-index: 90; pointer-events: none;
  max-width: 240px; padding: 9px 12px; border-radius: 10px;
  background: var(--sheet-bg); border: 1px solid var(--border-2); box-shadow: var(--shadow);
}
.viz-tip[hidden] { display: none; }
.viz-tip-v { font-size: .86rem; font-weight: 800; line-height: 1.45; color: var(--text); font-variant-numeric: tabular-nums; }
.viz-tip-t { margin-top: 4px; font-size: .74rem; font-weight: 700; color: var(--muted); }

@media (max-width: 999px) {
  .jg-name { min-width: 112px; max-width: 112px; font-size: .78rem; }
  .jg-day, .jg-cell { min-width: 30px; width: 30px; }
  .rep-filters .field { max-width: none; flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { #repOut { transition: none; } }

/* ---------- XABAR SHABLONLARI ---------- */
.seg-tpl .seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  position: relative; padding: 0 8px;
}
.seg-tpl .seg-btn svg { width: 16px; height: 16px; flex: none; }
.seg-tpl .seg-btn > span:first-child { display: inline-flex; color: var(--tone-ink); }
/* Saqlanmagan — oltin nuqta; o'chiq — kulrang halqa. Ikkalasida ham title bor.
   Kompyuterda yozuv yonida, telefonda (ustun tartib) tugma burchagida */
.tpl-dot, .tpl-offdot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.tpl-dot { background: var(--gold); }
.tpl-offdot { border: 2px solid var(--faint); }

/* O'chirgich — haqiqiy checkbox, faqat ko'rinishi almashtirilgan (klaviatura va ekran o'quvchi ishlaydi) */
.switch-row {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); cursor: pointer;
  min-height: 56px; position: relative;
}
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  flex: none; width: 44px; height: 26px; border-radius: 13px; position: relative;
  background: var(--surface-2); border: 1px solid var(--border-2); transition: background .15s, border-color .15s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); transition: transform .15s, background .15s;
}
.switch-row input:checked + .switch { background: color-mix(in srgb, var(--green) 30%, transparent); border-color: var(--green); }
.switch-row input:checked + .switch::after { transform: translateX(18px); background: var(--green); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-txt b { font-size: .92rem; }
.switch-txt small { color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.35; }

.tpl-field { margin-bottom: 8px; }
.tpl-text { min-height: 128px; resize: vertical; line-height: 1.5; font-size: 1rem; }
.tpl-tools { display: flex; align-items: flex-start; gap: 10px; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.tpl-var { --acc: var(--sky); min-height: 36px; padding: 6px 10px; font-size: .82rem; }
.tpl-var code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; color: var(--sky-ink); }
.tpl-count { flex: none; padding-top: 9px; font-size: .78rem; font-weight: 800; color: var(--faint); font-variant-numeric: tabular-nums; }
.tpl-count.is-over { color: var(--red-ink); }
.tpl-hint { margin: 8px 0 0; color: var(--faint); font-size: .8rem; font-weight: 600; line-height: 1.45; }
.tpl-err {
  margin: 10px 0 0; padding: 9px 12px; border-radius: var(--r-sm); font-size: .86rem; font-weight: 700;
  color: var(--red-ink); background: color-mix(in srgb, var(--red) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
}
.tpl-err[hidden] { display: none; }

/* Namuna — Telegram suhbatiga o'xshash, lekin panel tokenlarida */
.tpl-prev-head {
  display: flex; justify-content: space-between; gap: 10px; margin: 16px 0 6px;
  font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--faint);
}
.tpl-state { text-transform: none; letter-spacing: 0; color: var(--muted); }
.tg-chat {
  padding: 14px; border-radius: var(--r); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--sky) 6%, var(--surface));
}
.tg-bubble {
  max-width: 440px; padding: 9px 12px 7px; border-radius: 14px 14px 14px 4px;
  background: var(--surface-2); border: 1px solid var(--border-2);
}
.tg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.45; color: var(--text); }
.tg-text b { font-weight: 800; }
.tg-time { display: block; margin-top: 2px; text-align: right; font-size: .7rem; font-weight: 700; color: var(--faint); }
.tg-chat.is-muted .tg-bubble { opacity: .45; border-style: dashed; }

.tpl-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
@media (max-width: 999px) {
  .seg-tpl .seg-btn { flex-direction: column; gap: 2px; font-size: .76rem; padding: 6px 2px; min-height: 52px; }
  .tpl-dot, .tpl-offdot { position: absolute; top: 6px; right: 6px; }
  .tpl-tools { flex-direction: column-reverse; gap: 6px; }
  .tpl-count { align-self: flex-end; padding-top: 0; }
  .tpl-actions .btn { flex: 1; min-width: 0; white-space: normal; line-height: 1.2; text-align: center; padding: 10px 12px; }
}
/* 6 ta tur telefonda bir qatorga sig'maydi (ayniqsa ruschada) — 3 tadan ikki qator */
@media (max-width: 599px) {
  .seg-tpl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- OYLIK TO'LOVLAR ---------- */
.monthbar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.daybar-mid input[type="month"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: transparent; background: transparent;
}
.monthbar + .daybar-note { margin: -4px 0 12px; }
.chips + #payOut { margin-top: 12px; }
@media (min-width: 1000px) { .monthbar { max-width: 520px; } }
#payOut.is-loading { opacity: .5; pointer-events: none; }

.stats.pay-stats { grid-template-columns: repeat(4, 1fr); }
.stats.fin-stats { grid-template-columns: repeat(3, 1fr); }
.viz-legend .lg-item > span[class^="tone-"] { display: inline-flex; color: var(--tone-ink); }
.viz-legend .lg-item > span[class^="tone-"] svg { width: 14px; height: 14px; }
.stat-sum b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-sum span svg { width: 14px; height: 14px; }

.seg-n {
  display: inline-block; min-width: 22px; margin-left: 4px; padding: 1px 6px; border-radius: 99px;
  font-size: .74rem; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--muted);
}
.seg-btn.on .seg-n { background: var(--border-2); color: var(--text); }
.pay-search { margin: 0 0 12px; }

.pay-row .row-main { flex: 1 1 160px; }
.pay-state { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; text-align: right; }
.pay-state small { color: var(--muted); font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px;
  font-size: .78rem; font-weight: 800; white-space: nowrap; color: var(--tone-ink);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
}
.pay-badge svg { width: 14px; height: 14px; flex: none; }
.pay-state .pay-owed { color: var(--red-ink); font-weight: 800; }
.pay-state .pay-debt { color: var(--text); font-weight: 800; }
.pay-debt-sum {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 10px; padding: 10px 14px;
  border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border);
}
.pay-debt-sum b { font-variant-numeric: tabular-nums; }
.pay-debt-sum small { color: var(--muted); font-size: .78rem; font-weight: 700; }
.pay-quick .chip small { color: var(--muted); font-weight: 700; }
.pay-fee-nudge { margin: -6px 0 14px; }
.pay-who .pay-own { color: var(--text); font-size: .82rem; }
.row-sub .st-fee { font-variant-numeric: tabular-nums; }
.pay-sent { display: inline-flex; vertical-align: -2px; margin-left: 5px; color: var(--green-ink); }
.pay-sent svg { width: 13px; height: 13px; }
.pay-tell { margin: 0 0 14px; font-weight: 600; font-size: .9rem; line-height: 1.35; }
.pay-tell input { accent-color: var(--green); }

/* To'lov oynasi */
.pay-who { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; }
.pay-who b { font-size: 1.05rem; }
.pay-who span { color: var(--muted); font-size: .86rem; font-weight: 700; }
.pay-owed-list {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; padding: 9px 12px; border-radius: var(--r-sm);
  font-size: .86rem; font-weight: 700; color: var(--red-ink);
  background: color-mix(in srgb, var(--red) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
}
.pay-owed-list svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.pay-amount { font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.pay-quick { margin: -6px 0 14px; flex-wrap: wrap; }
.pay-quick .chip { font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  /* 3 ta son bir qatorda, yig'ilgan summa alohida keng qatorda — uzun raqam sig'sin */
  .stats.pay-stats { grid-template-columns: repeat(3, 1fr); }
  .pay-stats .stat-sum {
    grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; text-align: left;
  }
  .pay-stats .stat-sum b { order: 2; font-size: 1.15rem; }
  .pay-stats .stat-sum span { order: 1; font-size: .74rem; }
  .pay-stats .stat-sum span svg { display: inline-block; vertical-align: -2px; margin-right: 4px; }
  /* Moliya: uchta summa — har biri alohida keng qatorda, uzun raqam sig'sin */
  .stats.fin-stats { grid-template-columns: 1fr; }
  .fin-stats .stat-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; text-align: left; }
  .fin-stats .stat-sum span { min-width: 0; line-height: 1.3; }
  .fin-stats .stat-sum b { order: 2; font-size: 1.15rem; }
  .fin-stats .stat-sum span { order: 1; font-size: .74rem; }
  .fin-stats .stat-sum span svg { display: inline-block; vertical-align: -2px; margin-right: 4px; }
  /* Son yozuv ostida — uch tab bir xil balandlikda, yozuv qirqilmaydi */
  .seg-pay .seg-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 4px; }
  .seg-pay .seg-n { margin-left: 0; }
  .pay-row .row-main { flex: 1 1 0; }
  .pay-state { order: 3; flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 8px; }
  .pay-row .row-actions { order: 4; }
}

/* ---------- TO'LOV ESLATMASI ---------- */
.tpl-manual {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 11px 13px;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: .86rem; font-weight: 700; line-height: 1.45;
}
.tpl-manual svg { width: 18px; height: 18px; flex: none; color: var(--gold-ink); margin-top: 1px; }

.pay-rem { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.pay-rem svg { width: 13px; height: 13px; flex: none; }
.pay-rem.is-failed { color: var(--red-ink); }
.pay-rem.is-unknown { color: var(--gold-ink); }

.rem-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.rem-bar small { color: var(--muted); font-size: .8rem; font-weight: 700; }
.rem-open { min-height: 44px; }
.rem-open svg { width: 17px; height: 17px; }

.rem-scope { margin: 0 0 6px; font-size: .82rem; font-weight: 800; color: var(--gold-ink); }
.rem-summary { margin: 0 0 12px; color: var(--muted); font-size: .86rem; font-weight: 700; line-height: 1.5; }
.rem-done { margin: 4px 0 14px; font-size: 1.05rem; font-weight: 900; }
.rem-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.rem-list-head b { font-size: .9rem; }
.rem-list-head .btn { min-height: 40px; }
.rem-list .check-item { align-items: flex-start; }
.rem-list .check-item input { margin-top: 2px; }
/* Ism to'liq ko'rinadi (qisqartirilmaydi) — kimga ketayotgani aniq bo'lsin */
.rem-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rem-name { overflow-wrap: anywhere; white-space: normal; }
.rem-who small { color: var(--muted); font-size: .78rem; font-weight: 700; }
.rem-skip { margin-top: 14px; }
.rem-skip summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 800; color: var(--muted); font-size: .9rem; }
.rem-skip-list { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.rem-skip-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); font-weight: 700;
}
.rem-tel { flex: none; min-height: 40px; display: inline-flex; align-items: center; font-size: .84rem; font-weight: 800; white-space: nowrap; }

/* Tugma uzun ro'yxat ostida yo'qolmasin — oyna pastiga yopishadi */
.sheet-foot {
  position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); z-index: 2;
  margin: 16px -20px calc(-20px - env(safe-area-inset-bottom));
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--sheet-bg); border-top: 1px solid var(--border);
}
.sheet-foot .btn { min-height: 50px; white-space: normal; line-height: 1.25; text-align: center; }

/* ===================== QA 2-TO'PLAM: MOSLASHUV VA QULAYLIK ===================== */
/* Havola ko'rinishidagi tugmalar (tel:, t.me) tagiga chizilmasin */
.btn { text-decoration: none; }
/* Uzun tarjima (ruscha) tugmadan chiqib ketmasin */
.btn-block, .sheet .btn:not(.btn-icon) { white-space: normal; line-height: 1.25; text-align: center; }
/* Server javobini kutayotgan tugma: belgi o'rnida aylanuvchi doira */
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy svg { display: none; }
.btn.is-busy::before {
  content: ''; width: 15px; height: 15px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: sp .8s linear infinite;
}
/* Faqat belgili kichik tugma — kvadrat, matn yo'q */
.btn-ico { padding: 8px; min-width: 38px; }

/* iPhone "chiqiq"i va yumaloq burchaklari ostida matn qolmasin (viewport-fit=cover) */
.topbar {
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}
.sidebar { padding-top: calc(18px + env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); }
.auth { padding: calc(22px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
@media (min-width: 1000px) { .topbar { padding-left: 20px; padding-right: max(20px, env(safe-area-inset-right)); } }
@media (max-width: 400px) { .topbar { padding-left: max(11px, env(safe-area-inset-left)); padding-right: max(11px, env(safe-area-inset-right)); } }

/* Uzun ism / kurs nomi / email / izoh qatorni yirtmaydi */
.row-sub span { overflow-wrap: anywhere; min-width: 0; }
.row-title { overflow-wrap: anywhere; min-width: 0; }
.row-title .badge { white-space: normal; max-width: 100%; line-height: 1.35; }
.sheet-head h3 { min-width: 0; overflow-wrap: anywhere; }
.sheet-head .btn-icon { flex: none; }

/* Kurs rangi — tanlangan rang shu yerning o'zida ko'rinadi */
.color-prev {
  border-color: transparent;
  background: linear-gradient(135deg, var(--acc, var(--sky)), color-mix(in srgb, var(--acc, var(--sky)) 55%, #fff));
}

/* Yorug' rejimda avatar harflari to'q fonda ko'rinmay qolardi */
:root[data-theme="light"] .avatar {
  background: linear-gradient(135deg, color-mix(in srgb, var(--acc, var(--sky)) 72%, #fff), color-mix(in srgb, var(--acc, var(--sky)) 45%, #fff));
}

.load-err { margin-bottom: 12px; }

@media (max-width: 999px) {
  /* Bildirishnoma pastki menyuni yopmasin */
  .toasts { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  /* Davomat: 5 ta son bitta qatorda, yozuv 11px dan kichik emas. Ustun yozuvidan tor
     bo'lmaydi (min-content) — "Kutilmoqda" qirqilmaydi, ikki so'zli yozuv ikki qatorga o'tadi */
  .stats.stats-compact:not(.pay-stats):not(.fin-stats) { grid-template-columns: repeat(5, minmax(min-content, 1fr)); gap: 4px; }
  .stats-compact .stat { padding: 9px 2px 8px; border-radius: var(--r-sm); }
  .stats-compact .stat b { font-size: 1.15rem; }
  .stats-compact .stat span { display: block; font-size: .6875rem; line-height: 1.2; letter-spacing: -.01em; }
  .stats-compact .stat span svg { display: none; }
  /* Belgili tugma cho'zilmaydi — yonidagi matnli tugmaga joy qoladi */
  .row-actions .btn.btn-ico { flex: 0 0 auto; min-width: 44px; }
}
@media (max-width: 359px) {
  /* Eng tor telefon (320px): beshtasi sig'maydi — 3 + 2 */
  .stats.stats-compact:not(.pay-stats):not(.fin-stats) { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .stats-compact:not(.pay-stats):not(.fin-stats) > .stat { grid-column: span 2; }
  .stats-compact:not(.pay-stats):not(.fin-stats) > .stat:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 400px) {
  /* Kurs nomi va "Hammasi keldi" tugmasi sig'masa — ikki qatorga */
  .group-title { flex-wrap: wrap; row-gap: 8px; }
  .group-title > span { white-space: normal; overflow-wrap: anywhere; }
}
/* Sensorli ekranda bosiladigan nishonlar kamida 44px (Apple HIG / WCAG 2.5.5) */
@media (pointer: coarse) {
  .tb-btn, .tb-icon, .tb-avatar { min-height: 44px; }
  .chip, .btn-sm, .tpl-var { min-height: 44px; }
}

/* ===================== DAVOMAT 3-TO'PLAM ===================== */
/* Modal ochiq: bildirishnomalar dialog ichida (top layer) — tepada, sheet tugmalarini yopmasin */
.sheet > .toasts { position: fixed; bottom: auto; top: calc(12px + env(safe-area-inset-top)); }

/* Yorug' rejimda oltin fokus halqasi (1.7:1) o'rniga to'qroq — kamida 3:1 */
:root[data-theme="light"] :focus-visible { outline-color: var(--gold-ink); }
:root[data-theme="light"] .jg-cell.is-fix:hover, :root[data-theme="light"] .jg-cell:focus-visible,
:root[data-theme="light"] .viz:focus-visible, :root[data-theme="light"] .switch-row input:focus-visible + .switch { outline-color: var(--gold-ink); }
:root[data-theme="light"] .inp:focus { border-color: var(--gold-ink); box-shadow: 0 0 0 1px var(--gold-ink); }

/* Kun / oy tanlagichi ko'rinmas input ustida — fokus butun tugmada ko'rinsin */
.daybar-mid:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
:root[data-theme="light"] .daybar-mid:focus-within { outline-color: var(--gold-ink); }

/* Pastki menyu fokusdagi tugmani yopmasin */
html { scroll-padding-bottom: calc(var(--tabbar-h) + 24px); scroll-padding-top: calc(var(--bar-h) + 12px); }
@media (min-width: 1000px) { html { scroll-padding-bottom: 24px; } }

/* Sarlavha (h2) ekranda yashirin, lekin ekran o'qigichga ko'rinadi — h1 → h3 sakramasin */
@media (max-width: 999px) {
  .page-head h2 { display: block; position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}

/* Hisobot ro'yxati: o'quvchi nomi — qatorni ochadigan tugma (klaviatura uchun) */
.row-toggle { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: inherit; text-align: left; cursor: pointer; }
.row-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Yuklanish ekranidagi logotip (inline style'dagi var(--logo-url) hujjat asosiga nisbatan
   /logo-dark.webp ni so'rab 404 olardi) */
.boot-logo { width: 64px; aspect-ratio: 447/559; margin: 0 auto 14px; background: var(--logo-url) center/contain no-repeat; }

/* Triage: qolgan kichik vizual tuzatishlar */
/* Sensorli ekran: "Hammasi keldi" va yuqori paneldagi belgilar 44px dan kichik emas */
@media (pointer: coarse) {
  .group-title .btn { min-height: 44px; }
  .tb-icon, .tb-avatar { min-width: 44px; }
}
/* Tor telefonda sarlavha ikki qatorga o'tadi (ellipsis o'rniga) */
@media (max-width: 400px) {
  .topbar h1 { font-size: .95rem; line-height: 1.15; white-space: normal;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
}
/* Jurnal: ism ustuni telefonda biroz kengroq — "Muhammadali" o'rtasidan bo'linmasin */
@media (max-width: 999px) {
  .jg-name { min-width: 124px; max-width: 124px; font-size: .74rem; }
}

/* ===================== DAVOMAT 5-TO'PLAM ===================== */
/* Sahifa sarlavhasi (h2) har doim ekran o'qigichga ochiq: h1 → h3 sakramasin (ko'rinmas, joy olmaydi) */
.page-head h2 { display: block; position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Tugagan qatordagi holat tugmasi: fokus halqasi sahifadan ajralib tursin (oldin deyarli ko'rinmasdi) */
.rt-status:focus-visible { outline: 2px solid var(--gold); }
:root[data-theme="light"] .rt-status:focus-visible { outline-color: var(--gold-ink); }
/* Xabar vaqti */
.tg-time { color: var(--muted); }
/* Tor ekranda sana yozuvi qirqilmaydi — ikki qatorga o'tadi */
@media (max-width: 400px) {
  .daybar-label, .daybar-sub { white-space: normal; overflow: visible; text-overflow: clip; text-align: center; }
}

/* ===================== DAVOMAT: FILTR, GURUH TUGMALARI, ESLATMA, QO'NG'IROQ ===================== */
.today-seg { margin: 12px 0 2px; }
.group-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 100%; }
.group-title .group-acts { overflow: visible; text-overflow: clip; white-space: normal; }
.nudge {
  display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin: 12px 0 0; padding: 10px 13px;
  border-radius: var(--r-sm); font-weight: 700; font-size: .86rem; line-height: 1.45; color: var(--gold-ink);
  background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
}
.nudge > span { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.nudge > span svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.nudge .btn { min-height: 36px; }
.tel-link { color: inherit; text-decoration: none; font-weight: inherit; }
.tel-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tel-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  color: var(--green-ink); background: color-mix(in srgb, var(--green) 14%, transparent); flex: none; }
.tel-ico svg { width: 15px; height: 15px; }
@media (pointer: coarse) {
  .tel-ico { width: 44px; height: 44px; margin: -7px -3px; }
  .tel-link { display: inline-flex; align-items: center; min-height: 44px; }
  .nudge .btn { min-height: 44px; }
}
/* Eng tor telefon (320px): "Hammasi / Kutilmoqda / Markazda" bir qatorga sig'maydi — son yozuv ostida */
.today-seg .seg-btn { min-width: 0; }
@media (max-width: 359px) {
  .today-seg .seg-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 2px; font-size: .82rem; }
  .today-seg .seg-n { margin-left: 0; }
}
