/* ===== SoftNeed Vazifa ===== */

html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"]{color-scheme:light}

/* --- Tungi rejim (default) --- */
:root{
  --bg:#000000;
  --surface:#141416;
  --surface-2:#1E1E22;
  --surface-3:#2A2A30;
  --border:#26262C;
  --text:#FFFFFF;
  --muted:#8A8A96;
  --muted-2:#5E5E68;
  --accent:#7B68EE;
  --accent-soft:rgba(123,104,238,.18);
  --shadow:0 8px 26px rgba(0,0,0,.6);
  --grid-head:#1A1A1E;
  --grid-sticky:#131317;
  --grid-wknd:#241A1A;
}

/* --- Kunduzgi rejim --- */
html[data-theme="light"]{
  --bg:#F5F5F7;
  --surface:#FFFFFF;
  --surface-2:#FFFFFF;
  --surface-3:#EDEDF0;
  --border:#E2E2E8;
  --text:#16161A;
  --muted:#71717D;
  --muted-2:#A0A0AC;
  --accent:#6455D6;
  --accent-soft:rgba(100,85,214,.12);
  --shadow:0 6px 20px rgba(0,0,0,.10);
  --grid-head:#EFEFF3;
  --grid-sticky:#FAFAFC;
  --grid-wknd:#FBEDEB;
}

/* holat ranglari — ikkala rejimda ham bir xil */
:root{
  --active:#F5B301;   /* jarayonda — sariq */
  --done:#25B36B;     /* bajarilgan — yashil */
  --failed:#E8543F;   /* bajarilmagan — qizil */
  --r-sm:10px; --r:14px; --r-lg:20px; --r-xl:26px;
  --font:-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,'Helvetica Neue',Arial,sans-serif;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  background:var(--bg);color:var(--text);font-family:var(--font);
  font-size:15px;line-height:1.45;
  padding-bottom:calc(20px + env(safe-area-inset-bottom));
  transition:background .2s,color .2s;
}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font-family:inherit;font-size:inherit}
*{scrollbar-width:none}
*::-webkit-scrollbar{width:0;height:0;display:none}

.wrap{max-width:760px;margin:0 auto;padding:0 16px}
.row{display:flex;align-items:center;gap:10px}
.stack{display:flex;flex-direction:column;gap:12px}
.spacer{flex:1}
.muted{color:var(--muted)}
.small{font-size:13px}
.tiny{font-size:11.5px}
.center{text-align:center}

/* ---------- Header ---------- */
.appbar{position:sticky;top:0;z-index:40;background:var(--bg);
  padding:calc(env(safe-area-inset-top) + 12px) 16px 8px}
.appbar-top{display:flex;align-items:center;gap:10px}
.appbar h1{font-size:25px;font-weight:800;margin:0;letter-spacing:-.5px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.appbar .sub{font-size:12.5px;color:var(--muted);margin-top:2px}
.iconbtn{width:38px;height:38px;border-radius:50%;border:none;background:transparent;
  color:var(--muted);display:grid;place-items:center;cursor:pointer;flex:none}
.iconbtn:active{background:var(--surface-2)}
.avatar{width:40px;height:40px;border-radius:50%;background:var(--accent);color:#fff;
  display:grid;place-items:center;font-weight:800;font-size:14px;flex:none;
  position:relative;overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar.sm{width:28px;height:28px;font-size:11px}
.avatar.xs{width:22px;height:22px;font-size:9.5px}
.avatar.tinted{background:var(--surface-3);color:var(--text)}

/* ---------- Tungi/kunduzgi tugma (Telegram uslubi) ---------- */
.themesw{width:50px;height:29px;border-radius:15px;background:var(--surface-3);
  border:none;position:relative;cursor:pointer;flex:none;transition:background .22s;padding:0}
.themesw i{position:absolute;top:3px;left:3px;width:23px;height:23px;border-radius:50%;
  background:var(--accent);display:grid;place-items:center;font-size:12px;font-style:normal;
  transition:transform .22s cubic-bezier(.4,0,.2,1)}
html[data-theme="light"] .themesw i{transform:translateX(21px)}
.themesw i::after{content:'🌙'}
html[data-theme="light"] .themesw i::after{content:'☀️'}

/* ---------- Kartalar ---------- */
.card{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r);padding:15px}
.list{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);overflow:hidden}
.list-row{display:flex;align-items:center;gap:12px;padding:15px 16px;border-bottom:1px solid var(--border)}
.list-row:last-child{border-bottom:none}
.list-row:active{background:var(--surface-3)}
.list-row .title{font-weight:600;font-size:15.5px}
.list-row .meta{font-size:12.5px;color:var(--muted);margin-top:3px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chev{color:var(--muted-2);font-size:20px}
.count{color:var(--muted);font-size:14px;font-weight:600}

.section-head{display:flex;align-items:center;gap:8px;padding:18px 2px 9px}
.section-head h2{font-size:13.5px;font-weight:700;color:var(--muted);margin:0;letter-spacing:.4px}

/* ---------- Vazifa qatori ---------- */
.task{display:flex;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border);align-items:flex-start}
.task:last-child{border-bottom:none}
.task:active{background:var(--surface-3)}
.dot{width:11px;height:11px;border-radius:50%;flex:none;margin-top:6px}
.task .t-title{font-weight:600;font-size:15px}
.task.done .t-title{color:var(--muted)}
.task .t-meta{font-size:12.5px;color:var(--muted);margin-top:4px;display:flex;gap:9px;flex-wrap:wrap;align-items:center}

/* ---------- Holat belgilari ---------- */
.badge{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:700;
  padding:3px 10px;border-radius:20px;background:var(--surface-3);color:var(--muted)}
.badge.active{background:rgba(245,179,1,.16);color:#C89400}
.badge.done{background:rgba(37,179,107,.16);color:#189254}
.badge.failed{background:rgba(232,84,63,.16);color:#D0402B}
html[data-theme="dark"] .badge.active,:root .badge.active{color:#FFD05C}
html[data-theme="light"] .badge.active{color:#9A7200}
html[data-theme="light"] .badge.done{color:#137A45}
html[data-theme="light"] .badge.failed{color:#B7331F}
:root .badge.done{color:#4FD98F}
:root .badge.failed{color:#FF8873}

.bar{height:7px;border-radius:7px;background:var(--surface-3);overflow:hidden;display:flex}
.bar > i{display:block;height:100%}

/* ---------- Tugmalar ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;
  background:var(--accent);color:#fff;border:none;border-radius:var(--r);
  padding:14px 18px;font-weight:700;font-size:15px;cursor:pointer;width:100%}
.btn:active{opacity:.85}
.btn.ghost{background:var(--surface-2);color:var(--text);border:1px solid var(--border)}
.btn.green{background:var(--done)}
.btn.danger{background:rgba(232,84,63,.15);color:#D0402B;border:1px solid rgba(232,84,63,.3)}
:root .btn.danger{color:#FF8873}
.btn.sm{padding:10px 15px;font-size:13.5px;width:auto;border-radius:11px}
.btn:disabled{opacity:.45}

/* ---------- Formalar ---------- */
.field{margin-bottom:15px}
.field label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:6px;font-weight:600}
.inp{width:100%;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r);
  padding:13px 14px;color:var(--text);outline:none}
.inp:focus{border-color:var(--accent)}
.inp-color{width:58px;height:46px;padding:4px;background:var(--surface-2);
  border:1px solid var(--border);border-radius:12px}
.errors{color:#D0402B;font-size:12.5px;margin-top:5px}
:root .errors{color:#FF8873}
.help{color:var(--muted);font-size:12px;margin-top:5px}
.filebtn{display:flex;align-items:center;gap:10px;background:var(--surface-3);
  border:1px dashed var(--border);border-radius:var(--r);padding:15px;cursor:pointer;font-weight:600}
.filebtn input{display:none}
.attach-previews{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.attach-previews:empty{margin-top:0}
.attach-thumb{width:72px;height:72px;object-fit:cover;border-radius:10px;border:1px solid var(--border)}
.file-chip{display:inline-flex;align-items:center;gap:6px;background:var(--surface-3);
  border:1px solid var(--border);border-radius:20px;padding:7px 13px;font-size:12.5px;
  font-weight:600;color:var(--text);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.photo-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.photo-gallery img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:12px}
.file-list{display:flex;flex-direction:column;gap:8px;align-items:flex-start}

/* ---------- Tablar ---------- */
.tabs{display:flex;gap:8px;overflow-x:auto;padding:4px 0 12px}
.tab{white-space:nowrap;padding:9px 16px;border-radius:20px;background:var(--surface-2);
  border:1px solid var(--border);color:var(--muted);font-size:13.5px;font-weight:600;cursor:pointer}
.tab.on{background:var(--accent);color:#fff;border-color:var(--accent)}

/* ---------- Yon tortma menyu (chapdan ochiladi) ---------- */
.nb.top{position:absolute;top:1px;right:1px;min-width:16px;height:16px;border-radius:9px;
  background:var(--failed);color:#fff;font-size:9.5px;font-weight:800;
  display:grid;place-items:center;padding:0 4px}
.drawer-bg{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:60;
  opacity:0;pointer-events:none;transition:opacity .22s}
.drawer-bg.show{opacity:1;pointer-events:auto}
.drawer{position:fixed;top:0;bottom:0;left:0;width:78%;max-width:300px;z-index:61;
  background:var(--surface);box-shadow:var(--shadow);display:flex;flex-direction:column;
  padding:calc(env(safe-area-inset-top) + 18px) 0 calc(18px + env(safe-area-inset-bottom));
  transform:translateX(-105%);transition:transform .25s cubic-bezier(.4,0,.2,1);
  overflow-y:auto}
.drawer.show{transform:translateX(0)}
.drawer-head{display:flex;align-items:center;gap:12px;padding:0 20px 18px;
  border-bottom:1px solid var(--border);margin-bottom:8px}
.drawer-item{display:flex;align-items:center;gap:14px;padding:14px 20px;
  color:var(--text);font-weight:600;font-size:15px}
.drawer-item svg{flex:none;color:var(--muted)}
.drawer-item:active{background:var(--surface-3)}
.drawer-item.on{background:var(--accent-soft);color:var(--accent)}
.drawer-item.on svg{color:var(--accent)}

/* ---------- Sheet ---------- */
.sheet-bg{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:60}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:61;background:var(--surface);
  border-radius:22px 22px 0 0;max-height:88vh;overflow:auto;
  padding:6px 0 calc(20px + env(safe-area-inset-bottom))}
.sheet-head{display:flex;align-items:center;justify-content:center;position:relative;padding:16px}
.sheet-head h3{margin:0;font-size:18px;font-weight:800}
.sheet-head .x{position:absolute;right:14px;top:12px;width:34px;height:34px;border-radius:50%;
  background:var(--surface-3);display:grid;place-items:center;color:var(--muted)}
.sheet .opt{display:flex;align-items:center;gap:14px;padding:15px 18px}
.sheet .opt:active{background:var(--surface-3)}
.sheet .opt .ico{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;
  font-size:20px;flex:none;color:#fff}

/* ---------- Bo'sh holat ---------- */
.empty{text-align:center;padding:52px 20px;color:var(--muted)}
.empty .big{font-size:50px;opacity:.3;margin-bottom:14px}
.empty h3{color:var(--text);font-size:18px;margin:0 0 6px}

/* ---------- Toast ---------- */
.toasts{position:fixed;left:16px;right:16px;bottom:calc(env(safe-area-inset-bottom) + 24px);z-index:70;
  display:flex;flex-direction:column;gap:8px;pointer-events:none}
.toast{background:var(--surface-3);border:1px solid var(--border);border-radius:12px;
  padding:12px 15px;font-size:14px;box-shadow:var(--shadow);animation:sl .25s ease}
.toast.ok{border-left:3px solid var(--done)}
.toast.err{border-left:3px solid var(--failed)}
@keyframes sl{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ---------- Kirish sahifasi ---------- */
.auth{min-height:100vh;display:flex;flex-direction:column;justify-content:center;
  padding:32px 22px;max-width:440px;margin:0 auto}
.auth .logo{width:62px;height:62px;border-radius:18px;background:var(--accent);color:#fff;
  display:grid;place-items:center;font-size:28px;margin-bottom:22px}
.auth h1{font-size:28px;font-weight:800;margin:0 0 6px;letter-spacing:-.6px}
.auth p.lead{color:var(--muted);margin:0 0 26px}

/* ---------- Dashboard ---------- */
.kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.kpi{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r);padding:15px}
.kpi .v{font-size:27px;font-weight:800;letter-spacing:-.5px}
.kpi .k{font-size:12px;color:var(--muted);margin-top:2px}
.chartbox{background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--r-lg);padding:17px;margin-top:12px}
.chartbox h3{margin:0 0 14px;font-size:15px;font-weight:700}
.chart-wrap{position:relative;width:100%}
.chart-wrap canvas{position:absolute;left:0;top:0;width:100% !important;height:100% !important}
.legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:14px;font-size:12.5px;color:var(--muted)}
.legend i{width:11px;height:11px;border-radius:3px;display:inline-block;margin-right:6px}

/* ---------- Jadval (faqat kompyuter) ---------- */
body.gridpage{position:fixed;inset:0;display:flex;flex-direction:column;
  height:100%;overflow:hidden;padding:0;padding-bottom:0}
.gridbar{display:flex;gap:9px;align-items:center;padding:12px 16px;flex-wrap:wrap;flex:none;
  border-bottom:1px solid var(--border);background:var(--surface);position:sticky;top:0;z-index:6}
.gridwrap{flex:1;min-height:0;overflow:auto;
  scrollbar-width:auto;scrollbar-color:var(--muted-2) var(--surface-2)}
.gridwrap::-webkit-scrollbar{width:13px;height:13px}
.gridwrap::-webkit-scrollbar-track{background:var(--surface-2)}
.gridwrap::-webkit-scrollbar-thumb{background:var(--muted-2);border-radius:7px;
  border:3px solid var(--surface-2)}
.gridwrap::-webkit-scrollbar-thumb:hover{background:var(--muted)}
.gridwrap::-webkit-scrollbar-corner{background:var(--surface-2)}
table.xl{border-collapse:separate;border-spacing:0;font-size:13px;min-width:max-content}
table.xl th,table.xl td{border-right:2px solid var(--border);border-bottom:2px solid var(--border);
  padding:0;background:var(--surface);white-space:nowrap}
table.xl thead th{position:sticky;top:0;z-index:3;background:var(--grid-head);
  font-weight:700;color:var(--muted);padding:7px 10px;font-size:11.5px;text-align:center}
table.xl thead tr.monthrow th.monthhead{height:27px;box-sizing:border-box;
  overflow:hidden;text-overflow:ellipsis;border-right:3px solid var(--muted-2)}
table.xl thead tr.dayrow th{top:27px}
table.xl thead th.wknd{background:var(--grid-wknd)}
table.xl th.mend,table.xl td.mend{border-right:3px solid var(--muted-2)}
table.xl td.st,table.xl th.st{position:sticky;z-index:2;background:var(--grid-sticky)}
table.xl thead th.st{z-index:5}
table.xl input,table.xl select{background:transparent;border:none;color:var(--text);
  padding:9px 10px;width:100%;outline:none;font-size:13px}
table.xl input:focus,table.xl select:focus{background:var(--accent-soft);
  box-shadow:inset 0 0 0 1.5px var(--accent)}
table.xl select option{background:var(--surface);color:var(--text)}
td.day{width:28px;min-width:28px;text-align:center;cursor:pointer}
td.day.on{background:var(--active)}
td.day.on.s-done{background:var(--done)}
td.day.on.s-failed{background:var(--failed)}
td.day.today{box-shadow:inset 0 0 0 1.5px var(--accent)}
table.xl input[readonly]{cursor:pointer;text-overflow:ellipsis}
.gridmodal-bg{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:80;display:none}
.gridmodal-bg.show{display:block}
.gridmodal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:81;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  padding:20px;width:92%;max-width:480px;display:none;box-shadow:var(--shadow)}
.gridmodal.show{display:block}
.gridmodal h3{margin:0 0 12px;font-size:16px;font-weight:800}
.gridmodal textarea{width:100%;background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--r);padding:12px;color:var(--text);font:inherit;resize:vertical;outline:none}
.gridmodal textarea:focus{border-color:var(--accent)}
/* Telefon jadvali: kartalar + vaqt chizig'i */
.mgrid{display:none}
.mrow{display:flex;gap:10px;align-items:flex-start;width:100%;text-align:left;background:none;border:0;
  border-bottom:1px solid var(--border);padding:13px 14px;color:var(--text);font:inherit;cursor:pointer}
.mrow:last-child{border-bottom:none}
.mrow:active{background:var(--surface-3)}
.mnum{width:22px;flex:none;color:var(--muted);font-size:12px;font-weight:700;padding-top:2px}
.mrow .mt{display:block;font-weight:600;font-size:14.5px;line-height:1.35}
.mrow .mm{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:12.5px;color:var(--muted);margin-top:4px}
.mline{display:block;position:relative;height:8px;border-radius:4px;background:var(--surface-3);margin-top:9px;overflow:hidden}
.mline i{position:absolute;top:0;bottom:0;border-radius:4px}
.mline b{position:absolute;top:-2px;bottom:-2px;width:2px;background:var(--accent);margin-left:-1px}
@media(max-width:900px){
  .gridwrap,.gridbar{display:none}
  .mgrid{display:block;flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}
  .only-desktop{display:none !important}
}
@media(min-width:901px){
  .only-mobile{display:none !important}
}

@media(min-width:640px){
  .kpis{grid-template-columns:repeat(4,1fr)}
}

/* ---------- Jamoa chat — qotgan (statik) app-shell joylashuv ---------- */
body.chatpage{position:fixed;inset:0;display:flex;flex-direction:column;
  height:100%;overflow:hidden;padding-bottom:0}
body.chatpage .appbar{flex:none}
body.chatpage main.wrap{flex:1;min-height:0;display:flex;flex-direction:column;
  margin:0;padding:0;max-width:none;width:100%;overflow:hidden;position:relative}
.chat-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;display:flex;flex-direction:column;gap:2px;
  padding:10px 8px calc(var(--input-bar-h,120px) + 14px);
  max-width:760px;margin:0 auto;width:100%}
.chat-date-divider{align-self:center;background:var(--surface-3);color:var(--muted);
  font-size:11px;font-weight:700;padding:4px 12px;border-radius:20px;margin:12px 0}
.chat-msg{display:flex;width:100%;gap:8px;align-items:flex-end;padding:3px 0;
  justify-content:flex-start}
.chat-msg.mine{justify-content:flex-end}
.chat-avatar{width:28px;height:28px;border-radius:50%;background:var(--surface-3);
  display:grid;place-items:center;font-size:10.5px;font-weight:800;flex:none;
  position:relative;cursor:pointer;overflow:hidden}
.chat-avatar img{width:100%;height:100%;object-fit:cover}
.status-dot{position:absolute;bottom:-1px;right:-1px;width:9px;height:9px;border-radius:50%;
  border:2px solid var(--bg);background:var(--failed)}
.status-dot.on{background:#25B36B}
.chat-bubble{max-width:78%;background:var(--surface-2);border:1px solid var(--border);
  border-radius:16px;padding:8px 12px;user-select:none;-webkit-user-select:none;
  -webkit-touch-callout:none;touch-action:pan-y}
.chat-msg.mine .chat-bubble{background:var(--accent);color:#fff;border-color:transparent}
.chat-author{font-size:11.5px;font-weight:700;color:var(--accent);margin-bottom:2px;cursor:pointer}
.reply-quote{display:flex;flex-direction:column;gap:1px;background:rgba(0,0,0,.15);
  border-left:3px solid var(--accent);border-radius:6px;padding:5px 8px;margin-bottom:6px;
  cursor:pointer}
.reply-quote:active{opacity:.7}
.chat-msg.mine .reply-quote{background:rgba(255,255,255,.15);border-left-color:#fff}
.reply-quote-author{font-size:11px;font-weight:700;color:var(--accent)}
.chat-msg.mine .reply-quote-author{color:#fff}
.reply-quote-text{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-msg.mine .reply-quote-text{color:rgba(255,255,255,.8)}
.flash-highlight{animation:flashHighlight 1.2s ease}
@keyframes flashHighlight{
  0%,100%{box-shadow:none}
  20%,60%{box-shadow:0 0 0 3px var(--accent)}
}
.chat-body .photo-gallery{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));max-width:260px}
.chat-body .file-list{margin-top:2px}
.chat-text{font-size:14.5px;line-height:1.4;white-space:pre-line}
.chat-meta{display:flex;align-items:center;gap:6px;margin-top:4px;font-size:10.5px;
  color:var(--muted);justify-content:flex-end}
.chat-msg.mine .chat-meta{color:rgba(255,255,255,.75)}
.chat-tick{color:var(--muted-2)}
.chat-tick.read{color:#4FD98F}
.chat-msg.mine .chat-tick{color:rgba(255,255,255,.6)}
.chat-msg.mine .chat-tick.read{color:#fff}
.chat-edit-area{width:100%;min-width:200px;background:var(--surface);color:var(--text);
  border:1px solid var(--border);border-radius:10px;padding:8px 10px;font-size:14px;
  user-select:text;-webkit-user-select:text}
.chat-edit-actions{display:flex;gap:8px;margin-top:8px}

/* uzoq bosilganda chiqadigan tahrirlash/o'chirish menyusi — sheet-bg/.sheet dan foydalanadi */
.photo-item{position:relative}
.photo-dl{position:absolute;bottom:5px;right:5px;width:24px;height:24px;border-radius:50%;
  background:rgba(0,0,0,.55);color:#fff;display:grid;place-items:center;font-size:12px}
.voice-player{display:flex;align-items:center;gap:8px;min-width:170px;max-width:230px}
.voice-audio{display:none}
.voice-play{width:32px;height:32px;border-radius:50%;background:var(--accent);color:#fff;
  border:none;flex:none;display:grid;place-items:center;cursor:pointer;padding:0}
.voice-play svg{margin-left:1px}
.voice-play .ico-pause{margin-left:0}
.chat-msg.mine .voice-play{background:#fff;color:var(--accent)}
.voice-wave{flex:1;display:flex;align-items:center;gap:2px;height:22px;min-width:70px}
.voice-wave i{flex:1;min-width:2px;border-radius:2px;background:var(--muted-2);
  height:28%;transition:height .1s ease}
.chat-msg.mine .voice-wave i{background:rgba(255,255,255,.55)}
.voice-time{font-size:10px;color:var(--muted);flex:none}
.chat-msg.mine .voice-time{color:rgba(255,255,255,.75)}
.chat-location{display:flex;align-items:center;gap:6px;font-size:13.5px;font-weight:600;
  color:var(--accent)}
.chat-msg.mine .chat-location{color:#fff;text-decoration:underline}

.chat-input-bar{position:fixed;left:0;right:0;bottom:0;z-index:44;
  background:var(--surface);border-top:1px solid var(--border);
  padding:8px 12px calc(8px + env(safe-area-inset-bottom));
  transition:top .12s ease-out}
.lightbox-btn{position:fixed;top:calc(env(safe-area-inset-top) + 14px);z-index:81;
  width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.15);
  color:#fff;border:none;display:grid;place-items:center;font-size:16px}
.reply-preview{display:flex;align-items:center;gap:10px;max-width:760px;margin:0 auto 8px;
  background:var(--surface-3);border-radius:10px;padding:7px 10px}
.reply-preview-bar{width:3px;align-self:stretch;border-radius:2px;background:var(--accent);flex:none}
.reply-preview-body{flex:1;min-width:0}
.reply-preview-author{font-size:12px;font-weight:700;color:var(--accent)}
.reply-preview-text{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reply-preview-close{width:26px;height:26px;border-radius:50%;background:transparent;
  border:none;color:var(--muted);flex:none;display:grid;place-items:center;font-size:13px}
.chat-pending{display:flex;flex-wrap:wrap;gap:6px;max-width:760px;margin:0 auto}
.chat-pending:not(:empty){margin-bottom:8px}
.pending-chip{position:relative;display:inline-flex;align-items:center}
.pending-chip i{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:50%;
  background:var(--failed);color:#fff;font-style:normal;font-size:10px;display:grid;
  place-items:center;cursor:pointer}
.pending-chip.file-chip i{position:static;margin-left:6px}
.chat-input-row{display:flex;align-items:flex-end;gap:4px;max-width:760px;margin:0 auto}
.chat-textarea{flex:1;resize:none;max-height:120px;background:var(--surface-3);
  border:1px solid var(--border);border-radius:20px;padding:10px 16px;color:var(--text);
  font-size:14.5px;outline:none;line-height:1.35}
.chat-textarea:focus{border-color:var(--accent)}
.chat-send-btn{width:40px;height:40px;border-radius:50%;background:var(--accent);color:#fff;
  border:none;font-size:16px;flex:none;cursor:pointer;display:grid;place-items:center}
.chat-send-btn:disabled{opacity:.5}
.chat-recording{display:flex;align-items:center;gap:10px;max-width:760px;margin:0 auto;
  padding:9px 6px;font-size:14px;font-weight:600}
.chat-rec-dot{width:11px;height:11px;border-radius:50%;background:var(--failed);
  animation:recpulse 1s infinite}
@keyframes recpulse{50%{opacity:.25}}
.chat-rec-cancel{color:var(--failed);font-weight:700;cursor:pointer}

/* ===== Sahifalar orasida silliq o'tish (Chrome 126+, Safari 18.2+) — ilova kabi ===== */
@view-transition { navigation: auto; }
/* Sarlavha va pastki panel o'z joyida turadi — ular hech qachon ustma-ust aralashmaydi */
.appbar { view-transition-name: appbar; }
.tabbar { view-transition-name: tabbar; }
::view-transition-group(appbar), ::view-transition-group(tabbar) { animation: none; }
::view-transition-old(appbar), ::view-transition-old(tabbar) { display: none; }
::view-transition-new(appbar), ::view-transition-new(tabbar) { animation: none; }
/* Odatiy (tablar orasida, forma yuborilgach): bir zumda, toza almashadi —
   eski va yangi sahifa bir vaqtda yarim shaffof bo'lib "pir-pir" qilmaydi */
::view-transition-old(root) { display: none; }
::view-transition-new(root) { animation: none; }
/* Ichkariga (loyiha -> vazifa): yangi sahifa o'ngdan suriladi, eski biroz chapga ketadi */
html:active-view-transition-type(oldinga)::view-transition-old(root) { display: block; animation: 240ms cubic-bezier(.2,.8,.2,1) both vt-chapga; }
html:active-view-transition-type(oldinga)::view-transition-new(root) { animation: 240ms cubic-bezier(.2,.8,.2,1) both vt-ongdan; }
/* Ortga: joriy sahifa o'ngga chiqib ketadi, ostidan oldingisi ko'rinadi */
html:active-view-transition-type(orqaga)::view-transition-old(root) { display: block; z-index: 2; animation: 220ms cubic-bezier(.3,.7,.2,1) both vt-ongga; }
html:active-view-transition-type(orqaga)::view-transition-new(root) { animation: 220ms cubic-bezier(.3,.7,.2,1) both vt-chapdan; }
@keyframes vt-ongdan { from { transform: translateX(100%); } }
@keyframes vt-chapga { to { transform: translateX(-25%); filter: brightness(.7); } }
@keyframes vt-ongga { to { transform: translateX(100%); } }
@keyframes vt-chapdan { from { transform: translateX(-25%); filter: brightness(.7); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
/* bosilganda darhol javob — mobil brauzerning 300ms kutishi va ko'k chaqnashi yo'q */
a, button, .kpi, .list-row, .task { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* ===== 2026-09-29: yangi navigatsiya — sarlavha + ortga tugmasi + pastki panel ===== */
.appbar-title{flex:1;min-width:0}
/* Sarlavha: kerak bo'lsa 2 qator, lekin so'z o'rtasidan bo'linmaydi (oldin "Bildirishnomala|r") */
.appbar h1{font-size:clamp(18px,5.2vw,22px);line-height:1.2;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;
  -webkit-box-orient:vertical;overflow:hidden;overflow-wrap:normal;word-break:normal;hyphens:none}
.appbar .iconbtn.ortga{margin-left:-8px;color:var(--text);width:40px;height:40px}
.appbar .avatar{width:36px;height:36px;font-size:13px}
.appbar .avatar.faol{box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--accent)}

body.tabbarli{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:45;display:flex;justify-content:space-around;
  align-items:stretch;background:color-mix(in srgb,var(--surface) 92%,transparent);
  -webkit-backdrop-filter:saturate(1.6) blur(14px);backdrop-filter:saturate(1.6) blur(14px);
  border-top:1px solid var(--border);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
.tabbar a{flex:1;max-width:120px;display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:4px 0;color:var(--muted);font-size:11px;font-weight:600;border-radius:12px;position:relative}
.tabbar a svg{display:block}
.tabbar a.on{color:var(--accent)}
.tabbar a:active{background:var(--surface-3)}
.tabbar .tab-plus{justify-content:center}
.tabbar .tab-plus i{width:48px;height:40px;border-radius:14px;background:var(--accent);color:#fff;
  display:grid;place-items:center;box-shadow:0 4px 14px var(--accent-soft)}
.tabnb{position:absolute;top:0;left:calc(50% + 6px);min-width:17px;height:17px;border-radius:9px;
  background:var(--failed);color:#fff;font-size:10px;font-weight:800;display:grid;place-items:center;padding:0 4px}
.toasts{bottom:calc(env(safe-area-inset-bottom) + 24px)}
body.tabbarli .toasts{bottom:calc(env(safe-area-inset-bottom) + 86px)}
@media(min-width:900px){
  /* kompyuterda pastki panel ixcham, markazda */
  .tabbar{left:50%;right:auto;transform:translateX(-50%);width:520px;bottom:14px;border:1px solid var(--border);
    border-radius:20px;box-shadow:var(--shadow);padding:6px}
  body.tabbarli{padding-bottom:100px}
}

/* ---------- Umumiy qo'shimchalar ---------- */
.seg{display:flex;gap:6px;overflow-x:auto;padding:2px 0 12px;margin:0 -16px;padding-left:16px;padding-right:16px}
.seg a{white-space:nowrap;padding:8px 14px;border-radius:20px;background:var(--surface-2);border:1px solid var(--border);
  color:var(--muted);font-size:13.5px;font-weight:700;display:inline-flex;gap:6px;align-items:center}
.seg a b{font-weight:800;color:var(--text);opacity:.75}
.seg a.on{background:var(--text);color:var(--bg);border-color:var(--text)}
.seg a.on b{color:var(--bg)}
.seg a.s-failed.on{background:var(--failed);border-color:var(--failed);color:#fff}
.seg a.s-active.on{background:var(--active);border-color:var(--active);color:#16161A}
.seg a.s-done.on{background:var(--done);border-color:var(--done);color:#fff}
.seg a.on b{color:inherit;opacity:.85}
.filtrlar{display:flex;gap:8px;margin-bottom:10px}
.filtrlar select{flex:1;min-width:0;padding:10px 12px;font-size:13.5px;border-radius:12px}
.amallar{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}
.amal{display:flex;flex-direction:column;align-items:center;gap:6px;padding:13px 6px;border-radius:var(--r);
  background:var(--surface-2);border:1px solid var(--border);font-size:12.5px;font-weight:700;text-align:center}
.amal .i{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;font-size:18px;background:var(--accent-soft)}
.amal.asosiy{background:var(--accent);border-color:var(--accent);color:#fff}
.amal.asosiy .i{background:rgba(255,255,255,.2)}
.amal:active{opacity:.8}
.ogoh{display:flex;gap:12px;align-items:center;padding:13px 15px;border-radius:var(--r);margin-bottom:12px;
  background:var(--accent-soft);border:1px solid var(--accent);font-weight:600;font-size:14px}
.stat3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:6px}
.stat3 > a,.stat3 > div{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r);padding:12px}
.stat3 .v{font-size:24px;font-weight:800;letter-spacing:-.5px;line-height:1.1}
.stat3 .k{font-size:11.5px;color:var(--muted);margin-top:3px;font-weight:600}
.task .kim{font-weight:700;color:var(--text);opacity:.85}
.task .muddat.failed{color:var(--failed);font-weight:700}
.task .muddat.today{color:var(--active);font-weight:700}
.halqa{--p:0;width:92px;height:92px;border-radius:50%;flex:none;display:grid;place-items:center;
  background:conic-gradient(var(--done) calc(var(--p)*1%),var(--surface-3) 0)}
.halqa b{width:72px;height:72px;border-radius:50%;background:var(--surface-2);display:grid;place-items:center;
  font-size:21px;font-weight:800}
.sozlama{display:flex;align-items:center;gap:13px;padding:14px 16px;border-bottom:1px solid var(--border);
  font-weight:600;background:none;border-left:0;border-right:0;border-top:0;width:100%;color:var(--text);
  text-align:left;cursor:pointer;font:inherit}
.sozlama:last-child{border-bottom:none}
.sozlama:active{background:var(--surface-3)}
.sozlama .ic{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;font-size:17px;flex:none;background:var(--surface-3)}
.sozlama .spacer + .chev{margin-left:0}
.appbar-top,.appbar > select,.appbar > .legend{max-width:728px;margin-left:auto;margin-right:auto}


/* ===== iOS bosh ekran ilovasi (black-translucent status bar) =====
   Sahifa ekrandan qisqa bo'lsa, iOS ko'rinish balandligini status bar (≈47pt) qadar kam
   hisoblaydi: pastki panel va chat qatori yuqoriga surilib, tagida qora bo'shliq qoladi.
   Hujjatni kamida ekran + status bar balandligida qilish buni yo'qotadi (v13 dan beri, ishlaydi).
   2026-09-29: `bottom:calc(100% - 100lvh)` usuli sinab ko'rildi — iPhone'da bo'shliqni
   KATTALASHTIRDI, qaytarildi. Qaytadan urinmang. */
html{min-height:calc(100% + env(safe-area-inset-top))}
@media (display-mode: standalone){
  body.chatpage, body.gridpage{bottom:auto;height:100vh}
}

/* "+" menyusi: pastdan silliq chiqadi */
.ysheet-bg{animation:ysoya .2s ease both;background:rgba(0,0,0,.32)}
.ysheet{animation:ychiq .26s cubic-bezier(.2,.9,.25,1) both;z-index:62}
.ysheet[hidden],.ysheet-bg[hidden]{display:none}
.ysheet.yopil{animation:ytush .18s ease-in both}
.ysheet-bg.yopil{animation:ysoya .18s ease reverse both}
@keyframes ychiq{from{transform:translateY(100%)}}
@keyframes ytush{to{transform:translateY(100%)}}
@keyframes ysoya{from{opacity:0}}
