/* ============================================================
   PP Designers — professional studio dashboard
   Light + dark themes. Smooth, modern, calm.
   ============================================================ */

/* ---------- LIGHT THEME (default) ---------- */
:root {
  --bg:        #f5f6f9;
  --bg-2:      #ffffff;
  --surface:   #ffffff;
  --surface-2: #ffffff;
  --elev:      #ffffff;
  --line:      #e9eaf0;
  --line-2:    #e1e3ec;

  --ink:       #14161c;
  --ink-2:     #353a45;
  --muted:     #6b7280;
  --faint:     #99a0ad;

  --accent-1:  #6e56cf;
  --accent-2:  #8b6cf0;
  --accent:    linear-gradient(135deg, #7c66e6, #6549c9);
  --accent-ink:#ffffff;
  --accent-soft: color-mix(in srgb, var(--accent-1) 10%, transparent);
  --accent-border: color-mix(in srgb, var(--accent-1) 24%, transparent);

  --free:    #16a34a;
  --working: #2563eb;
  --paused:  #d97706;
  --danger:  #dc2626;
  --gray:    #94a0b8;

  /* legacy aliases (used by app.js inline styles) */
  --gold-1:  var(--accent-1);
  --gold-soft: var(--accent-soft);

  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --shadow:    0 14px 34px -18px rgba(22,28,45,.30);
  --shadow-lg: 0 30px 70px -28px rgba(22,28,45,.40);

  --r:   12px;
  --r-l: 18px;
  --font:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; /* display font */
}

/* ---------- DARK THEME ---------- */
[data-theme="dark"] {
  --bg:        #0b0c10;
  --bg-2:      #101218;
  --surface:   #15171e;
  --surface-2: #171923;
  --elev:      #1c1f29;
  --line:      rgba(255,255,255,.08);
  --line-2:    rgba(255,255,255,.13);

  --ink:       #e9eaf1;
  --ink-2:     #c5c9d4;
  --muted:     #939aac;
  --faint:     #69707f;

  --accent-1:  #9b86f8;
  --accent-2:  #b29cff;
  --accent:    linear-gradient(135deg, #8f78f3, #6f57d8);
  --accent-soft: color-mix(in srgb, var(--accent-1) 18%, transparent);
  --accent-border: color-mix(in srgb, var(--accent-1) 32%, transparent);

  --free:    #34d39a;
  --working: #6f9bff;
  --paused:  #f0b24a;
  --danger:  #f47171;
  --gray:    #6b7280;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 18px 44px -22px rgba(0,0,0,.7);
  --shadow-lg: 0 30px 70px -26px rgba(0,0,0,.75);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
  line-height: 1.5;
  transition: background-color .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 20px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }

.serif { font-family: var(--serif); letter-spacing: -.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tnum  { font-variant-numeric: tabular-nums; }
.gold-text {
  background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* =====================================================================
   CONTROLS: language + theme toggles
   ===================================================================== */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: .18s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--accent-1); box-shadow: var(--shadow-sm); font-weight: 600; }
/* Boʻlim tanlagich: nomi boʻlinib ketmasin va hech bir boʻlim ekrandan
   chiqib qolmasin — sigʻmagani pastki qatorga tushadi. */
.seg--tabs { max-width: 100%; flex-wrap: wrap; }
.seg--tabs button { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 7px; }
.seg--tabs button svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 680px) {
  /* Telefonda belgiga joy yoʻq — nom muhimroq. */
  .seg--tabs button { padding: 8px 11px; }
  .seg--tabs button svg { display: none; }
}
[data-theme="dark"] .seg button.on { background: var(--elev); }
.langseg { padding: 3px; gap: 2px; }
.langseg button { padding: 6px 9px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; }
.langseg.block { display: flex; width: 100%; }
.langseg.block button { flex: 1; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); transition: .18s; }
.iconbtn:hover { color: var(--accent-1); border-color: var(--accent-border); }

/* period / date filter bar */
.periodbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-sm); }
.periodinput { width: auto; padding: 8px 11px; font-size: 13px; color-scheme: light; }
[data-theme="dark"] .periodinput { color-scheme: dark; }
.report-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 15px 18px; border-radius: var(--r-l); border: 1px solid var(--gold-line, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent-1) 9%, var(--surface)), var(--surface) 70%); box-shadow: var(--shadow-sm); }
.report-bar__title { font-family: var(--serif); font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.report-bar__txt { display: flex; flex-direction: column; gap: 3px; }
.report-bar input[type="month"] { color-scheme: light; }
[data-theme="dark"] .report-bar input[type="month"] { color-scheme: dark; }
/* Receipt photos */
.rcpt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.rcpt { position: relative; border: 1px solid var(--line); border-radius: var(--r-m, 12px); overflow: hidden; background: var(--surface-2, var(--surface)); }
.rcpt img { width: 100%; height: 120px; object-fit: cover; display: block; cursor: zoom-in; }
.rcpt__m { font-size: 10.5px; color: var(--muted); padding: 5px 7px; text-align: center; }
.rcpt__del { position: absolute; top: 6px; right: 6px; border: none; background: rgba(20,22,28,.62); color: #fff; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rcpt__del:hover { background: var(--danger, #c0392b); }
.rcpt-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.rcpt-card { position: relative; border: 1px solid var(--line); border-radius: var(--r-m, 12px); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.rcpt-card img { width: 100%; height: 150px; object-fit: cover; display: block; cursor: zoom-in; }
/* The photo arrives only when the tile is scrolled near, so the slot is drawn
   immediately and fills in — rather than the whole board waiting on 30 MB. */
.rcpt-lazy {
  width: 100%; height: 150px; display: block; cursor: zoom-in;
  background: var(--bg) center/cover no-repeat;
  border-bottom: 1px solid var(--line);
  transition: opacity .25s ease; opacity: .55;
}
.rcpt-lazy.is-loaded { opacity: 1; }
.rcpt-lazy.is-failed { opacity: 1; background: var(--bg); }
.rcpt-lazy:not(.is-loaded)::after {
  content: ""; display: block; width: 22px; height: 22px; margin: 64px auto 0;
  border: 2px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-top-color: var(--accent-1); border-radius: 50%;
  animation: rcptspin .7s linear infinite;
}
.rcpt-lazy.is-failed::after { content: "—"; border: 0; animation: none; color: var(--faint); font-size: 18px; }
@keyframes rcptspin { to { transform: rotate(360deg); } }
.rcpt-card__b { padding: 8px 10px; font-size: 12.5px; }
.paste-zone { margin-top: 14px; border: 2px dashed var(--gold-line, var(--line)); border-radius: var(--r-m, 12px); padding: 22px 14px; text-align: center; cursor: pointer; color: var(--accent-1); display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s; }
.paste-zone:hover { background: color-mix(in srgb, var(--accent-1) 7%, var(--surface)); border-color: var(--accent-1); }
.rcpt-preview { margin-top: 14px; }
.rcpt-preview img { width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--r-m, 12px); border: 1px solid var(--line); background: var(--surface-2, var(--surface)); display: block; }
/* Date groups in the orders table */
.daygroup td { background: var(--surface-2, color-mix(in srgb, var(--accent-1) 5%, var(--surface))); font-weight: 700; font-size: 12.5px; letter-spacing: .01em; padding: 9px 14px !important; border-top: 1px solid var(--line); position: sticky; top: 0; }

/* ── Inventory photos ── */
.inv-thumb { width: 38px; height: 38px; flex: none; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; transition: border-color .15s, transform .15s; }
.inv-thumb:hover { border-color: var(--accent-1); transform: scale(1.06); }
.inv-photo-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inv-photo-prev { width: 84px; height: 84px; flex: none; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }

/* Equipment picture cards (designer profile + admin designer profile) */
.invgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 13px; }
.invcard { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--surface); }
.invcard__pic { aspect-ratio: 4/3; background: var(--surface-2, rgba(127,127,127,.08)); display: grid; place-items: center; overflow: hidden; }
.invcard__pic[data-action] { cursor: zoom-in; }
.invcard__pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s; }
.invcard__pic[data-action]:hover img { transform: scale(1.05); }
.invcard__ph { opacity: .3; transform: scale(1.6); }
.invcard__b { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.invcard__b b { font-size: 13px; line-height: 1.3; }
.invcard__b .chip { margin-top: 4px; font-size: 11px; padding: 2px 8px; }
.linkish { cursor: pointer; }
.linkish:hover { color: var(--accent-1); text-decoration: underline; }
.daygroup__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.daygroup__n { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.daygroup__agg { margin-left: auto; display: inline-flex; align-items: center; gap: 14px; }
.daygroup__sum { font-size: 12px; font-weight: 500; color: var(--muted); }
.daygroup__sum b { color: var(--accent-1); font-weight: 800; font-size: 13px; margin-left: 3px; }
.daygroup__w { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 12px; }
.daygroup__w svg { width: 13px; height: 13px; opacity: .8; }
@media (max-width: 600px) { .daygroup__agg { margin-left: 0; width: 100%; gap: 12px; } }
.lightbox { position: fixed; inset: 0; background: rgba(8,9,12,.82); display: flex; align-items: center; justify-content: center; z-index: 2000; cursor: zoom-out; padding: 24px; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 10px; box-shadow: 0 18px 60px rgba(0,0,0,.5); }
/* Presence (online/offline) */
.av { position: relative; }
.pres { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); box-sizing: border-box; }
.pres.on { background: var(--free, #21c07a); box-shadow: 0 0 0 2px color-mix(in srgb, var(--free, #21c07a) 30%, transparent); }
.pres.off { background: var(--muted, #9aa0ab); }
.dcard.is-offline { opacity: .62; }
.dcard.is-offline:hover { opacity: 1; }
.periodrange { display: inline-flex; align-items: center; gap: 8px; }
.periodlabel { margin-left: auto; font-size: 13px; color: var(--muted); }
.periodlabel b { color: var(--ink); }
@media (max-width: 720px) { .periodlabel { margin-left: 0; width: 100%; } }

/* =====================================================================
   LOGIN
   ===================================================================== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; background: var(--bg-2); }
.login__art {
  position: relative; overflow: hidden; color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #6e56cf 0%, #5a3fc0 38%, #3f2d8f 70%, #4a37a8 100%);
  background-size: 220% 220%;
  animation: bgShift 22s ease infinite;
}
.login__art > * { position: relative; z-index: 1; }

/* animated hero background — drifting brand-colour orbs, light sweep, dot grid */
.login-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.login-bg .orb { position: absolute; border-radius: 50%; filter: blur(64px); opacity: .55; mix-blend-mode: screen; will-change: transform; }
.orb.o1 { width: 440px; height: 440px; left: -90px; top: -70px; background: radial-gradient(circle, #8a6cf6, transparent 70%); animation: drift1 26s ease-in-out infinite; }
.orb.o2 { width: 360px; height: 360px; right: -70px; top: 28%; background: radial-gradient(circle, #5b8dff, transparent 70%); animation: drift2 31s ease-in-out infinite; }
.orb.o3 { width: 320px; height: 320px; left: 18%; bottom: -90px; background: radial-gradient(circle, #ef5a7a, transparent 70%); opacity: .42; animation: drift3 35s ease-in-out infinite; }
.orb.o4 { width: 280px; height: 280px; right: 16%; bottom: 8%; background: radial-gradient(circle, #b29cff, transparent 70%); animation: drift1 23s ease-in-out infinite reverse; }
.login-bg .beam { position: absolute; top: -40%; left: -20%; width: 55%; height: 180%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); transform: rotate(18deg); animation: sweep 13s linear infinite; }
.login-bg .grid { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 26px 26px; opacity: .55; animation: gridmove 26s linear infinite; }
@keyframes bgShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,44px) scale(1.12); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-54px,-32px) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(44px,-52px) scale(1.16); } }
@keyframes sweep { 0% { transform: translateX(-40%) rotate(18deg); } 100% { transform: translateX(260%) rotate(18deg); } }
@keyframes gridmove { from { background-position: 0 0; } to { background-position: 26px 26px; } }
.login__hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(32px, 3.6vw, 50px); line-height: 1.08; letter-spacing: -.02em; }
.login__hero p { color: rgba(255,255,255,.82); margin-top: 18px; max-width: 34ch; font-size: 15.5px; }
.login__points { display: flex; flex-direction: column; gap: 14px; }
.login__points div { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.92); font-size: 14.5px; }
.login__points .dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: rgba(255,255,255,.18); flex: none; }
.login__points .dot::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(0,-1px); }

.brand { display: flex; align-items: center; gap: 13px; }
.brand .mono {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 800; font-size: 19px; color: #fff;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
}
.brand .mono svg { width: 54%; height: 54%; }
.mono.logo { background: #fff; border: 0; padding: 5px; overflow: hidden; box-shadow: 0 2px 10px rgba(10, 12, 30, .18); }
.mono.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .name { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.brand .name small { display: block; font-family: var(--font); font-size: 10px; letter-spacing: .26em; opacity: .7; text-transform: uppercase; margin-top: 3px; font-weight: 600; }

.login__form { display: grid; place-items: center; padding: 40px; background: var(--bg-2); }
.login__card { width: min(380px, 100%); }
.login__card .mono.logo { background: #fff; }
.login__card h2 { font-family: var(--serif); font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.login__card .sub { color: var(--muted); margin: 7px 0 26px; font-size: 14.5px; }
.demo-hint { margin-top: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; color: var(--muted); background: var(--bg); line-height: 1.7; }
.demo-hint b { color: var(--ink); }

/* Standing notice on a designer’s equipment page: the kit is company property.
   Amber rather than red — it is a reminder they see every visit, not an error. */
.warnbox {
  border: 1px solid color-mix(in srgb, var(--paused) 42%, transparent);
  background: color-mix(in srgb, var(--paused) 9%, var(--surface));
  border-left: 4px solid var(--paused);
  border-radius: var(--r); padding: 15px 18px;
}
.warnbox__t { font-weight: 800; font-size: 13.5px; letter-spacing: .02em; color: var(--paused); margin-bottom: 6px; }
.warnbox p { font-size: 13.5px; line-height: 1.75; color: var(--ink); margin: 0; }

/* =====================================================================
   FORMS
   ===================================================================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r); font-size: 14.5px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
[data-theme="dark"] .input { background: var(--bg); }
.input::placeholder { color: var(--faint); }
.input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--accent-1); box-shadow: 0 0 0 3.5px var(--accent-soft);
}
textarea.input { resize: vertical; min-height: 80px; }
/* Text the user typed: keep the line breaks they put in. */
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
/* A note box that starts one line tall and grows as you type, so it reads like
   the single-line field it replaced until a second line is actually needed. */
textarea.ml--grow {
  min-height: 0; resize: none; overflow-y: auto; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s, background .2s, border-color .2s, color .2s, opacity .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--gold { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent-1) 80%, transparent); }
.btn--gold:hover { box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent-1) 90%, transparent); transform: translateY(-1px); }
.btn--ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--accent-border); color: var(--accent-1); }
.btn--start  { background: color-mix(in srgb, var(--free) 13%, transparent); border-color: color-mix(in srgb, var(--free) 32%, transparent); color: var(--free); }
.btn--start:hover  { background: color-mix(in srgb, var(--free) 20%, transparent); }
.btn--pause  { background: color-mix(in srgb, var(--paused) 14%, transparent); border-color: color-mix(in srgb, var(--paused) 34%, transparent); color: var(--paused); }
.btn--pause:hover  { background: color-mix(in srgb, var(--paused) 22%, transparent); }
.btn--finish { background: color-mix(in srgb, var(--working) 13%, transparent); border-color: color-mix(in srgb, var(--working) 34%, transparent); color: var(--working); }
.btn--finish:hover { background: color-mix(in srgb, var(--working) 21%, transparent); }
.btn--danger { background: color-mix(in srgb, var(--danger) 11%, transparent); border-color: color-mix(in srgb, var(--danger) 32%, transparent); color: var(--danger); }
.btn[disabled] { opacity: .42; cursor: not-allowed; box-shadow: none; transform: none; }
.btn--sm { padding: 8px 13px; font-size: 13px; }
.btn--block { width: 100%; }

/* =====================================================================
   APP SHELL
   ===================================================================== */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line); background: var(--bg-2);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { padding: 6px 8px 16px; }
.side .brand .mono { width: 40px; height: 40px; font-size: 16px; border-radius: 11px; }
.side .brand .name { font-size: 18px; color: var(--ink); }
.side .brand .name small { color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 500; transition: .15s; position: relative;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav a.active { color: var(--accent-1); background: var(--accent-soft); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 4px; background: var(--accent-1); }
.nav a .ic { width: 18px; display: grid; place-items: center; opacity: .92; }
.side__foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.who { display: flex; align-items: center; gap: 11px; padding: 6px 6px 2px; }
.who .av { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.who .meta { line-height: 1.3; min-width: 0; }
.who .meta b { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.who .meta span { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 30px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); z-index: 20;
}
.topbar h1 { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; font-weight: 500; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.content { padding: 26px 30px 56px; animation: contentfade .3s ease both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes contentfade { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================
   PANELS / CARDS / KPI
   ===================================================================== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-sm); }
.panel__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel__h h3 { font-family: var(--serif); font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.panel__b { padding: 18px 20px; }
/* Wide tables scroll inside their panel instead of overflowing the page. */
.panel__b:has(> .table) { overflow-x: auto; }
.grid { display: grid; gap: 16px; }
.section-title { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 10px; }
.section-title small { font-family: var(--font); font-size: 12.5px; color: var(--muted); font-weight: 500; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 15px; }
/* Yashirilgan boʻlim: `hidden` oʻzi yetarli emas — `.kpis` oʻzining
   `display` i bilan brauzerning qoidasini bosib ketadi. */
[data-att][hidden], [data-set][hidden] { display: none !important; }
.kpi { position: relative; overflow: hidden; padding: 18px 19px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .label::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--accent-1); }
.kpi.good .label::before { background: var(--free); }
.kpi.alt  .label::before { background: var(--working); }
.kpi.warn .label::before { background: var(--paused); }
.kpi .val { font-size: 25px; font-weight: 700; margin-top: 12px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); }
.kpi .val.serif { font-family: var(--serif); }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* designer profile header */
.profilehead { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.profile-av { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; font-weight: 700; font-size: 22px; background: var(--accent); color: #fff; font-family: var(--serif); flex: none; box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent-1) 80%, transparent); }
.profile__name { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }

/* =====================================================================
   STATUS CHIPS
   ===================================================================== */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 7px; color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.chip .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.free    { color: var(--free);    background: color-mix(in srgb, var(--free) 13%, transparent); }
.chip.working { color: var(--working); background: color-mix(in srgb, var(--working) 13%, transparent); }
.chip.paused  { color: var(--paused);  background: color-mix(in srgb, var(--paused) 14%, transparent); }
/* Qoʻlida ochiq vazifasi bor, lekin soati ketmayotgan odam. Pauza rangi shu
   yerda boʻshadi, chunki liveStatus endi "pauzada" qaytarmaydi. */
.chip.busy    { color: var(--paused);  background: color-mix(in srgb, var(--paused) 14%, transparent); }
.chip.created { color: var(--muted);   background: color-mix(in srgb, var(--muted) 13%, transparent); }
.chip.finished{ color: var(--free);    background: color-mix(in srgb, var(--free) 12%, transparent); }
.chip.active  { color: var(--free);    background: color-mix(in srgb, var(--free) 13%, transparent); }
.chip.archived { color: var(--gray); background: color-mix(in srgb, var(--gray) 16%, transparent); }
.chip.cancelled { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.chip.online  { color: var(--working); background: color-mix(in srgb, var(--working) 12%, transparent); }
.chip.offline { color: var(--accent-1); background: var(--accent-soft); }
.pulse .d { animation: pulse 1.7s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 currentColor} 70%{box-shadow:0 0 0 6px transparent} 100%{box-shadow:0 0 0 0 transparent} }

/* =====================================================================
   FLOOR BOARD
   ===================================================================== */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; }

/* designer work card (flexible) */
.worka__body { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.worka__cust { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.worka__cust b { font-size: 14px; color: var(--ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.worka__rows { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; margin-top: 12px; }
.worka__rows > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.worka__rows .muted { font-size: 11px; }
.worka__rows > div > :last-child { font-size: 13.5px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.worka__actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.worka__actions .btn { flex: 1 1 80px; }

/* ── Dizaynerning vazifa taxtasi ─────────────────────────────────────── */
.wbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 26px 0 13px; }
.wbar__a { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Boʻlim rangi — kalit nomi bilan, hex bilan emas, shunda qorongʻi mavzuda ham toʻgʻri chiqadi. */
.wdot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-1); }
.wdot.is-blue  { background: var(--working); }
.wdot.is-green { background: var(--free); }
.wdot.is-amber { background: var(--paused); }
.wdot.is-red   { background: var(--danger); }
.wdot.is-slate { background: var(--gray); }
.wcount { flex: none; min-width: 22px; padding: 1px 7px; border-radius: 20px; background: var(--elev); color: var(--muted); font-size: 11.5px; font-weight: 650; text-align: center; }
.iconbtn--xs { width: 30px; height: 28px; border-radius: 8px; }
.iconbtn--xs svg { width: 15px; height: 15px; }
.iconbtn.on { color: var(--accent-1); border-color: var(--accent-border); background: var(--accent-soft); }

.wfolds { display: flex; flex-direction: column; gap: 11px; }
.wfold { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; }
.wfold__h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; }
.wfold__h:hover { background: var(--elev); }
.wfold__t { flex: 1; min-width: 0; font-weight: 650; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcaret { flex: none; color: var(--muted); font-size: 15px; line-height: 1; transition: transform .16s ease; }
.wfold.is-shut .wcaret { transform: rotate(-90deg); }
.wfold__b { padding: 0 13px 13px; }
.wfold__b .floor { grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); }

.wrail { display: flex; align-items: flex-start; gap: 13px; overflow-x: auto; padding: 2px 2px 13px; scroll-snap-type: x proximity; }
.wcol { flex: 0 0 310px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); scroll-snap-align: start; }
.wcol__h { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.wcol__t { flex: 1; min-width: 0; font-weight: 650; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcol__b { display: flex; flex-direction: column; gap: 11px; padding: 12px; min-height: 92px; }
.wcol__b .dcard { padding: 14px; }
.wcol__b .worka__rows { gap: 9px 12px; }
/* Ustun tor: uchala tugma bitta qatorga sigʻsin, aks holda karta bekorga uzayadi. */
.wcol__b .worka__actions { gap: 6px; }
.wcol__b .worka__actions .btn { flex: 1 1 0; min-width: 0; gap: 5px; padding: 8px 6px; font-size: 12px; }
.wcol--add { flex: 0 0 172px; align-self: stretch; align-items: center; justify-content: center; gap: 7px; color: var(--muted); border-style: dashed; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; min-height: 120px; }
.wcol--add:hover { color: var(--accent-1); border-color: var(--accent-border); }

.worka__pins { flex: none; display: flex; gap: 5px; }
/* Qadalgan vazifa: burchakda kichkina uchburchak — belgisi koʻrinsin, lekin kartani egallamasin. */
.dcard.is-pinned { border-color: var(--accent-border); }
.dcard.is-pinned::after { content: ""; position: absolute; right: 0; top: 0; border-width: 0 17px 17px 0; border-style: solid; border-color: transparent var(--accent-1) transparent transparent; opacity: .5; }

.wswatches { display: flex; gap: 9px; flex-wrap: wrap; }
.wswatch { width: 31px; height: 31px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; background: var(--accent-1); }
.wswatch.on { border-color: var(--ink); }
.wswatch.is-blue  { background: var(--working); }
.wswatch.is-green { background: var(--free); }
.wswatch.is-amber { background: var(--paused); }
.wswatch.is-red   { background: var(--danger); }
.wswatch.is-slate { background: var(--gray); }

.freerow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* Suzuvchi oynadagi boʻlim sarlavhasi */
.pip-group { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 2px 1px; }
.pip-group span { font-weight: 650; letter-spacing: 0; }

/* Admin kartasida bitta dizaynerning qoʻlidagi ishi */
.dtasks { display: flex; flex-direction: column; gap: 7px; }
.dtask { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.dtask__m { flex: 1; min-width: 0; font-size: 13px; }
.dtask__r { flex: none; display: flex; align-items: center; gap: 9px; }
.dtask__r .timer { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .wcol { flex: 0 0 86%; }
  .wcol--add { flex: 0 0 60%; }
}

/* tier / monthly-salary panel */
.tierhead { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.tierpct__num { font-size: 42px; font-weight: 700; line-height: 1; }
.tierfigs { display: flex; gap: 28px; flex-wrap: wrap; }
.tierfigs > div { display: flex; flex-direction: column; gap: 3px; }
.tierfigs .muted { font-size: 12px; }
.tierfigs b { font-size: 17px; }
.tierprog { margin-top: 18px; }
.dcard { position: relative; padding: 17px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; overflow: hidden; }
.dcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gray); opacity: .5; }
.dcard.is-free::before { background: var(--free); opacity: 1; }
.dcard.is-working::before { background: var(--working); opacity: 1; }
.dcard.is-paused::before { background: var(--paused); opacity: 1; }
.dcard.is-busy::before { background: var(--paused); opacity: 1; }
.dcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dcard__top { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.dcard .av { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--accent-soft); color: var(--accent-1); }
.dcard__name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.dcard__sub { font-size: 12px; margin-top: 3px; }
.dcard__orders { display: flex; flex-direction: column; gap: 8px; }
.ordline { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.ordline__t { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ordline__t b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ordline__m { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 12px; color: var(--muted); }
.ordline__m.costrow { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.costnow { color: var(--accent-1); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.timer.run { color: var(--working); }
.empty-free { font-size: 13px; color: var(--free); padding: 12px 0 2px; display: flex; align-items: center; gap: 9px; font-weight: 500; }
.floor-ctl { display: flex; gap: 6px; margin-top: 10px; }
.floor-ctl .btn { flex: 1; padding: 7px 6px; }
.floor-ctl .btn svg { width: 15px; height: 15px; }

/* autocomplete dropdown */
.ac { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 10; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden auto; display: none; max-height: 220px; }
.ac.show { display: block; }
.ac-item { padding: 10px 13px; font-size: 13.5px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover { background: var(--accent-soft); color: var(--accent-1); }

/* =====================================================================
   TABLES
   ===================================================================== */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; }
.table thead th:hover { color: var(--text); }
.table thead th.sorted-asc::after { content: " \25B2"; font-size: 8px; color: var(--accent-1); }
.table thead th.sorted-desc::after { content: " \25BC"; font-size: 8px; color: var(--accent-1); }
/* Clickable order rows/cards → open the order detail */
tr.rowlink { cursor: pointer; }
tbody tr.rowlink:hover td { background: color-mix(in srgb, var(--accent-1) 6%, var(--surface)); }
.ordline.rowlink, .dcard.rowlink { cursor: pointer; }
.ordline.rowlink:hover { background: color-mix(in srgb, var(--accent-1) 6%, var(--surface)); border-radius: 8px; }
/* Order detail modal */
.od-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.od-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; }
.od-f .muted { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.od-f .od-v { font-size: 13.5px; }
.od-note { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 14px; padding: 10px 12px; background: var(--surface-2, color-mix(in srgb, var(--accent-1) 4%, var(--surface))); border-radius: 10px; font-size: 13px; }
.od-sec { margin-top: 16px; }
.od-sec__h { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
/* Clickable KPI + advance list */
.kpi--link { cursor: pointer; transition: border-color .15s, transform .1s; }
.kpi--link:hover { border-color: var(--accent-1); transform: translateY(-1px); }
.adv-list { display: flex; flex-direction: column; gap: 10px; }
.adv-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.adv-row__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.adv-row__note { display: flex; gap: 7px; margin-top: 9px; }
.adv-row__note .input { flex: 1; }
.adv-comment { white-space: pre-wrap; align-items: flex-start; margin-top: 7px; font-size: 12.5px; display: flex; align-items: center; gap: 6px; color: var(--text); }
.adv-comment svg { color: var(--accent-1); flex: 0 0 auto; }
/* Advances grouped by the month they were taken */
.adv-months { display: flex; flex-direction: column; gap: 18px; }
.adv-month__h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 0 2px 7px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.adv-month__name { font-weight: 700; font-size: 13.5px; text-transform: capitalize; }
.adv-month__sum { font-size: 13px; white-space: nowrap; }
.adv-month__sum b { color: var(--accent-1); }
.adv-month__sum .muted { font-size: 12px; }
.od-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; align-items: center; }
.od-actions .btn { white-space: nowrap; flex: 0 0 auto; }
/* Floating always-on-top orders window (Document Picture-in-Picture) */
.pip-root { padding: 10px; background: var(--bg); color: var(--text); font-family: var(--font, system-ui, sans-serif); min-height: 100vh; box-sizing: border-box; }
.pip-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pip-list { display: flex; flex-direction: column; gap: 9px; }
.pip-card { border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 10px; padding: 9px 11px; background: var(--surface); }
.pip-card.is-working { border-left-color: var(--free, #21c07a); }
.pip-card.is-paused { border-left-color: var(--paused, #e0a82e); }
.pip-card__t { font-weight: 600; font-size: 13.5px; }
.pip-card__sub { font-size: 11.5px; color: var(--muted); margin: 2px 0 7px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pip-card__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pip-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; }
.pip-btns { display: flex; gap: 5px; }
.pip-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 0; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table b { color: var(--ink); }
.rank { width: 25px; height: 25px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--muted); }
.rank.r1 { background: var(--accent-soft); color: var(--accent-1); }
.is-arch td:not(:last-child) { opacity: .5; }

/* analytics chart */
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-x { fill: var(--faint); font-size: 11px; text-anchor: middle; font-family: var(--font); }
.chart-max { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-dot { fill: var(--accent-1); }

.bar { height: 7px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 7%, transparent); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 8px; background: var(--accent); }
.bar.alt > i { background: linear-gradient(90deg, var(--working), color-mix(in srgb, var(--working) 60%, #fff)); }

/* =====================================================================
   MODAL
   ===================================================================== */
.modal-bg { position: fixed; inset: 0; background: color-mix(in srgb, var(--ink) 38%, transparent); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 60; padding: 20px; animation: fade .18s; }
.modal { width: min(540px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
.modal .panel__h h3 { font-size: 19px; }
.x { background: transparent; border: 1px solid var(--line-2); color: var(--muted); width: 34px; height: 34px; border-radius: 9px; font-size: 15px; transition: .15s; }
.x:hover { color: var(--ink); border-color: var(--line-2); background: var(--bg); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }

/* =====================================================================
   TOASTS
   ===================================================================== */
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { padding: 13px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--elev); box-shadow: var(--shadow); font-size: 13.5px; min-width: 240px; animation: slidein .25s; color: var(--ink); }
.toast.ok  { border-left: 3px solid var(--free); }
.toast.err { border-left: 3px solid var(--danger); }
@keyframes slidein { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }

/* skeleton loader */
.loader { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.loader::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent-1); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* misc */
.stack { display: flex; flex-direction: column; gap: 16px; }
.flex { display: flex; align-items: center; gap: 12px; }
/* Toolbars use class="flex wrap" in 13 places but the rule was never written, so
   they could only ever sit on one line and pushed the page sideways once a panel
   header carried a few controls. */
.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; }
.spread { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.empty { text-align: center; color: var(--muted); padding: 38px 20px; font-size: 14px; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Responsive: laptop / tablet / mobile ───────────────────── */
@media (max-width: 1080px) { .spread { grid-template-columns: 1fr; } }

@media (max-width: 1024px) {
  .login { grid-template-columns: 1fr; }
  .login__art { display: none; }
  .login__form { padding: 28px 18px; }

  .shell { grid-template-columns: 1fr; }
  .side {
    position: static; height: auto; flex-direction: column; align-items: stretch;
    gap: 10px; padding: 12px 14px;
  }
  .side .brand { padding: 4px; }
  .nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; margin: 0; gap: 6px; padding-bottom: 2px; }
  .nav a { white-space: nowrap; padding: 9px 13px; }
  .nav a.active::before { display: none; }
  .side__foot { margin: 0; border: 0; padding: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .side__foot > .flex { margin: 0 !important; }
  .side__foot .langseg.block { width: auto; }
  .side__foot .langseg.block button { flex: none; }
  .side__foot .who { display: none; }
  .side__foot .btn--block { width: auto; margin: 0 !important; }

  .topbar { padding: 14px 16px; }
  .topbar h1 { font-size: 19px; }
  .content { padding: 18px 14px 48px; }
  .panel__b { overflow-x: auto; }
  .panel__b .table { min-width: 560px; }
}

@media (max-width: 600px) {
  .row { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(46%, 1fr)); gap: 12px; }
  .kpi { padding: 15px 16px; }
  .kpi .val { font-size: 21px; }
  .kpi .val.serif { font-size: 24px; }
  .floor { grid-template-columns: 1fr; }
  .topbar .clock { display: none; }
  .topbar { padding: 12px 14px; }
  .profilehead { gap: 12px; }
  .tierhead { gap: 14px; }
  .tierpct__num { font-size: 34px; }
  .periodbar { padding: 11px 12px; }
  .periodlabel { margin-left: 0; width: 100%; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .toasts { left: 14px; right: 14px; }
  .toast { min-width: 0; }
}

/* =====================================================================
   MOTION — staggered entrances, micro-interactions, profile delight
   ===================================================================== */
/* A background refresh re-creates the same nodes, and every one of them replaying
   its entrance was the flicker: on a busy page that is hundreds of rows fading in
   at once, several times a minute. Real navigation still animates. */
body.no-anim .content,
body.no-anim .kpis > .kpi,
body.no-anim .floor > .dcard,
body.no-anim .stack > .panel,
body.no-anim .table tbody tr,
body.no-anim .invgrid > .invcard,
body.no-anim .wcol__b > .dcard,
body.no-anim .ai-msg { animation: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .kpis > .kpi { animation: fadeup .5s cubic-bezier(.2,.7,.3,1) both; }
  .kpis > .kpi:nth-child(2) { animation-delay: .06s; }
  .kpis > .kpi:nth-child(3) { animation-delay: .12s; }
  .kpis > .kpi:nth-child(4) { animation-delay: .18s; }
  .kpis > .kpi:nth-child(5) { animation-delay: .24s; }
  .kpis > .kpi:nth-child(6) { animation-delay: .30s; }
  .floor > .dcard { animation: fadeup .5s cubic-bezier(.2,.7,.3,1) both; }
  .floor > .dcard:nth-child(2) { animation-delay: .05s; }
  .floor > .dcard:nth-child(3) { animation-delay: .10s; }
  .floor > .dcard:nth-child(4) { animation-delay: .15s; }
  .floor > .dcard:nth-child(5) { animation-delay: .20s; }
  .floor > .dcard:nth-child(6) { animation-delay: .25s; }
  .floor > .dcard:nth-child(n+7) { animation-delay: .30s; }
  .stack > .panel { animation: fadeup .45s cubic-bezier(.2,.7,.3,1) both; }
  .table tbody tr { animation: rowin .4s ease both; }
}
@keyframes rowin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* button shine sweep on the primary buttons */
.btn--gold { position: relative; overflow: hidden; }
.btn--gold::after { content: ""; position: absolute; top: 0; left: -130%; width: 60%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); transform: skewX(-20deg); transition: left .6s ease; pointer-events: none; }
.btn--gold:hover::after { left: 150%; }

/* nav active indicator grows in */
.nav a.active::before { animation: navin .25s ease; }
@keyframes navin { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* card hover gets a touch springier */
.dcard, .kpi { transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s; }

/* ---------- designer profile delight ---------- */
.greeting { font-family: var(--serif); font-size: 15px; color: var(--muted); animation: slideinL .5s ease both; }
.greeting b { color: var(--ink); }
.greeting .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.6s ease-in-out infinite; }
@keyframes wave { 0%,60%,100% { transform: rotate(0); } 10% { transform: rotate(16deg); } 20% { transform: rotate(-8deg); } 30% { transform: rotate(16deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
@keyframes slideinL { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

.tierring { position: relative; width: 128px; height: 128px; flex: none; }
.tierring svg { display: block; width: 128px; height: 128px; transform: rotate(-90deg); overflow: visible; }
.tierring .ring-track { fill: none; stroke: color-mix(in srgb, var(--accent-1) 13%, transparent); stroke-width: 10; }
[data-theme="dark"] .tierring .ring-track { stroke: color-mix(in srgb, #ffffff 10%, transparent); }
.tierring.is-max .ring-track { stroke: color-mix(in srgb, #d9a93a 18%, transparent); }
.tierring .ring-fill { fill: none; stroke: url(#ringgrad); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: var(--off, 327); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent-2) 55%, transparent)); animation: ringfill 1.4s cubic-bezier(.22, 1, .36, 1) forwards; }
.tierring.is-max .ring-fill { stroke: url(#ringgradgold); animation: ringfill 1.4s cubic-bezier(.22, 1, .36, 1) forwards, goldpulse 2.6s ease-in-out 1.4s infinite backwards; }
@keyframes ringfill { from { stroke-dashoffset: 327; } to { stroke-dashoffset: var(--off, 327); } }
@keyframes goldpulse { 0%, 100% { filter: drop-shadow(0 0 4px color-mix(in srgb, #e9b949 50%, transparent)); } 50% { filter: drop-shadow(0 0 9px color-mix(in srgb, #f0c95a 70%, transparent)); } }
.tierring__num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; pointer-events: none; }
.tierring__val { display: flex; align-items: baseline; font-family: var(--serif); color: var(--ink); font-size: 35px; font-weight: 700; letter-spacing: -.5px; }
.tierring__pct { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-left: 1px; }
.tierring__label { margin-top: 6px; font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.tierring.is-max .tierring__val { background: linear-gradient(135deg, #e9b949, #f0c95a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.tierring.is-max .tierring__label { color: color-mix(in srgb, #d9a93a 70%, var(--muted)); }
.tierprog .bar > i { animation: barfill 1s cubic-bezier(.3,.8,.3,1) both; }
@keyframes barfill { from { width: 0 !important; } }

/* ---------- designer analyse: activity calendar heatmap ---------- */
.heatwrap { overflow-x: auto; padding-bottom: 4px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); gap: 4px; width: max-content; }
.heat-c { width: 14px; height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.heat-c.l1 { background: color-mix(in srgb, var(--accent-1) 28%, transparent); }
.heat-c.l2 { background: color-mix(in srgb, var(--accent-1) 50%, transparent); }
.heat-c.l3 { background: color-mix(in srgb, var(--accent-1) 74%, transparent); }
.heat-c.l4 { background: var(--accent-1); }
.heat-legend { display: flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 11px; }
.heat-legend .heat-c { width: 12px; height: 12px; }

/* ---------- table pagination ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pager-info { font-size: 12.5px; color: var(--muted); min-width: 120px; text-align: center; }
.pager button[disabled] { opacity: .4; cursor: default; }

/* ---------- hide salary (privacy from onlookers) ---------- */
.priv { transition: filter .18s; }
body.money-hidden .priv { filter: blur(9px); user-select: none; }

/* ---------- profile photo ---------- */
.av-photo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.profile-av { position: relative; overflow: hidden; }
.photo-btn { position: absolute; right: -3px; bottom: -3px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); background: var(--accent-1); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.photo-btn svg { width: 13px; height: 13px; }

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =====================================================================
   CHAT
   ===================================================================== */
.chat { display: grid; grid-template-columns: clamp(258px, 30%, 340px) 1fr; gap: 14px; height: calc(100dvh - 184px); min-height: 440px; }
.chat-list, .chat-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-list__h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-list__h b { font-size: 15px; }
.chat-convos { flex: 1; overflow-y: auto; padding: 6px; }
.chat-convo { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; text-align: left; color: inherit; }
.chat-convo:hover { background: var(--elev); }
.chat-convo.is-active { background: var(--accent-soft); }
.chat-convo__b { flex: 1; min-width: 0; }
.chat-convo__t { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-convo__p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-convo__r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.chat-convo__m { font-size: 11px; color: var(--faint); white-space: nowrap; }
.chat-convo .star { color: var(--paused); }
.chat-unread { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--accent-1); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
/* unread count next to the "Chat" nav item */
#nav a { position: relative; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
/* delivered / read ticks on your own messages */
.ticks { display: inline-flex; align-items: center; margin-left: 4px; vertical-align: middle; }
.tick { width: 15px; height: 10px; color: var(--faint); }
.msg.me .tick { color: color-mix(in srgb, var(--accent-1) 55%, var(--muted)); }
.tick--read { width: 17px; color: var(--working); }
.cav { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--elev); color: var(--muted); font-weight: 700; font-size: 14px; }
.cav.sm { width: 30px; height: 30px; font-size: 12px; }
.cav .av-photo { width: 100%; height: 100%; object-fit: cover; }
.cav--all { background: linear-gradient(135deg, #7c66e6, #6549c9); color: #fff; }
.cav--group { background: var(--accent-soft); color: var(--accent-1); }
.cav svg { width: 20px; height: 20px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-head__b { flex: 1; min-width: 0; }
.chat-head__t { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head__s { font-size: 12px; color: var(--muted); }
.chat-back { display: none; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.chat-day { align-self: center; margin: 10px 0; font-size: 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 2px 10px; border-radius: 20px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 80%; margin: 1px 0; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.grp { align-self: flex-start; }
.msg:not(.grp):not(.me) { align-self: flex-start; }
.msg-av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--elev); color: var(--muted); font-size: 11px; font-weight: 700; }
.msg-av:empty { background: transparent; }
.msg-av .av-photo { width: 100%; height: 100%; object-fit: cover; }
.msg-wrap { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; }
.msg.me .msg-wrap { flex-direction: row-reverse; }
.bub { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 7px 11px 5px; font-size: 14px; line-height: 1.4; max-width: 100%; }
.msg.me .bub { background: var(--accent-soft); border-color: var(--accent-border); }
.bub-name { font-size: 11.5px; font-weight: 700; color: var(--accent-1); margin-bottom: 2px; }
.bub-text { white-space: pre-wrap; word-break: break-word; }
.bub-meta { display: block; text-align: right; font-size: 10px; color: var(--faint); margin-top: 2px; }
.bub--photo { padding: 4px 4px 5px; }
.bub-photo { max-width: min(240px, 60vw); max-height: 280px; border-radius: 10px; display: block; cursor: zoom-in; }
.bub--stk { background: transparent !important; border: 0 !important; padding: 0; }
.stk-big { font-size: 52px; line-height: 1; }
.bub--del { color: var(--muted); font-style: italic; display: flex; align-items: center; gap: 6px; }
.bub--del svg { width: 15px; height: 15px; }
.msg-menu { opacity: 0; border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 6px; flex: none; }
.msg-menu svg { width: 16px; height: 16px; }
.msg:hover .msg-menu { opacity: .75; }
.msg-menu:hover { background: var(--elev); opacity: 1; }
.chat-stickers { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; border-top: 1px solid var(--line); max-height: 148px; overflow-y: auto; }
.chat-stickers.hide { display: none; }
.stk { border: 0; background: transparent; font-size: 24px; line-height: 1; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.stk:hover { background: var(--elev); }
.chat-composer { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-input { flex: 1; resize: none; min-height: 40px; max-height: 140px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); padding: 9px 12px; font: inherit; font-size: 14px; line-height: 1.4; }
.chat-input:focus { outline: none; border-color: var(--accent-border); }
.btn--icn { width: 40px; height: 40px; padding: 0; flex: none; display: grid; place-items: center; border-radius: 12px; }
.btn--icn svg { width: 18px; height: 18px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; padding: 30px; }
.chat-empty svg { width: 40px; height: 40px; opacity: .5; }
.chat-empty.sm { padding: 20px; font-size: 13px; margin: auto; }
.pick-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; color: inherit; font-size: 14px; }
.pick:hover { background: var(--elev); }
.pick-n { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-r { font-size: 11px; text-transform: capitalize; }
.pick-cb { width: 17px; height: 17px; flex: none; accent-color: var(--accent-1); }
.lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; margin-left: 6px; vertical-align: middle; }
.flex.col { flex-direction: column; align-items: stretch; }

@media (max-width: 1024px) {
  .chat { height: calc(100dvh - 214px); }
  .msg-menu { opacity: .55; }
}
@media (max-width: 820px) {
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 196px); }
  .chat-main { display: none; }
  .chat.has-active .chat-list { display: none; }
  .chat.has-active .chat-main { display: flex; }
  .chat-back { display: grid; }
  .msg { max-width: 88%; }
}

/* ── Chat: reactions, reply, forward, pin, select, context menu ── */
.msg-col { display: flex; flex-direction: column; min-width: 0; }
.msg.me .msg-col { align-items: flex-end; }
.bub-reply { border-left: 3px solid var(--accent-1); background: color-mix(in srgb, var(--accent-1) 8%, transparent); border-radius: 6px; padding: 3px 8px; margin-bottom: 4px; font-size: 12px; cursor: pointer; max-width: 100%; overflow: hidden; }
.bub-reply b { display: block; color: var(--accent-1); font-size: 11.5px; }
.bub-reply span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.bub-fwd { font-size: 11px; color: var(--faint); font-style: italic; display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.bub-fwd svg { width: 12px; height: 12px; }
.bub-pin { display: inline-flex; margin-right: 3px; color: var(--paused); }
.bub-pin svg { width: 11px; height: 11px; }
.bub-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 2px 1px; }
.react { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 1px 7px; font-size: 12px; cursor: pointer; color: var(--ink); }
.react span { font-size: 11px; color: var(--muted); font-weight: 600; }
.react.mine { background: var(--accent-soft); border-color: var(--accent-border); }
.react.mine span { color: var(--accent-1); }

.msg-menu-pop { position: fixed; z-index: 1400; background: var(--elev); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; animation: popIn .12s ease; }
.mm-react { display: flex; gap: 2px; padding: 3px; margin-bottom: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mm-emoji { border: 0; background: transparent; font-size: 21px; line-height: 1; padding: 5px; border-radius: 8px; cursor: pointer; }
.mm-emoji:hover { background: var(--surface); transform: scale(1.15); }
.mm-emoji.mm-more { color: var(--muted); display: inline-flex; align-items: center; }
.mm-emoji.mm-more svg { width: 18px; height: 18px; }
.mm-items { display: flex; flex-direction: column; }
.mm-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: transparent; color: var(--ink); font-size: 13.5px; cursor: pointer; border-radius: 8px; text-align: left; width: 100%; }
.mm-item:hover { background: var(--surface); }
.mm-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.mm-item.danger { color: var(--danger); }
.mm-item.danger svg { color: var(--danger); }

.chat-pinned { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paused) 8%, var(--surface)); cursor: pointer; }
.chat-pinned__ic { color: var(--paused); display: inline-flex; }
.chat-pinned__ic svg { width: 15px; height: 15px; }
.chat-pinned__b { flex: 1; min-width: 0; }
.chat-pinned__t { font-size: 11.5px; font-weight: 700; color: var(--paused); }
.chat-pinned__p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-reply-bar__b { flex: 1; min-width: 0; border-left: 3px solid var(--accent-1); padding-left: 8px; }
.chat-reply-bar__n { font-size: 12px; font-weight: 700; color: var(--accent-1); display: flex; align-items: center; gap: 4px; }
.chat-reply-bar__n svg { width: 12px; height: 12px; }
.chat-reply-bar__p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-selectbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-selectbar__n { font-weight: 600; font-size: 14px; }

.msg.selmode { cursor: pointer; }
.msg.selmode .msg-menu { display: none; }
.msg.sel .bub { outline: 2px solid var(--accent-1); }
.msg-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; align-self: center; }
.msg-check.on { background: var(--accent-1); border-color: var(--accent-1); color: #fff; }
.msg-check svg { width: 13px; height: 13px; }

.chat-unreadline { display: flex; align-items: center; justify-content: center; margin: 10px 0; }
.chat-unreadline span { background: color-mix(in srgb, var(--accent-1) 14%, var(--surface)); color: var(--accent-1); font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; max-height: 320px; overflow-y: auto; }
.emoji-grid .stk { font-size: 24px; }

.grp-photo-head { text-align: center; }
.grp-photo { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto; position: relative; overflow: visible; }
.grp-photo .av-photo { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; }
.grp-photo__edit { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); background: var(--accent-1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.grp-photo__edit svg { width: 15px; height: 15px; }

.msg.flash .bub { animation: flashBub 1.2s ease; }
@keyframes flashBub { 0%, 100% { background: var(--surface); } 30% { background: var(--accent-soft); } }
.msg.me.flash .bub { animation: flashBubMe 1.2s ease; }
@keyframes flashBubMe { 0%, 100% { background: var(--accent-soft); } 30% { background: color-mix(in srgb, var(--accent-1) 30%, var(--surface)); } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

/* required-field marker */
.req { color: var(--danger); font-weight: 700; }

/* =====================================================================
   MOBILE — phone layout (<=820px)
   The sidebar gives way to a fixed bottom tab bar, wide tables restack as
   cards, and dialogs rise from the bottom like a native sheet.
   ===================================================================== */

/* Nothing may force the page wider than the screen. Grid and flex children
   default to min-width:auto, so one wide table used to stretch the whole
   shell and the page scrolled sideways on every screen. */
.shell > *, .main, .content, .panel, .panel__b, .nav, .stack > * { min-width: 0; }
.content { max-width: 100%; }

/* The bottom bar and the More sheet exist only on phones. */
.tabbar, .sheet { display: none; }

@media (max-width: 820px) {
  .shell { min-height: 100dvh; }
  .side { display: none; }                     /* replaced by the tab bar */

  /* Compact sticky header: logo, page name, actions. */
  .topbar {
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    gap: 10px;
  }
  .topbar::before {
    content: ""; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px;
    background: #fff center/22px no-repeat url("/logo.png");
    border: 1px solid var(--line);
  }
  .topbar__t { min-width: 0; flex: 1; }
  .topbar h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .sub { display: none; }
  .topbar .right { gap: 6px; flex: 0 0 auto; }

  .content { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .section-title { font-size: 15px; }

  /* Bottom tab bar */
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px -18px rgba(0, 0, 0, .5);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 7px 2px 5px; border-radius: 12px; min-height: 50px;
    color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: -.01em;
    text-align: center; position: relative; transition: color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a .ic { display: grid; place-items: center; }
  .tabbar a .ic svg { width: 21px; height: 21px; }
  .tabbar a .lb { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a.active { color: var(--accent-1); }
  .tabbar a.active::after {
    content: ""; position: absolute; top: 2px; width: 18px; height: 3px;
    border-radius: 0 0 4px 4px; background: var(--accent-1);
  }
  .tabbar a:active { background: var(--accent-soft); }

  /* More sheet */
  .sheet { display: block; position: fixed; inset: 0; z-index: 70; }
  .sheet[hidden] { display: none; }
  .sheet__bg {
    position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 45%, transparent);
    backdrop-filter: blur(3px); animation: fade .2s ease;
  }
  .sheet__p {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow: auto;
    background: var(--surface); border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--line); box-shadow: var(--shadow-lg);
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    animation: sheetup .28s cubic-bezier(.2, .8, .25, 1);
  }
  .sheet__grab {
    width: 40px; height: 4px; border-radius: 3px; margin: 0 auto 12px;
    background: color-mix(in srgb, var(--ink) 18%, transparent);
  }
  .sheet__h {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--serif); font-size: 17px; font-weight: 700; margin-bottom: 14px;
  }
  .sheet__h .x {
    background: none; border: 0; color: var(--muted); font-size: 17px;
    width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  }
  .sheet__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .sheet__grid a {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 15px 6px; border-radius: 14px; border: 1px solid var(--line);
    background: var(--bg); color: var(--ink); font-size: 11.5px; font-weight: 600;
    text-align: center; line-height: 1.25;
  }
  .sheet__grid a .ic { color: var(--accent-1); display: grid; place-items: center; }
  .sheet__grid a .ic svg { width: 21px; height: 21px; }
  .sheet__grid a:active { background: var(--accent-soft); border-color: var(--accent-1); }
  .sheet__foot {
    margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 11px;
  }
  .sheet__foot .who { padding: 0; }
  .sheet__foot .who .meta b { white-space: normal; }

  /* Tables become cards */
  .panel__b:has(> .table), .tablewrap { overflow-x: visible; }
  .panel__b .table, .table { min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: auto; }
  .table tbody tr {
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
    margin: 10px; padding: 4px 2px; box-shadow: var(--shadow-sm);
  }
  .table tbody tr:hover { background: var(--surface); }
  .table td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding: 9px 13px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
    text-align: left; font-size: 13.5px;
  }
  .table td:last-child { border-bottom: 0; }
  .table td::before {
    content: attr(data-label); flex: 0 0 40%; color: var(--faint);
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding-top: 2px;
  }
  .table td:not([data-label])::before { content: none; }
  .table td.num { text-align: right; }
  .table td > * { min-width: 0; }
  /* Cells holding only buttons stretch across the card foot. */
  .table td.cell-actions { padding: 10px 11px; }
  .table td.cell-actions > .flex { width: 100%; justify-content: stretch !important; flex-wrap: wrap; }
  .table td.cell-actions .btn { flex: 1 1 auto; }
  /* Group headings (day / designer) stay full-width bars between the cards. */
  .table tr.rowfull, .table tr.daygroup {
    display: block; border: 0; background: none; box-shadow: none;
    margin: 16px 4px 2px; padding: 0;
  }
  .table tr.rowfull td, .table tr.daygroup td { display: block; border: 0; padding: 0; }
  .table tr.rowfull td::before, .table tr.daygroup td::before { content: none; }
  .daygroup__row { flex-wrap: wrap; gap: 6px 12px; }
  .pager { padding: 4px 10px 2px; }

  /* Everything you tap should be comfortable */
  .btn { min-height: 42px; padding: 10px 15px; }
  .btn--sm { min-height: 38px; }
  .input, select.input, textarea.input { font-size: 16px; min-height: 44px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .panel__h { padding: 14px; }
  .panel__b { padding: 14px; }
  .panel__h h3 { font-size: 15.5px; }

  /* Dialogs rise from the bottom */
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal {
    width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    animation: sheetup .26s cubic-bezier(.2, .8, .25, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal .panel__h { position: sticky; top: 0; background: var(--surface); z-index: 2; border-radius: 20px 20px 0 0; }
  .modal .panel__h h3 { font-size: 16.5px; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface); padding-bottom: 4px; }

  .toasts { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .lightbox img { max-width: 96vw; }
  .floor { grid-template-columns: 1fr; }
  .invgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rcpt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .periodbar { gap: 8px; }
  .periodbar .seg { width: 100%; }
  /* Davr tanlagich qatorni toʻldiradi; boʻlim tanlagich esa oʻz
     kengligida qoladi va kerak boʻlsa suriladi. */
  .periodbar .seg:not(.seg--tabs) button { flex: 1; min-width: 0; }
  /* The month picker and the from/to dates must share the row, not overrun it.
     A date input keeps its own intrinsic width unless told to shrink. */
  .periodbar > .periodinput { width: 100%; }
  .periodrange { display: flex; width: 100%; min-width: 0; }
  .periodrange .periodinput { flex: 1 1 0; min-width: 0; width: auto; }
  .periodlabel { width: 100%; margin-left: 0; }
  .chat { height: calc(100dvh - 190px); }
}

body.sheet-open { overflow: hidden; }
@keyframes sheetup { from { transform: translateY(100%); } to { transform: none; } }

/* Very narrow phones */
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
  .sheet__grid { grid-template-columns: repeat(2, 1fr); }
  .tabbar a { font-size: 9.5px; }
  .table td::before { flex-basis: 44%; }
}

/* Receipt source buttons (camera / gallery) */
.rcpt-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }

/* =====================================================================
   AI DIRECTOR
   ===================================================================== */
.ai-hero {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: var(--r-l); border: 1px solid var(--line);
  background: linear-gradient(120deg, var(--accent-soft), var(--surface) 65%);
}
.ai-hero__i {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: #fff; flex: 0 0 auto;
}
.ai-hero__i svg { width: 21px; height: 21px; }
.ai-hero b { font-family: var(--serif); font-size: 16.5px; }

.ai-delta { font-weight: 700; font-size: 11.5px; margin-left: 6px; }
.ai-delta.up { color: var(--free); }
.ai-delta.down { color: var(--danger); }

/* The Director page holds nothing but the conversation, so let it fill the
   screen: the thread takes the leftover height and scrolls inside itself,
   keeping the question box always in view at the bottom. */
/* A fixed height, not a minimum: only then can the thread take the leftover
   space and scroll inside itself instead of pushing the question box off the
   bottom of the screen as the conversation grows. */
.ai-page { height: calc(100vh - 180px); }
.ai-panel { flex: 1; display: flex; min-height: 0; }
.ai-panel__b { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ai-thread {
  flex: 1; display: flex; flex-direction: column; gap: 14px;
  min-height: 260px; overflow-y: auto; padding-right: 4px; margin-bottom: 14px;
}
/* Empty state: the module introduces itself instead of showing a bare box. */
.ai-blank {
  margin: auto; display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; padding: 26px 18px; max-width: 380px;
}
.ai-blank__i {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-1); margin-bottom: 3px;
}
.ai-blank__i svg { width: 23px; height: 23px; }
.ai-blank b { font-family: var(--serif); font-size: 16px; }
.ai-blank .muted { font-size: 13px; line-height: 1.6; }
.ai-msg { max-width: 92%; }
.ai-msg.you { align-self: flex-end; text-align: right; }
.ai-msg__who { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.ai-msg__b {
  display: inline-block; text-align: left; padding: 12px 15px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.65; border: 1px solid var(--line); background: var(--bg);
  overflow-wrap: anywhere;
}
.ai-msg.you .ai-msg__b { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-1) 30%, transparent); color: var(--ink); }
.ai-msg__b p { margin: 0 0 9px; }
.ai-msg__b p:last-child { margin-bottom: 0; }
.ai-msg__b b { color: var(--ink); }

.ai-dots { display: inline-flex; gap: 5px; padding: 3px 0; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-1); opacity: .35; animation: aidot 1.1s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .18s; }
.ai-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes aidot { 0%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
.ai-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: .15s;
}
.ai-chip:hover { color: var(--accent-1); border-color: var(--accent-1); background: var(--accent-soft); }

.ai-form { display: flex; gap: 9px; }
.ai-form .input { flex: 1; min-width: 0; }
.ai-form .btn { white-space: nowrap; flex: 0 0 auto; }

@media (max-width: 820px) {
  .ai-page { height: calc(100dvh - 160px); }
  .ai-thread { min-height: 120px; }
  .ai-msg { max-width: 100%; }
  /* Keep the ask box on one line so it cannot eat the thread's height. */
  .ai-form { flex-wrap: nowrap; }
  .ai-form .btn { width: auto; padding: 10px 14px; }
  /* A compact hero: the blurb and the status chip belong on a wide screen, but
     on a phone they stacked into 245px and pushed the ask box off the bottom. */
  .ai-hero { padding: 12px 14px; gap: 11px; }
  .ai-hero__i { width: 34px; height: 34px; }
  .ai-hero .muted { display: none; }
  .ai-hero > span.flex { width: auto; gap: 6px; }
  /* Suggestions scroll sideways in one row rather than wrapping into a wall. */
  .ai-chips {
    flex-wrap: nowrap; overflow-x: auto; margin-bottom: 11px;
    padding-bottom: 3px; scrollbar-width: none;
  }
  .ai-chips::-webkit-scrollbar { display: none; }
  .ai-chip { flex: 0 0 auto; }
}

/* AI Director — connection notes, watch list and movers */
.ai-note {
  border-radius: 10px; padding: 10px 13px; font-size: 12.5px; line-height: 1.6;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
}
.ai-note.ok { border-color: color-mix(in srgb, var(--free) 45%, transparent); background: color-mix(in srgb, var(--free) 10%, var(--surface)); color: var(--ink); }
.ai-note.bad { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--ink); }
.ai-note.bad b { color: var(--danger); display: block; margin-bottom: 3px; }
/* A draft order the Director wants to create, waiting for the admin's tap. */
.ai-prop {
  margin-top: 11px; border: 1px solid color-mix(in srgb, var(--accent-1) 40%, transparent);
  background: color-mix(in srgb, var(--accent-1) 6%, var(--surface));
  border-radius: 12px; padding: 12px 14px;
}
.ai-prop__h {
  display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12.5px;
  color: var(--accent-1); margin-bottom: 9px; text-transform: uppercase; letter-spacing: .03em;
}
.ai-prop__h svg { width: 15px; height: 15px; }
.ai-prop__r {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 4px 0; font-size: 13px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.ai-prop__r:last-of-type { border-bottom: 0; }
.ai-prop__r span { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.ai-prop__r b { text-align: right; overflow-wrap: anywhere; }
.ai-prop__f { display: flex; gap: 8px; justify-content: flex-end; margin-top: 11px; }
.ai-prop.done {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  border-color: color-mix(in srgb, var(--free) 45%, transparent);
  background: color-mix(in srgb, var(--free) 10%, var(--surface)); color: var(--ink);
}
.ai-prop.done svg { color: var(--free); }

/* Busy model: temporary, so amber rather than red. */
.ai-note.warn { border-color: color-mix(in srgb, var(--paused) 45%, transparent); background: color-mix(in srgb, var(--paused) 9%, var(--surface)); color: var(--ink); }
.ai-note.warn b { color: var(--paused); display: block; margin-bottom: 3px; }
.ai-note__d { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

.ai-watch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.ai-watch b { font-family: var(--serif); font-size: 16px; }
.ai-watch b.ai-warn { color: var(--paused); }

.ai-mover { display: flex; align-items: center; gap: 11px; }
.ai-mover__n { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.ai-mover .ai-delta { font-size: 13px; }

/* =====================================================================
   TRAINING — course cards, the builder, and the lesson player
   ===================================================================== */
.lms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.lms-card {
  border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface);
  padding: 15px 16px; cursor: pointer; transition: border-color .15s, transform .1s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm);
}
.lms-card:hover { border-color: var(--accent-1); transform: translateY(-1px); box-shadow: var(--shadow-md, var(--shadow-sm)); }
.lms-card__top { display: flex; align-items: flex-start; gap: 11px; }
.lms-card__i {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-1);
}
.lms-card__top b { font-size: 14.5px; line-height: 1.35; display: block; overflow-wrap: anywhere; }
.lms-card__d {
  font-size: 12.5px; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lms-card__f { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.lms-overdue { color: var(--paused); font-weight: 600; }

.lms-prog { height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; flex: 1; }
.lms-prog > i { display: block; height: 100%; background: var(--accent-1); border-radius: 4px; transition: width .35s ease; }

/* ── builder ─────────────────────────────────────────────────────────── */
.lms-session { border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; margin-bottom: 12px; background: var(--bg); }
.lms-session__h { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.lms-session__h b { font-size: 13.5px; overflow-wrap: anywhere; }

.lms-lesson {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px;
}
.lms-lesson__i { color: var(--accent-1); display: grid; place-items: center; flex: 0 0 auto; }
.lms-lesson b { font-size: 13px; overflow-wrap: anywhere; }

.lms-bar { height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; margin-top: 7px; }
.lms-bar > i { display: block; height: 100%; width: 0; background: var(--accent-1); transition: width .2s ease; }

.lms-people { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.lms-person {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.lms-person:hover { border-color: var(--accent-1); }
.lms-person b { font-size: 13px; }

/* ── the player ──────────────────────────────────────────────────────── */
.lms-player { display: flex; flex-direction: column; gap: 12px; }
.lms-player__bar { display: flex; align-items: center; gap: 10px; }
.lms-player__main { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; }
.lms-player__body { min-width: 0; }
.lms-lesson-title { font-family: var(--serif); font-size: 18px; margin: 3px 0 12px; }
.lms-body { font-size: 13.5px; line-height: 1.75; color: var(--ink-2); margin-top: 12px; }

.lms-video { width: 100%; max-height: 46vh; border-radius: 12px; background: #000; display: block; }
.lms-pdf { width: 100%; height: 46vh; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); display: block; }
.lms-image { width: 100%; border-radius: 12px; display: block; }

.lms-player__list {
  max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; background: var(--bg); min-width: 0;
}
.lms-plist__s {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint);
  font-weight: 700; padding: 9px 8px 5px;
}
.lms-plist__l {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 9px; border-radius: 8px; border: 0; background: transparent; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.35;
}
.lms-plist__l:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.lms-plist__l.is-active { background: var(--accent-soft); color: var(--accent-1); font-weight: 600; }
.lms-plist__c { width: 16px; flex: 0 0 auto; color: var(--free); display: grid; place-items: center; }
.lms-plist__c svg { width: 14px; height: 14px; }
.lms-plist__l.is-done { color: var(--muted); }

.lms-player__foot { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.lms-player__foot .btn { flex: 0 0 auto; }

.lms-blank {
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  padding: 46px 20px; max-width: 420px; margin: 0 auto;
}
.lms-blank__i {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-1); margin-bottom: 4px;
}
.lms-blank__i svg { width: 24px; height: 24px; }
.lms-blank b { font-family: var(--serif); font-size: 16px; }
.lms-blank .muted { font-size: 13px; line-height: 1.6; }

@media (max-width: 820px) {
  .lms-grid { grid-template-columns: 1fr; }
  /* The lesson list goes under the lesson on a phone, not beside it. */
  .lms-player__main { grid-template-columns: 1fr; }
  .lms-player__list { max-height: 240px; }
  .lms-video, .lms-pdf { max-height: 38vh; height: auto; }
  .lms-pdf { height: 38vh; }
  .lms-player__foot .btn { flex: 1 1 auto; }
  .lms-people { max-height: 46vh; }
}

/* ══ QUIZZES ═══════════════════════════════════════════════════════════ */

/* a checkbox with a label beside it, used all over the quiz editor */
.check { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }
.check input { width: 17px; height: 17px; flex: none; accent-color: var(--accent-1); }

/* ── the admin's question list ───────────────────────────────────────── */
.quiz-q { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 9px; background: var(--surface); }
.quiz-q__h { display: flex; align-items: flex-start; gap: 9px; }
.quiz-q__h b { font-size: 13px; overflow-wrap: anywhere; }
.quiz-q__n {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-1); font-size: 11.5px; font-weight: 700;
}
.quiz-q__b { margin: 9px 0 0 31px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.quiz-opt { display: flex; align-items: center; gap: 7px; color: var(--ink-2); overflow-wrap: anywhere; }
.quiz-opt__m { flex: 0 0 auto; width: 17px; height: 17px; display: grid; place-items: center; color: var(--faint); font-size: 11px; }
.quiz-opt.is-right { color: var(--free); font-weight: 600; }
.quiz-opt.is-right .quiz-opt__m { color: var(--free); }
.quiz-pair { color: var(--ink-2); overflow-wrap: anywhere; }

/* ── writing a question ──────────────────────────────────────────────── */
.quiz-erow { display: flex; align-items: center; gap: 8px; }
.quiz-erow .input { flex: 1; min-width: 0; }
.quiz-erow__n {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--muted); font-size: 11.5px; font-weight: 700;
}
.quiz-erow__c { flex: 0 0 auto; display: grid; place-items: center; }
.quiz-erow__c input { width: 18px; height: 18px; accent-color: var(--free); }

/* the picture with the correct area marked on it */
.quiz-hot { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; line-height: 0; }
.quiz-hot img { max-width: 100%; border-radius: 12px; display: block; }
.quiz-hot__a {
  position: absolute; border: 2px solid var(--free); border-radius: 8px;
  background: color-mix(in srgb, var(--free) 18%, transparent); pointer-events: none;
}
.quiz-hot__p {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  border: 2px solid #fff; background: var(--accent-1); box-shadow: 0 0 0 2px var(--accent-1); pointer-events: none;
}

/* ── sitting the quiz ────────────────────────────────────────────────── */
.quiz-take { display: flex; flex-direction: column; gap: 12px; }
.quiz-take__bar { display: flex; align-items: center; gap: 10px; }
.quiz-take__body { min-width: 0; }
.quiz-take__foot { display: flex; gap: 8px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }

.quiz-clock {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-1);
}
.quiz-clock.is-low { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

/* one dot per question, so they can see what is still blank */
.quiz-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.quiz-dot {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer;
  background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 700;
}
.quiz-dot.is-done { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-1); }
.quiz-dot.is-active { border-color: var(--accent-1); box-shadow: 0 0 0 2px var(--accent-soft); color: var(--ink); }

.quiz-pick {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; margin-bottom: 7px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  cursor: pointer; font-size: 13.5px; line-height: 1.45;
}
.quiz-pick:hover { border-color: var(--accent-border); }
.quiz-pick input { width: 19px; height: 19px; flex: none; margin-top: 1px; accent-color: var(--accent-1); }
.quiz-pick:has(input:checked) { border-color: var(--accent-1); background: var(--accent-soft); }
.quiz-pick span { min-width: 0; overflow-wrap: anywhere; }

.quiz-scale { display: flex; gap: 7px; flex-wrap: wrap; }
.quiz-scale__i {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; position: relative;
}
.quiz-scale__i input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.quiz-scale__i:has(input:checked) { border-color: var(--accent-1); background: var(--accent-soft); color: var(--accent-1); }

.quiz-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.quiz-facts > div {
  border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: var(--bg);
  display: flex; flex-direction: column; gap: 2px;
}
.quiz-facts span { font-size: 11.5px; }
.quiz-facts b { font-size: 15px; }

.quiz-banner {
  display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center;
  padding: 16px; border-radius: 14px; font-size: 13px; border: 1px solid var(--line);
}
.quiz-banner.is-pass { background: color-mix(in srgb, var(--free) 10%, transparent); border-color: color-mix(in srgb, var(--free) 30%, transparent); color: var(--free); }
.quiz-banner.is-fail { background: color-mix(in srgb, var(--danger) 9%, transparent); border-color: color-mix(in srgb, var(--danger) 26%, transparent); color: var(--danger); }
.quiz-banner.is-wait { background: color-mix(in srgb, var(--paused) 10%, transparent); border-color: color-mix(in srgb, var(--paused) 28%, transparent); color: var(--paused); }

.quiz-lesson-note {
  display: flex; align-items: center; gap: 10px; padding: 14px 15px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-1); font-size: 13px;
}

/* ── the result screen ───────────────────────────────────────────────── */
.quiz-rev { border: 1px solid var(--line); border-left-width: 3px; border-radius: 11px; padding: 11px 12px; background: var(--surface); }
.quiz-rev.is-right { border-left-color: var(--free); }
.quiz-rev.is-wrong { border-left-color: var(--danger); }
.quiz-rev.is-wait  { border-left-color: var(--paused); }
.quiz-rev b { font-size: 13px; overflow-wrap: anywhere; }
.quiz-rev__b { margin: 8px 0 0 31px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.quiz-fb {
  display: flex; gap: 7px; align-items: flex-start; margin-top: 4px; padding: 8px 10px;
  border-radius: 9px; background: var(--accent-soft); color: var(--accent-1);
}

/* ── marking by hand ─────────────────────────────────────────────────── */
.quiz-mark { border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; background: var(--surface); }
.quiz-answer {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: var(--bg);
  font-size: 13px; line-height: 1.65; max-height: 200px; overflow-y: auto; overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .quiz-erow { flex-wrap: wrap; }
  .quiz-erow .input { flex: 1 1 140px; }
  .quiz-take__foot .btn { flex: 1 1 auto; }
  .quiz-q__b, .quiz-rev__b { margin-left: 0; }
  .quiz-dot { width: 30px; height: 30px; }
}

/* ══ THE END OF A COURSE ═══════════════════════════════════════════════ */

/* the final exam, sitting after the last lesson */
.final-card {
  border: 1px solid var(--accent-border); border-radius: 14px; padding: 16px 17px;
  background: var(--accent-soft);
}
.final-card.is-locked { border-color: var(--line); background: var(--bg); }
.final-card.is-passed { border-color: color-mix(in srgb, var(--free) 32%, transparent); background: color-mix(in srgb, var(--free) 8%, transparent); }
.final-card__i {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface); color: var(--accent-1); border: 1px solid var(--line);
}
.final-card.is-passed .final-card__i { color: var(--free); }
.final-card b { overflow-wrap: anywhere; }

/* the panel shown once the whole course is behind them */
.done-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  border: 1px solid color-mix(in srgb, var(--free) 30%, transparent); border-radius: 14px;
  background: color-mix(in srgb, var(--free) 8%, transparent); padding: 20px 16px; margin-top: 14px;
}
.done-card__i {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--free); color: #fff; margin-bottom: 4px;
}

/* one certificate in a list */
.cert-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
}
.cert-row.is-revoked { opacity: .62; }
.cert-row__i {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-1);
}
.cert-row b { font-size: 13px; overflow-wrap: anywhere; }

/* ratings */
.star {
  border: 0; background: transparent; cursor: pointer; padding: 0 1px;
  font-size: 19px; line-height: 1; color: color-mix(in srgb, var(--ink) 18%, transparent);
}
.star.on { color: #f5a524; }
.star:disabled { cursor: default; }
.rev-pick .star { font-size: 34px; padding: 0 4px; }

.rev-stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.rev-head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.rev-avg { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rev-avg > b { font-family: var(--serif); font-size: 38px; line-height: 1; }
.rev-bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rev-bar { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.rev-bar > i {
  flex: 1; height: 7px; border-radius: 4px; overflow: hidden;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}
.rev-bar > i > b { display: block; height: 100%; background: #f5a524; border-radius: 4px; }
.rev-row { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--surface); }
.rev-row b { font-size: 13px; }

/* ── Mijozning bahosi ────────────────────────────────────────────────── */

/* Studiya tomoni: QR oynasi */
.rateqr { text-align: center; }
.rateqr__box { display: grid; place-items: center; min-height: 220px; padding: 14px; margin: 0 auto 10px; width: max-content; max-width: 100%; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.rateqr__box svg { width: 220px; height: 220px; display: block; }
.rateqr__code { font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.rateqr__how { font-size: 13px; margin: 7px 0 13px; line-height: 1.55; }
.rateqr__link { font-size: 11.5px; word-break: break-all; color: var(--muted); background: var(--elev); border-radius: 9px; padding: 8px 10px; margin-bottom: 12px; }
.rateqr__exp { font-size: 11.5px; margin: 12px 0 0; }

/* Oʻrtacha baho — har doim nechta bahodan ekani bilan birga, aks holda
   uchta besh yulduz "5.0" boʻlib koʻrinib ketadi. */
.ratepill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 20px; background: color-mix(in srgb, #f5a524 15%, transparent); color: var(--ink); font-size: 12.5px; font-weight: 600; }
.ratepill[data-action] { cursor: pointer; }
.ratepill.is-none { background: var(--elev); color: var(--muted); font-weight: 500; }
.ratepill__s { color: #f5a524; }
.ratepill .muted { font-weight: 500; }

.raterows { display: flex; flex-direction: column; gap: 9px; }
.raterow { border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; background: var(--bg); }
.raterow.is-void { opacity: .55; }
.raterow__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.raterow__h .star { font-size: 15px; padding: 0 1px; }
.raterow__c { font-size: 13px; line-height: 1.6; margin: 7px 0 0; overflow-wrap: anywhere; }
.raterow__f { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.raterow__a { margin-top: 9px; }
.rateflag { font-size: 10.5px; font-weight: 650; padding: 2px 8px; border-radius: 20px; background: color-mix(in srgb, var(--paused) 16%, transparent); color: var(--paused); cursor: help; }
.rateflag.is-void { background: color-mix(in srgb, var(--gray) 18%, transparent); color: var(--gray); cursor: default; }
.rate-note { font-size: 12px; line-height: 1.6; margin-bottom: 13px; }
.ratewarn { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--paused) 40%, var(--line)); background: color-mix(in srgb, var(--paused) 10%, transparent); font-size: 13px; cursor: pointer; }
.ratewarn span { margin-left: auto; color: var(--accent-1); font-weight: 600; white-space: nowrap; }

/* ── Mijoz koʻradigan sahifa (/b/…) ─────────────────────────────────────
   Studiyaning yuzi: toʻq binafsha fon, sekin suzuvchi nur va yiltillagan
   zarralar, shisha karta. Ilovaning yorugʻ/qorongʻi mavzusiga bogʻliq emas —
   chatdagi havola rasmi bilan bir xil koʻrinsin. --rc — kayfiyat rangi:
   tanlangan yulduzga qarab karta nuri, yozuv va tugmalar shu rangga kiradi. */
.rate {
  --rc: #a78bfa;
  position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: 28px 16px; box-sizing: border-box; overflow: hidden; isolation: isolate; color: #f4f1ff;
  background:
    radial-gradient(1100px 700px at 15% -10%, #2c2064 0%, transparent 60%),
    radial-gradient(900px 600px at 105% 110%, #2a1752 0%, transparent 55%),
    #110c24;
}
.rate[data-mood="1"] { --rc: #f87171; }
.rate[data-mood="2"] { --rc: #fb923c; }
.rate[data-mood="3"] { --rc: #facc15; }
.rate[data-mood="4"] { --rc: #a3e635; }
.rate[data-mood="5"] { --rc: #fbbf24; }
.rate__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.rate__bg b { position: absolute; border-radius: 50%; will-change: transform; }
.rate__bg b:nth-child(1) { width: 62vmax; height: 62vmax; left: -22vmax; top: -26vmax; opacity: .5; background: radial-gradient(circle, #7c5cff 0%, transparent 65%); }
.rate__bg b:nth-child(2) { width: 52vmax; height: 52vmax; right: -20vmax; bottom: -24vmax; opacity: .32; background: radial-gradient(circle, #c026d3 0%, transparent 65%); }
.rate__bg b:nth-child(3) { width: 36vmax; height: 36vmax; left: 34%; top: 52%; opacity: .22; background: radial-gradient(circle, var(--rc) 0%, transparent 65%); }
.rate__dust i { position: absolute; border-radius: 50%; background: #fff; opacity: .35; box-shadow: 0 0 6px #fff; }

.rate__card {
  position: relative; width: 100%; max-width: 430px; box-sizing: border-box; padding: 26px 24px 20px; text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .045));
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 26px;
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .08),
    0 0 70px -24px color-mix(in srgb, var(--rc) 80%, transparent);
  transition: box-shadow .6s ease;
}
.rate__card::before {
  content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
}
.rate__brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; text-align: left; }
.rate__brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .6); }
.rate__brand span { display: grid; font-weight: 700; font-size: 15px; line-height: 1.15; color: #fff; }
.rate__brand small { font-size: 9.5px; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; color: rgba(244, 241, 255, .55); }

.rate__hi { font-size: 14.5px; color: rgba(244, 241, 255, .78); margin-bottom: 4px; }
.rate__t {
  font-size: 25px; font-weight: 800; line-height: 1.22; letter-spacing: -.015em;
  background: linear-gradient(92deg, #ffffff 10%, #e9d5ff 55%, #fde68a 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* Rahmat va xabar sarlavhalarida emoji bor — rangli matn uni oqartirib yuboradi. */
.rate__done .rate__t, .rate__msg .rate__t { background: none; color: #fff; }
.rate__lead { font-size: 14px; line-height: 1.6; color: rgba(244, 241, 255, .72); margin: 8px 0 0; }
.rate__order {
  display: flex; align-items: center; gap: 11px; margin: 18px auto 0; padding: 10px 14px; max-width: 330px; text-align: left;
  border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
}
.rate__av {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%;
  font-weight: 800; color: #1b1240; background: linear-gradient(135deg, #fde68a, #f59e0b);
  box-shadow: 0 0 0 3px rgba(253, 230, 138, .18);
}
.rate__ow { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; line-height: 1.35; color: rgba(244, 241, 255, .85); }
.rate__ow b { color: #fff; }
.rate__ow small { font-size: 11.5px; color: rgba(244, 241, 255, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rate__face { font-size: 48px; line-height: 1; height: 56px; margin: 18px 0 2px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.rate__stars { display: flex; justify-content: center; gap: 6px; }
.rstar {
  position: relative; width: 50px; height: 50px; padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.rstar svg {
  display: block; width: 100%; height: 100%; fill: rgba(255, 255, 255, .1); stroke: rgba(255, 255, 255, .38);
  stroke-width: 1; stroke-linejoin: round; transition: fill .25s, stroke .25s, filter .25s, transform .2s;
}
.rstar.is-hint svg { fill: rgba(253, 230, 138, .42); stroke: rgba(253, 230, 138, .85); }
.rstar.on svg { fill: #fbbf24; stroke: #fde68a; filter: drop-shadow(0 0 10px rgba(251, 191, 36, .65)); }
.rstar:focus-visible { outline: 2px solid #fde68a; outline-offset: 2px; border-radius: 12px; }
.rate__word { min-height: 22px; margin: 10px 0 2px; font-size: 15px; font-weight: 700; color: rgba(244, 241, 255, .55); transition: color .3s; }
.rate__word.is-on { color: var(--rc); }

.rate__why { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 2px; }
.rate__why[hidden] { display: none; }
.rate__whyq { flex-basis: 100%; font-size: 13.5px; font-weight: 650; color: rgba(244, 241, 255, .88); margin-bottom: 2px; }
.rate__whyb {
  padding: 9px 15px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06);
  color: #f4f1ff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s, transform .15s;
}
.rate__whyb:active { transform: scale(.96); }
.rate__whyb.is-on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 24%, transparent); }

.rate__more { margin-top: 14px; }
.rate__more[hidden] { display: none; }
.rate__note {
  width: 100%; box-sizing: border-box; min-height: 78px; padding: 12px 14px; resize: vertical; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(10, 6, 28, .38); color: #fff;
  font: inherit; font-size: 14px; line-height: 1.5; outline: none; transition: border-color .2s, box-shadow .2s;
}
.rate__note::placeholder { color: rgba(244, 241, 255, .42); }
.rate__note:focus { border-color: rgba(253, 230, 138, .6); box-shadow: 0 0 0 4px rgba(253, 230, 138, .12); }
.rate__send {
  position: relative; width: 100%; margin-top: 12px; padding: 15px 18px; border: 0; border-radius: 16px; overflow: hidden; cursor: pointer;
  font: inherit; font-size: 15.5px; font-weight: 800; letter-spacing: .01em; color: #1b1240;
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 45%, #f59e0b 100%);
  box-shadow: 0 14px 30px -12px rgba(251, 191, 36, .7); transition: transform .15s, opacity .2s, box-shadow .2s;
}
.rate__send::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; pointer-events: none;
  transform: skewX(-20deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
}
.rate__send:active { transform: scale(.98); }
.rate__send:disabled { opacity: .45; cursor: default; box-shadow: none; }
.rate__send:disabled::after { display: none; }
.rate__send.is-busy span { opacity: 0; }
.rate__send.is-busy::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 3px solid rgba(27, 18, 64, .25); border-top-color: #1b1240; animation: rateSpin .7s linear infinite;
}
.rate__fine { font-size: 11.5px; line-height: 1.6; color: rgba(244, 241, 255, .45); margin: 14px 0 0; }
.rate__lang { display: flex; justify-content: center; margin-top: 16px; }
.rate__lang .seg { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }
.rate__lang .seg button { color: rgba(244, 241, 255, .7); }
.rate__lang .seg button:hover { color: #fff; }
.rate__lang .seg button.on { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: none; }

.rate__msg { padding: 12px 0 6px; }
.rate__ico { font-size: 54px; line-height: 1; margin-bottom: 14px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .4)); }
.rate__spin { width: 34px; height: 34px; margin: 26px auto; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: #fde68a; animation: rateSpin .8s linear infinite; }

/* Rahmat */
.rate__done { padding: 6px 0 2px; }
.rate__ok { display: block; width: 92px; height: 92px; margin: 2px auto 14px; overflow: visible; }
.rate__ok circle { fill: rgba(255, 255, 255, .06); stroke: var(--rc); stroke-width: 3; stroke-dasharray: 176; }
.rate__ok path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; }
.rate__done.is-good .rate__ok { filter: drop-shadow(0 0 18px rgba(251, 191, 36, .55)); }
.rate__gave { display: flex; justify-content: center; gap: 6px; margin: 16px 0 4px; }
.rate__gave i { display: block; width: 30px; height: 30px; }
.rate__gave i svg { display: block; width: 100%; height: 100%; fill: rgba(255, 255, 255, .14); }
.rate__gave i.on svg { fill: #fbbf24; filter: drop-shadow(0 0 8px rgba(251, 191, 36, .6)); }
.rate__sign { margin: 14px 0 0; font-size: 13px; font-style: italic; color: rgba(244, 241, 255, .6); }

/* Effektlar qatlami: uchqunlar, konfetti, yuraklar. */
.rate__fx { position: fixed; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.rate__spark { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: #fde68a; box-shadow: 0 0 10px #fbbf24; }
.rate__spark:nth-child(3n) { background: #fff; }
.rate__spark:nth-child(3n + 1) { background: var(--rc); border-radius: 50%; }
.rate__heart { position: absolute; bottom: -40px; line-height: 1; }

@keyframes rateSpin { to { transform: rotate(360deg); } }
@keyframes rateShine { 0%, 55% { left: -40%; } 100% { left: 130%; } }
@keyframes rateFloat1 { 50% { transform: translate(6vmax, 4vmax) scale(1.08); } }
@keyframes rateFloat2 { 50% { transform: translate(-5vmax, -3vmax) scale(.94); } }
@keyframes rateBreath { 50% { transform: scale(1.12); } }
@keyframes rateTwinkle { 0%, 100% { opacity: .05; transform: scale(.6); } 50% { opacity: .9; transform: scale(1); } }
@keyframes rateBob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: no-preference) {
  .rate__bg b:nth-child(1) { animation: rateFloat1 18s ease-in-out infinite; }
  .rate__bg b:nth-child(2) { animation: rateFloat2 22s ease-in-out infinite; }
  .rate__bg b:nth-child(3) { animation: rateBreath 7s ease-in-out infinite; }
  .rate__dust i { animation: rateTwinkle 4.5s ease-in-out infinite; }
  .rate__face { animation: rateBob 3.2s ease-in-out infinite; }
  .rate__send::after { animation: rateShine 2.8s ease-in-out infinite; }
  .rstar:hover svg { transform: scale(1.12); }
}
@media (max-width: 400px) {
  .rate__card { padding: 22px 16px 18px; border-radius: 22px; }
  .rate__t { font-size: 22px; }
  .rstar { width: 46px; height: 46px; }
  .rate__stars { gap: 3px; }
}

/* ── Hudud, jarima va yigʻiladigan boʻlimlar ──────────────────────────── */
.geomap { height: 260px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--elev); }
.geomap .leaflet-container { height: 100%; width: 100%; font: inherit; }

/* Yoqish/oʻchirish qatori — sozlamalarda bir necha joyda kerak. */
.switchrow { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.switchrow input { width: 19px; height: 19px; margin-top: 1px; flex: none; accent-color: var(--accent-1); }
.switchrow span { font-size: 13.5px; line-height: 1.5; }
.switchrow small { display: block; font-size: 11.5px; margin-top: 2px; }

.chip.fine-open   { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.chip.fine-paid   { color: var(--free);   background: color-mix(in srgb, var(--free) 13%, transparent); }
.chip.fine-waived { color: var(--gray);   background: color-mix(in srgb, var(--gray) 16%, transparent); }
.chip.att-excused { color: var(--working); background: color-mix(in srgb, var(--working) 13%, transparent); }
.attday.is-excused { background: var(--working); }

/* Suzuvchi oynadagi boʻlim sarlavhasi — bosilsa yigʻiladi. */
.pip-group { cursor: pointer; user-select: none; }
.pip-group__c { display: inline-block; transition: transform .16s ease; margin-right: 4px; }
.pip-group.is-shut .pip-group__c { transform: rotate(-90deg); }

/* ── Yuz skaneri ──────────────────────────────────────────────────────── */
.facecard { max-width: 430px; }
/* Kamera doira ichida: odam qayerga qarashini oʻzi tushunadi. */
.facebox { position: relative; width: 240px; height: 240px; margin: 18px auto 14px; border-radius: 50%;
  overflow: hidden; background: #000; box-shadow: var(--shadow); }
.facebox video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.facering { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  border: 3px solid color-mix(in srgb, var(--accent-1) 55%, transparent); }
.face__msg { min-height: 20px; font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }

/* Adminning koʻrinishi: saqlangan yuzlar va soʻnggi skanerlar */
.facerow { display: flex; gap: 9px; flex-wrap: wrap; }
.facethumb { width: 62px; height: 62px; border-radius: 13px; object-fit: cover; border: 1px solid var(--line); }
.facechecks { display: flex; flex-direction: column; gap: 5px; }
.facecheck { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.facecheck b { flex: 1; color: var(--free); font-weight: 600; }
.facecheck.is-bad b { color: var(--danger); }

@media (max-width: 420px) {
  .facebox { width: 200px; height: 200px; }
}



/* ── Davomat ────────────────────────────────────────────────────────── */
.chip.att-ontime { color: var(--free);    background: color-mix(in srgb, var(--free) 13%, transparent); }
.chip.att-late   { color: var(--paused);  background: color-mix(in srgb, var(--paused) 15%, transparent); }
.chip.att-absent { color: var(--danger);  background: color-mix(in srgb, var(--danger) 13%, transparent); }
.chip.att-offday { color: var(--gray);    background: color-mix(in srgb, var(--gray) 15%, transparent); }
.chip.att-none   { color: var(--muted);   background: var(--elev); }

/* Bir qator kvadrat — bir qarashda odamning oyi koʻrinadi. */
.attstrip { display: inline-flex; gap: 3px; flex-wrap: wrap; max-width: 270px; }
.attday { width: 11px; height: 11px; border-radius: 3px; background: var(--line-2); cursor: help; }
.attday.is-ontime { background: var(--free); }
.attday.is-late   { background: var(--paused); }
.attday.is-absent { background: color-mix(in srgb, var(--danger) 55%, transparent); }
.attday.is-offday { background: var(--line-2); }

.att-cam { display: flex; flex-direction: column; gap: 11px; }
.att-cam__row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.att-cam__row code { font-size: 12px; background: var(--elev); padding: 3px 8px; border-radius: 7px; overflow-wrap: anywhere; }
.att-key { letter-spacing: .02em; }
.att-cam__ex { font-size: 11.5px; line-height: 1.65; background: var(--elev); border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; margin: 0; overflow-x: auto; white-space: pre; color: var(--ink-2); }

/* Ish kunlarini tanlash */
.dowpick { display: flex; gap: 6px; flex-wrap: wrap; }
.dow { min-width: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.dow.on { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-1); }

/* ── Umumiy reyting ─────────────────────────────────────────────────── */
.scorerules { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; }
.scorerules span { font-size: 11.5px; color: var(--muted); background: var(--elev);
  border-radius: 20px; padding: 6px 13px; }

/* Birinchi uchtasi. Tartib medal rangida — raqamni oʻqimasdan ham koʻrinadi. */
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; }
.podium__p { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 20px 16px;
  border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; position: relative; overflow: hidden; }
.podium__p:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.podium__p::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line-2); }
.podium__p.is-1::before { background: linear-gradient(90deg, #e8b53a, #f6d678); }
.podium__p.is-2::before { background: linear-gradient(90deg, #9aa4b5, #c7cedb); }
.podium__p.is-3::before { background: linear-gradient(90deg, #b5763a, #d79f68); }
.podium__n { font-family: var(--serif); font-size: 13px; font-weight: 800; color: var(--muted); }
.podium__p .cav { width: 54px; height: 54px; font-size: 18px; }
.podium__name { font-weight: 650; font-size: 13.5px; text-align: center; }
.podium__pts { font-family: var(--serif); font-size: 26px; font-weight: 800; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.podium__pts span { font-family: var(--font); font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 5px; }

.rankno { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 8px;
  background: var(--elev); color: var(--muted); font-size: 12px; font-weight: 700; }
.rankno.is-1 { background: color-mix(in srgb, #e8b53a 25%, transparent); color: #a97c12; }
.rankno.is-2 { background: color-mix(in srgb, #9aa4b5 25%, transparent); color: #5d6675; }
.rankno.is-3 { background: color-mix(in srgb, #b5763a 25%, transparent); color: #8a5522; }
.rankbig { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
  background: var(--elev); color: var(--muted); font-family: var(--serif); font-size: 24px; font-weight: 800; }
.rankbig.is-1 { background: color-mix(in srgb, #e8b53a 25%, transparent); color: #a97c12; }
.rankbig.is-2 { background: color-mix(in srgb, #9aa4b5 25%, transparent); color: #5d6675; }
.rankbig.is-3 { background: color-mix(in srgb, #b5763a 25%, transparent); color: #8a5522; }

.pt-up { color: var(--free); }
.pt-down { color: var(--danger); }
.pt-flat { color: var(--muted); }
.sc-total { font-family: var(--serif); font-size: 16px; font-weight: 800; }

.scorehead { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.scorehead__rank { display: flex; align-items: center; gap: 13px; }
.scorehead__tot b { font-family: var(--serif); font-size: 28px; font-weight: 800; line-height: 1; }
.scorehead__tot span { font-size: 12.5px; margin-left: 7px; }
.scparts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 11px; margin-bottom: 16px; }
.scpart { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: var(--bg); }
.scpart__l { font-size: 11.5px; color: var(--muted); }
.scpart__n { font-family: var(--serif); font-size: 23px; font-weight: 800; line-height: 1.25; }
.scpart__s { font-size: 11.5px; }

.warn-text { color: var(--paused); }
.bad-text { color: var(--danger); }
.kpi.bad .label::before { background: var(--danger); }

@media (max-width: 720px) {
  .attstrip { max-width: 150px; }
  .scorehead__tot b { font-size: 24px; }
  /* Uchlik telefonda ham yonma-yon tursin — ustma-ust boʻlsa, jadvalgacha
     uch ekran aylantirish kerak boʻlardi. */
  .podium { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .podium__p { padding: 14px 7px; gap: 5px; }
  .podium__p .cav { width: 40px; height: 40px; font-size: 14px; }
  .podium__name { font-size: 11.5px; line-height: 1.35; overflow-wrap: anywhere; }
  .podium__pts { font-size: 17px; }
  .podium__pts span { display: block; margin: 2px 0 0; }
}

@media (max-width: 420px) {
  .rateqr__box svg { width: 185px; height: 185px; }
}

@media (max-width: 720px) {
  .rev-head { grid-template-columns: 1fr; gap: 12px; }
  .cert-row { flex-wrap: wrap; }
}

/* ══ THE AI AS A WRITING ASSISTANT ═════════════════════════════════════ */

/* the standing reminder that a draft is only a draft */
.ai-note {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border-radius: 11px;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-1);
  font-size: 12.5px; line-height: 1.55;
}
.ai-note svg { flex: 0 0 auto; margin-top: 1px; }

.ai-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px 12px; }

/* one drafted question, waiting to be kept or dropped */
.ai-draft {
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.ai-draft.is-on { border-color: var(--accent-1); background: var(--accent-soft); }
.ai-draft > input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--accent-1); }
.ai-draft b { font-size: 13px; overflow-wrap: anywhere; }

/* the answer, laid out so a wrong one is obvious at a glance */
.ai-ans { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-ans > span {
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2);
}
.ai-ans > span.is-right {
  background: color-mix(in srgb, var(--free) 14%, transparent);
  color: var(--free); font-weight: 600;
}

.ai-idea { border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; background: var(--surface); }
.ai-idea b { font-size: 13.5px; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .ai-types { grid-template-columns: 1fr 1fr; }
  .ai-idea .btn { margin-left: 0 !important; width: 100%; }
}

/* ══ LOST CONNECTION ═══════════════════════════════════════════════════
   The server stops counting work the moment it loses contact with the
   panel, so the screen says so instead of running on. */
#offlineBar {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(-150%);
  top: 10px; z-index: 900; padding: 8px 16px; border-radius: 999px;
  background: var(--paused); color: #fff; font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow); transition: transform .25s ease; pointer-events: none;
  max-width: calc(100vw - 24px); text-align: center;
}
#offlineBar.show { transform: translateX(-50%) translateY(0); }

/* Nothing is dimmed while offline any more: the clock is still running, and a
   greyed-out number would say the opposite. */

/* ── the uncounted-time question ─────────────────────────────────────── */
.gapask {
  border: 1px solid color-mix(in srgb, var(--paused) 34%, transparent);
  background: color-mix(in srgb, var(--paused) 9%, transparent);
  border-radius: 12px; padding: 11px 12px; margin-top: 10px;
}
.gapask__h { display: flex; align-items: center; gap: 7px; color: var(--paused); font-size: 13px; }
.gapask__b { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); margin: 6px 0 10px; }
.gapask__a { display: flex; gap: 8px; flex-wrap: wrap; }
.gapask__a .btn { flex: 1 1 auto; }

/* Academy — Edler-inspired explorer, lesson editor and reading workspace.
   Every rule is scoped to the LMS; studio screens keep their own theme. */
.lms-ui {
  --accent-1: #285bd4; --accent-2: #204db9; --accent: #285bd4;
  --accent-soft: #edf3ff; --accent-border: #c2d2f5;
  --ink: #18263c; --ink-2: #35435a; --muted: #657188; --faint: #7b8698;
  --line: #e5e9f0; --line-2: #d6dce7; --surface: #fff; --bg: #f5f7fa;
  --lms-navy: #11243e; --lms-success: #177549; --lms-success-bg: #eaf7ef;
  color: var(--ink); font: 400 14px/1.6 var(--sans, 'Inter', sans-serif);
  min-width: 0; width: 100%; margin-inline: auto;
}
[data-theme="dark"] .lms-ui {
  --accent-1: #8eb2ff; --accent-2: #aac5ff; --accent: #2c5ecb;
  --accent-soft: #202f49; --accent-border: #425b88;
  --ink: #eef2f9; --ink-2: #cdd6e5; --muted: #a5b2c7; --faint: #91a2bb;
  --line: #2d3b51; --line-2: #42516a; --surface: #192437; --bg: #131d2c;
  --lms-navy: #102139; --lms-success: #8ddeaf; --lms-success-bg: #173a2c;
}
.lms-ui *, .lms-ui *::before, .lms-ui *::after { box-sizing: border-box; }
.lms-ui [hidden] { display: none !important; }
.lms-ui :is(h2,h3,h4,p) { margin: 0; }
.lms-ui :is(h2,h3,h4) { font-family: inherit; letter-spacing: -.025em; color: var(--ink); }
.lms-ui h2 { font-size: clamp(24px, 2.3vw, 30px); line-height: 1.3; font-weight: 700; }
.lms-ui h3 { font-size: 17px; line-height: 1.45; font-weight: 650; }
.lms-ui button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
.lms-ui button:disabled { opacity: .45; cursor: default; }
.lms-ui :is(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid var(--accent-1); outline-offset: 3px; }
.lms-ui .btn { min-height: 44px; border-radius: 7px; font-size: 13px; font-weight: 600; padding: 10px 16px; box-shadow: none; transition: background .15s, border-color .15s; }
.lms-ui .btn:hover { transform: none; }
.lms-ui .btn--gold { background: var(--accent); border: 1px solid #285bd4; color: #fff; }
.lms-ui .btn--gold:hover { background: #214db8; }
.lms-ui .btn--ghost { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); }
.lms-ui .btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent-border); }
.lms-ui .btn--danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line)); }
.lms-ui .muted { color: var(--muted); }
.lms-ui .input { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 7px; min-height: 44px; font-size: 14px; box-shadow: none; }
.lms-ui .input:focus { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--accent-soft); }
.lms-ui .input::placeholder { color: var(--muted); }
.lms-ui .field label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.lms-ui svg { flex-shrink: 0; }
.lms-home { max-width: 1360px; }
.lms-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.lms-heading > div:first-child { min-width: 0; flex: 1; }
.lms-heading h2 { margin: 5px 0 9px; overflow-wrap: anywhere; }
.lms-heading p { color: var(--muted); font-size: 14px; max-width: 72ch; }
.lms-eyebrow { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.lms-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 14px; }
.lms-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.lms-stats--three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.lms-stat { display: flex; align-items: flex-start; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 20px; }
.lms-stat__icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent-1); background: var(--accent-soft); border-radius: 8px; flex: none; }
.lms-stat > div { display: grid; }
.lms-stat span:not(.lms-stat__icon) { font-size: 12px; color: var(--muted); }
.lms-stat strong { font-size: 28px; line-height: 1.5; font-weight: 650; font-variant-numeric: tabular-nums; }
.lms-stat small { font-size: 11px; color: var(--muted); }
.lms-section-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; margin-bottom: 26px; background: var(--lms-navy); border-radius: 9px; }
.lms-section-nav > button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 6px; background: transparent; color: #c8d4e7; font-weight: 500; font-size: 13px; }
.lms-section-nav > button:hover { background: #243955; color: #fff; }
.lms-section-nav > button.is-active { background: #fff; color: #183153; }
.lms-ui .lms-count { display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 5px; background: #294566; color: #fff; border-radius: 5px; font-size: 11px; }
.lms-library-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 17px; }
.lms-library-head h3 { margin-bottom: 3px; font-size: 19px; }
.lms-library-head .muted { font-size: 12px; }
.lms-view-switch { display: flex; padding: 3px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); }
.lms-icon-btn { border: 0; background: transparent; color: var(--muted); width: 40px; min-height: 40px; flex: 0 0 40px; display: inline-grid; place-items: center; border-radius: 6px; font-size: 17px; }
.lms-icon-btn:hover, .lms-icon-btn.is-active { color: var(--accent-1); background: var(--accent-soft); }
.lms-icon-btn svg { width: 17px; height: 17px; }
.lms-icon-btn.lms-danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.lms-filters { display: flex; align-items: center; gap: 12px; }
.lms-search { display: flex; align-items: center; gap: 10px; min-width: 180px; flex: 1; height: 46px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; color: var(--muted); }
.lms-search:focus-within { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--accent-soft); }
.lms-search input { min-width: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; outline: none !important; }
.lms-filters > select { width: auto; max-width: 225px; }
.lms-filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 18px 0; }
.lms-filter-tabs button { min-height: 38px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; padding: 7px 12px; display: inline-flex; align-items: center; gap: 8px; }
.lms-filter-tabs button span { font-size: 11px; color: var(--muted); }
.lms-filter-tabs button:hover { background: var(--surface); }
.lms-filter-tabs button.is-active { background: var(--surface); border-color: var(--accent-border); color: var(--accent-1); font-weight: 600; }
.lms-ui .lms-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%,280px),1fr)); gap: 20px; }
.lms-ui .lms-card { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 0; gap: 0; overflow: hidden; cursor: default; box-shadow: none; }
.lms-ui .lms-card:hover { transform: none; border-color: var(--accent-border); box-shadow: 0 5px 20px #16305c09; }
.lms-cover { position: relative; height: 138px; overflow: hidden; flex: none; background: #e9effb; color: #34528c; }
.lms-cover--1 { background: #e5f2ef; color: #28685b; }
.lms-cover--2 { background: #f5eedf; color: #796438; }
.lms-cover--3 { background: #eae9f2; color: #625588; }
.lms-cover__grid { position: absolute; inset: 0; opacity: .2; background-image: linear-gradient(currentColor 1px, transparent 1px),linear-gradient(90deg,currentColor 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(100deg,transparent 35%,#000); }
.lms-cover__shape { position: absolute; right: 35px; top: 25px; width: 80px; height: 80px; border: 18px solid currentColor; border-radius: 50%; opacity: .14; }
.lms-cover__mark { position: absolute; top: 30px; left: 24px; width: 46px; height: 46px; border-radius: 10px; background: #ffffffa8; display: grid; place-items: center; }
.lms-cover__mark svg { width: 25px; height: 25px; }
.lms-cover__label { position: absolute; left: 24px; right: 24px; bottom: 16px; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.lms-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lms-cover > img:not([src]) { display: none; }
.lms-card__content { display: flex; flex-direction: column; flex: 1; padding: 20px; min-width: 0; }
.lms-card__tags { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.lms-card__tags > span:last-child { font-size: 10px; color: var(--muted); }
.lms-status { display: inline-flex; align-items: center; width: fit-content; gap: 6px; padding: 3px 8px; border-radius: 5px; background: var(--bg); color: var(--muted); font-size: 11px; line-height: 1.7; font-weight: 600; }
.lms-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.lms-status--published, .lms-status--completed { background: var(--lms-success-bg); color: var(--lms-success); }
.lms-status--in_progress { background: var(--accent-soft); color: var(--accent-1); }
.lms-status--draft, .lms-status--overdue { background: #fff5de; color: #855613; }
[data-theme="dark"] .lms-status--draft, [data-theme="dark"] .lms-status--overdue { background: #42331b; color: #efc57a; }
.lms-card__open { text-align: left; padding: 0; margin: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.lms-card__open:hover { color: var(--accent-1); }
.lms-ui .lms-card__d { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 9px; min-height: 40px; }
.lms-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 11px; margin: 18px 0; }
.lms-card__meta > span { display: inline-flex; align-items: center; gap: 6px; }
.lms-card__meta svg { width: 14px; height: 14px; }
.lms-card__progress { margin-bottom: 18px; }
.lms-card__progress > span { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.lms-card__progress b { color: var(--ink-2); }
.lms-ui .lms-prog { height: 5px; min-height: 5px; background: var(--line); border-radius: 4px; }
.lms-ui .lms-prog > i { background: var(--accent-1); }
.lms-ui .lms-card__f { border-top: 1px solid var(--line); padding-top: 13px; align-items: center; gap: 8px; margin-top: auto; font-size: 11px; }
.lms-card__cta { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--accent-1); font-size: 12px; font-weight: 600; padding: 5px 0; min-height: 35px; text-align: left; }
.lms-card__cta:hover { text-decoration: underline; }
.lms-ui .lms-grid--list { grid-template-columns: 1fr; gap: 12px; }
.lms-grid--list .lms-card { display: grid; grid-template-columns: 130px minmax(0,1fr); }
.lms-grid--list .lms-cover { height: 100%; min-height: 170px; }
.lms-grid--list .lms-cover__label { font-size: 10px; overflow-wrap: anywhere; }
.lms-grid--list .lms-card__content { padding: 16px 22px; }
.lms-grid--list .lms-card__d { min-height: 0; margin-top: 4px; -webkit-line-clamp: 1; }
.lms-grid--list .lms-card__tags { margin-bottom: 5px; }
.lms-grid--list .lms-card__meta { margin: 9px 0; }
.lms-grid--list .lms-card__progress { max-width: 400px; margin-bottom: 12px; }
.lms-assist { display: flex; align-items: center; gap: 17px; margin-top: 30px; padding: 20px 22px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; }
.lms-assist > div { flex: 1; }
.lms-assist h3 { font-size: 14px; }
.lms-assist p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.lms-assist__icon { color: var(--accent-1); }
.lms-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; border: 1px dashed var(--line-2); background: var(--surface); border-radius: 10px; padding: 48px 24px; }
.lms-empty p { color: var(--muted); max-width: 45ch; }
.lms-empty__icon { display: grid; place-items: center; width: 54px; height: 54px; background: var(--accent-soft); color: var(--accent-1); border-radius: 12px; margin-bottom: 4px; }
.lms-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.lms-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.lms-table :is(th,td) { padding: 16px; border-bottom: 1px solid var(--line); }
.lms-table th { color: var(--muted); font-size: 11px; font-weight: 600; background: var(--bg); }
.lms-table tr:last-child td { border-bottom: 0; }
.lms-person-name { display: flex; align-items: center; gap: 12px; min-width: 160px; }
.lms-avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-1); border-radius: 50%; font-size: 10px; font-weight: 700; }
.lms-table-progress { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.lms-table-progress .lms-prog { min-width: 60px; }
.lms-breadcrumb { display: flex; align-items: center; gap: 12px; margin: -3px 0 21px; color: var(--muted); font-size: 12px; }
.lms-breadcrumb > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lms-breadcrumb button { display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 6px 0; background: transparent; color: var(--muted); font-size: 12px; min-height: 36px; flex-shrink: 0; }
.lms-breadcrumb button:hover { color: var(--accent-1); }
.lms-course-layout { display: grid; grid-template-columns: 245px minmax(0,1fr); gap: 24px; align-items: start; }
.lms-course-rail { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lms-course-rail > .lms-cover { height: 130px; }
.lms-course-rail__body { padding: 20px 16px; }
.lms-course-facts { display: grid; gap: 12px; margin: 22px 0; font-size: 12px; }
.lms-course-facts > div { display: flex; justify-content: space-between; gap: 10px; }
.lms-course-facts dt { color: var(--muted); }
.lms-course-facts dd { margin: 0; font-weight: 600; text-align: right; }
.lms-course-menu { display: grid; gap: 5px; margin: 0 -7px; padding: 16px 0; border-block: 1px solid var(--line); }
.lms-course-menu button { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); text-align: left; font-size: 12px; min-height: 44px; }
.lms-course-menu button > span { margin-left: auto; }
.lms-course-menu button:hover, .lms-course-menu button.is-active { background: var(--accent-soft); color: var(--accent-1); }
.lms-course-certificate { display: flex; align-items: flex-start; gap: 9px; margin: 20px 0; font-size: 11px; color: var(--muted); }
.lms-course-content { min-width: 0; }
.lms-curriculum-section { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.lms-session-heading { display: flex; align-items: center; gap: 3px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.lms-section-toggle { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; border: 0; padding: 5px 0; background: transparent; text-align: left; color: var(--ink); }
.lms-section-toggle > span:nth-child(2) { min-width: 0; flex: 1; }
.lms-section-toggle b { display: block; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.lms-section-toggle small { color: var(--muted); font-size: 11px; display: block; margin-top: 3px; }
.lms-section-number { display: grid; place-items: center; width: 33px; height: 33px; flex: none; background: var(--bg); color: var(--muted); font-size: 11px; border-radius: 6px; }
.lms-section-toggle[aria-expanded="false"] .lms-chevron { transform: rotate(-90deg); }
.lms-section-description { padding: 16px 22px; color: var(--muted); font-size: 13px; }
.lms-unit-row { display: flex; align-items: center; gap: 9px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.lms-unit-row:hover { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.lms-unit-icon { display: grid; place-items: center; width: 32px; height: 32px; background: var(--accent-soft); color: var(--accent-1); border-radius: 50%; flex: none; }
.lms-unit-icon svg { width: 16px; height: 16px; }
.lms-unit-icon.is-quiz { background: var(--lms-success-bg); color: var(--lms-success); }
.lms-unit-title { background: transparent; padding: 5px 0; border: 0; flex: 1; min-width: 0; color: var(--ink-2); text-align: left; }
.lms-unit-title b { display: block; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.lms-unit-title:hover b { color: var(--accent-1); }
.lms-unit-title small { color: var(--muted); display: block; font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; }
.lms-reorder { display: inline-flex; flex: none; }
.lms-reorder .lms-icon-btn { width: 30px; flex-basis: 30px; }
.lms-section-add { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 18px; }
.lms-section-add .btn { color: var(--accent-1); border-color: transparent; font-size: 12px; }
.lms-exam-section { display: flex; align-items: flex-start; gap: 16px; border: 1px solid var(--line); border-radius: 9px; padding: 22px; background: var(--surface); }
.lms-exam-section > div { flex: 1; min-width: 0; }
.lms-exam-section h3 { font-size: 15px; }
.lms-exam-section p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.lms-exam-link { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; width: 100%; text-align: left; margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink-2); font-size: 12px; }
.lms-exam-link > b { flex: 1; }
.lms-resume { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow: hidden; margin-bottom: 30px; }
.lms-resume__content { flex: 1; min-width: 0; padding: 25px; }
.lms-resume h3 { font-size: 22px; margin: 8px 0; }
.lms-resume p { color: var(--muted); font-size: 13px; max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lms-resume__progress { display: flex; align-items: center; gap: 14px; max-width: 340px; margin: 17px 0; color: var(--muted); font-size: 12px; }
.lms-resume__art { width: 210px; height: auto; min-height: 215px; }
.lms-resume__art .lms-cover__shape { width: 130px; height: 130px; top: 60px; right: 30px; border-width: 27px; }
.lms-player-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.lms-player-heading h2 { font-size: 23px; margin-top: 6px; }
.lms-ui .lms-player { display: grid; grid-template-columns: 275px minmax(0,1fr); gap: 24px; align-items: start; }
.lms-outline { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; position: sticky; top: 16px; }
.lms-outline > summary { display: flex; align-items: center; gap: 9px; padding: 18px; min-height: 60px; font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; }
.lms-outline > summary::-webkit-details-marker { display: none; }
.lms-outline > summary > span:first-of-type { margin-left: auto; color: var(--muted); font-size: 11px; }
.lms-outline-progress { padding: 0 18px 22px; }
.lms-outline-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 11px; color: var(--muted); }
.lms-ui .lms-player__list { border: 0; background: transparent; padding: 0 9px 18px; max-height: min(64vh,800px); overflow: auto; border-radius: 0; }
.lms-ui .lms-plist__s { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-2); padding: 16px 10px 8px; display: flex; align-items: flex-start; gap: 10px; }
.lms-plist__s > span { font-size: 10px; color: var(--muted); margin-top: 2px; }
.lms-ui .lms-plist__l { align-items: flex-start; border-radius: 6px; padding: 12px 10px; min-height: 53px; gap: 10px; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.lms-ui .lms-plist__l.is-active { background: var(--accent-soft); color: var(--accent-1); font-weight: 600; }
.lms-ui .lms-plist__c { width: 23px; height: 23px; border: 1px solid var(--line-2); color: var(--muted); border-radius: 50%; margin-top: 0; }
.lms-ui .is-active > .lms-plist__c { background: #285bd4; color: #fff; border-color: #285bd4; }
.lms-ui .is-done > .lms-plist__c { color: var(--lms-success); background: var(--lms-success-bg); border-color: transparent; }
.lms-outline-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lms-outline-title small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; margin-top: 3px; }
.lms-player__stage { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow: hidden; }
.lms-ui .lms-player__body { padding: clamp(20px,3vw,42px); min-height: 420px; }
.lms-lesson-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 15px; color: var(--muted); font-size: 11px; }
.lms-lesson-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.lms-lesson-meta svg { width: 15px; height: 15px; }
.lms-ui .lms-lesson-title { font-family: inherit; font-size: clamp(22px,2.3vw,29px); line-height: 1.4; margin: 0 0 28px; font-weight: 650; overflow-wrap: anywhere; }
.lms-ui .lms-body { color: var(--ink-2); font-size: 15px; line-height: 1.9; max-width: 75ch; margin: 22px 0 0; overflow-wrap: anywhere; }
.lms-ui .lms-video { max-height: 65vh; border-radius: 7px; aspect-ratio: 16/9; object-fit: contain; }
.lms-ui .lms-pdf { height: 65vh; max-height: none; border-radius: 7px; }
.lms-ui .lms-image { border-radius: 7px; max-height: 70vh; object-fit: contain; }
.lms-ui .lms-player__foot { padding: 18px 22px; background: var(--surface); border-top: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.lms-completed-label { display: inline-flex; align-items: center; gap: 8px; color: var(--lms-success); font-size: 12px; }
.lms-reader-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 15px; }
.lms-reader-controls button { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 10px 14px; color: var(--muted); font-size: 12px; min-height: 44px; }
.lms-reader-controls button[aria-pressed="true"] { color: var(--accent-1); background: var(--accent-soft); border-color: var(--accent-border); }
.lms-ui.lms-reading .lms-player { grid-template-columns: minmax(0,1fr); max-width: 1020px; margin-inline: auto; }
.lms-reading .lms-outline { display: none; }
.lms-reading .lms-body { margin-inline: auto; }
.lms-ui.lms-dialog { width: min(740px,100%); border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.lms-ui.lms-dialog--wide { width: min(1120px,100%); }
.lms-dialog > .panel__h { gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface); padding: 16px 22px; }
.lms-dialog > .panel__h h3 { flex: 1; font: 650 18px/1.4 var(--sans, 'Inter',sans-serif); }
.lms-dialog > .panel__b { padding: 26px; }
.lms-dialog .quiz-build { max-width: 930px; margin-inline: auto; }
.lms-dialog .quiz-q, .lms-dialog .quiz-rev, .lms-dialog .quiz-mark { border-radius: 8px; padding: 20px; margin-bottom: 14px; }
.lms-dialog .quiz-q__h b, .lms-dialog .quiz-rev b { font-size: 14px; }
.lms-dialog .quiz-q__b, .lms-dialog .quiz-rev__b { margin-top: 14px; font-size: 13px; line-height: 1.7; }
.lms-dialog .quiz-q__n { border-radius: 50%; width: 27px; height: 27px; }
.lms-dialog .quiz-take { max-width: 800px; margin-inline: auto; gap: 24px; }
.lms-dialog .quiz-take__body { padding: 20px 0; min-height: 250px; }
.lms-dialog .quiz-dots { gap: 8px; }
.lms-dialog .quiz-dot { width: 40px; height: 40px; border-radius: 6px; }
.lms-dialog .quiz-pick { border-radius: 7px; padding: 16px; min-height: 56px; font-size: 15px; }
.lms-dialog .quiz-banner { border-radius: 8px; padding: 28px; }
.lms-dialog .lms-person { border-radius: 7px; min-height: 60px; }
.lms-dialog .lms-people { max-height: 50vh; gap: 8px; }
.lms-form-intro { color: var(--muted); font-size: 13px; padding-bottom: 8px; }
.lms-cover-picker { border: 1px dashed var(--line-2); border-radius: 8px; padding: 18px; background: var(--bg); }

/* Toʻliq rasm: shu yerda muqovaning markazi belgilanadi. */
.lms-cover-focus {
  position: relative; border-radius: 7px; overflow: hidden; margin-bottom: 14px;
  cursor: crosshair; touch-action: none; background: var(--surface);
  max-height: 190px; display: flex; justify-content: center;
}
.lms-cover-focus img { max-width: 100%; max-height: 190px; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.lms-cover-focus__dot {
  position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(16,24,40,.55);
  background: rgba(255,255,255,.28); pointer-events: none;
}

/* Uchta joy yonma-yon. Har biri mustaqil: oʻz rasmi, oʻz kadrlashi va
   ostida rasmning haqiqiy oʻlchami. Nisbatlar haqiqiy sahifadagidek. */
.lms-cover-preview__t { font-size: 11.5px; color: var(--muted); margin-bottom: 9px; }
/* Uchta teng ustun. Kadrlar shakli har xil, shuning uchun har biri bir xil
   balandlikdagi maydon ichida markazlashadi — aks holda kartalar turli
   balandlikda boʻlib, roʻyxat tartibsiz koʻrinardi. */
.cslots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.cslot {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.cslot__h { display: flex; flex-direction: column; gap: 2px; }
.cslot__h > b { font-size: 12.5px; line-height: 1.25; }
.cslot__need, .cslot__nat { font-size: 11px; color: var(--muted); }
.cslot__stage { height: 136px; display: grid; place-items: center; }
.cslot__shared { font-size: 11px; color: var(--muted); font-style: italic; }
/* Tugmalar har doim kartaning tagida, bir chiziqda turadi. */
.cslot__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 2px; }
.cslot__fit { align-self: flex-start; }
.cslot .lms-cover-focus { max-height: 84px; margin: 0; }
.cslot .lms-cover-focus img { max-height: 84px; }
/* Oʻlchamlar haqiqiy nisbatlarga mos va 200×136 maydonga sigʻadi. */
.lms-cover-shape { margin: 0; }
.lms-cover-shape > .lms-cover { border-radius: 6px; }
.lms-cover-shape--card > .lms-cover { width: 200px; height: 77px; }
.lms-cover-shape--banner > .lms-cover { width: 120px; height: 136px; }
.lms-cover-shape--rail > .lms-cover { width: 200px; height: 95px; }

@media (max-width: 620px) {
  .cslots { grid-template-columns: minmax(0, 1fr); }
  .cslot__stage { height: auto; }
}
/* Kichik kadrda bezaklar joylashmaydi; rasm boʻlmaganda ham toza koʻrinsin. */
.lms-cover-shape .lms-cover__mark { top: 10px; left: 10px; width: 28px; height: 28px; border-radius: 7px; }
.lms-cover-shape .lms-cover__mark svg { width: 15px; height: 15px; }
.lms-cover-shape .lms-cover__label { left: 10px; right: 10px; bottom: 7px; font-size: 9px; }
.lms-cover-shape .lms-cover__shape { right: 14px; top: 12px; width: 44px; height: 44px; border-width: 10px; }

.lms-cover-picker p { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.lms-editor-layout { display: grid; grid-template-columns: 225px minmax(0,1fr); gap: 24px; align-items: start; }
.lms-editor-outline { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 17px; }
.lms-editor-outline h4 { font-size: 12px; margin-bottom: 18px; }
.lms-editor-outline .lms-plist__s { padding-inline: 0; }
.lms-editor-outline .lms-editor-lesson { display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px; font-size: 11px; border-radius: 5px; color: var(--muted); }
.lms-editor-lesson.is-active { color: var(--accent-1); background: var(--accent-soft); }
.lms-editor-lesson svg { width: 15px; height: 15px; margin-top: 2px; }
.lms-editor-layout #lessonForm { min-width: 0; }
.lms-editor-layout #lessonForm > .field, .lms-editor-layout #lessonForm > .row { padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.lms-editor-preview { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 7px; }
body:has(.lms-dialog) { overflow: hidden; }
@media (max-width: 1120px) {
  .lms-stats { gap: 10px; }
  .lms-stat { padding: 16px; gap: 10px; }
  .lms-stat__icon { width: 32px; height: 32px; }
  .lms-course-layout { grid-template-columns: 210px minmax(0,1fr); gap: 18px; }
  .lms-ui .lms-player { grid-template-columns: 240px minmax(0,1fr); gap: 18px; }
  .lms-unit-row { flex-wrap: wrap; }
  .lms-unit-title { flex-basis: calc(100% - 55px); }
  .lms-unit-row .lms-reorder { margin-left: 41px; }
  .lms-exam-section { flex-wrap: wrap; }
  .lms-exam-section > .btn { margin-left: 48px; }
  .lms-heading { flex-wrap: wrap; gap: 10px; }
  .lms-actions { padding-top: 0; }
}
@media (max-width: 760px) {
  .lms-ui { font-size: 14px; }
  .lms-ui .input, .lms-ui textarea, .lms-search input { font-size: 16px; }
  .lms-heading { margin-bottom: 20px; }
  .lms-heading p { font-size: 13px; }
  .lms-heading > div:first-child { flex-basis: 100%; }
  .lms-actions { width: 100%; }
  .lms-actions .btn { flex: 1; }
  .lms-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lms-stats--three { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .lms-stat { padding: 13px; }
  .lms-stat__icon { display: none; }
  .lms-stat strong { font-size: 25px; }
  .lms-stat small { font-size: 10px; }
  .lms-stat span:not(.lms-stat__icon) { font-size: 11px; }
  .lms-section-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 6px; }
  .lms-section-nav > button { font-size: 11px; padding: 10px 8px; gap: 6px; justify-content: flex-start; }
  .lms-section-nav svg { width: 16px; height: 16px; }
  .lms-filters { flex-wrap: wrap; gap: 10px; }
  .lms-search { flex-basis: 100%; }
  .lms-filters > select { flex: 1; min-width: 0; max-width: none; width: 0; font-size: 12px; }
  .lms-filter-tabs { gap: 3px; }
  .lms-filter-tabs button { min-height: 44px; padding: 7px 8px; font-size: 11px; gap: 5px; }
  .lms-icon-btn { width: 44px; min-height: 44px; flex-basis: 44px; }
  .lms-ui .lms-grid { grid-template-columns: 1fr; }
  .lms-grid--list .lms-card { grid-template-columns: 64px minmax(0,1fr); }
  .lms-grid--list .lms-card__content { padding: 15px; }
  .lms-grid--list .lms-cover__mark { left: 12px; top: 24px; width: 40px; height: 40px; }
  .lms-grid--list .lms-cover__label, .lms-grid--list .lms-cover__shape { display: none; }
  .lms-card__tags { flex-wrap: wrap; }
  .lms-ui .lms-card__f { align-items: flex-start; }
  .lms-card__cta { min-height: 44px; }
  .lms-card__open { min-height: 44px; display: flex; align-items: center; }
  .lms-assist { flex-wrap: wrap; padding: 18px; gap: 12px; }
  .lms-assist__icon { display: none; }
  .lms-assist .btn { width: 100%; }
  .lms-course-layout { grid-template-columns: 1fr; }
  .lms-course-rail > .lms-cover, .lms-course-facts, .lms-course-certificate { display: none; }
  .lms-course-rail__body > .btn--danger { margin-top: 12px; }
  .lms-course-rail__body { padding: 12px; }
  .lms-course-menu { display: flex; flex-wrap: wrap; padding: 10px 0 0; margin: 0; border: 0; gap: 4px; }
  .lms-course-menu button { padding: 10px; font-size: 12px; }
  .lms-library-head { align-items: flex-start; flex-wrap: wrap; }
  .lms-library-head .btn { font-size: 12px; }
  .lms-session-heading { flex-wrap: wrap; padding: 12px; gap: 3px; }
  .lms-section-toggle { flex-basis: calc(100% - 12px); }
  .lms-session-heading > .lms-reorder { margin-left: 42px; }
  .lms-reorder .lms-icon-btn { width: 44px; flex-basis: 44px; }
  .lms-unit-row { padding: 12px; gap: 7px; }
  .lms-section-add { padding: 10px; gap: 5px; }
  .lms-section-add .btn { flex: 1; padding: 10px 7px; }
  .lms-exam-section { padding: 18px; }
  .lms-resume__art { display: none; }
  .lms-resume__content { padding: 22px; }
  .lms-resume h3 { font-size: 20px; }
  .lms-player-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .lms-player-heading h2 { font-size: 21px; }
  .lms-ui .lms-player { grid-template-columns: 1fr; gap: 14px; }
  .lms-outline { position: static; }
  .lms-ui .lms-player__list { max-height: 45vh; }
  .lms-ui .lms-player__body { padding: 23px 18px; min-height: 300px; }
  .lms-ui .lms-body { font-size: 16px; line-height: 1.85; }
  .lms-ui .lms-player__foot { padding: 13px; gap: 8px; }
  .lms-ui .lms-player__foot .btn { min-width: 0; padding: 11px 10px; flex: 1; font-size: 11px; }
  .lms-ui .lms-player__foot [data-action="learn-done"], .lms-ui .lms-player__foot [data-action="quiz-take"] { flex-basis: 100%; order: -1; }
  .lms-ui .lms-pdf { height: 55vh; }
  .lms-ui.lms-dialog { max-height: 96dvh; border-radius: 12px 12px 0 0; }
  .lms-dialog > .panel__h { padding: 12px 16px; }
  .lms-dialog > .panel__h h3 { font-size: 16px; }
  .lms-dialog > .panel__b { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .lms-dialog .quiz-dot { width: 44px; height: 44px; }
  .lms-dialog .quiz-q, .lms-dialog .quiz-rev { padding: 16px; }
  .lms-editor-layout { grid-template-columns: 1fr; }
  .lms-editor-outline { display: none; }
  .lms-editor-layout #lessonForm > .field, .lms-editor-layout #lessonForm > .row { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .lms-ui *, .lms-ui *::before, .lms-ui *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ══ MUQOVA KADRLASH VA PDF OʻQISH ═════════════════════════════════════ */

/* Kadrlash adminning tanloviga bogʻliq, shuning uchun object-fit endi bu
   yerdan emas, har bir rasmning oʻzidan keladi. */
.lms-cover > img { object-fit: cover; object-position: 50% 50%; }
/* "Toʻliq koʻrsatish"da rasm ortida oq fon — banner odatda oq fonli boʻladi
   va rangli fon ustida gʻalati koʻrinadi. */
.lms-cover > img[style*="contain"] { background: #ffffff; }

/* Fokus nuqtasini tanlash mumkin boʻlganda buni koʻrsatib turish */
.lms-cover.is-focusable { cursor: crosshair; }
.lms-cover.is-focusable::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--accent-1);
  opacity: 0; transition: opacity .15s ease;
}
.lms-cover.is-focusable:hover::after { opacity: .85; }

.lms-cover-fit { margin-top: 10px; }
.lms-cover-fit__label {
  display: block; font-size: 11.5px; font-weight: 650; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.lms-cover-fit .muted { font-size: 11.5px; line-height: 1.5; margin-top: 6px; }

/* ── PDF ─────────────────────────────────────────────────────────────────
   Kichkina oynada 13 sahifali qoʻllanmani oʻqib boʻlmaydi, shuning uchun
   balandroq, va bir bosishda butun ekranga chiqadi. */
.lms-pdf-wrap { position: relative; }
.lms-pdf { height: 72vh; min-height: 420px; }
.lms-ui .lms-pdf { height: 72vh; }
.lms-pdf-full { margin-top: 8px; }

.lms-pdf-wrap.is-full {
  position: fixed; inset: 0; z-index: 940; margin: 0;
  background: var(--bg); padding: 52px 14px 14px;
}
.lms-pdf-wrap.is-full .lms-pdf {
  height: 100%; min-height: 0; border-radius: 10px;
}
.lms-pdf-wrap.is-full .lms-pdf-full {
  position: absolute; top: 10px; right: 14px; margin: 0; z-index: 1;
}
body.pdf-full-open { overflow: hidden; }

@media (max-width: 720px) {
  .lms-pdf, .lms-ui .lms-pdf { height: 64vh; min-height: 320px; }
  .lms-pdf-wrap.is-full { padding: 50px 8px 8px; }
}

/* ══ DARS PDF KOʻRUVCHISI ══════════════════════════════════════════════════
   Brauzerning oʻz koʻruvchisi oʻrniga. Sahifalar konteyner kengligiga toʻliq
   moslanadi, ketma-ket oʻqiladi, va faqat koʻzga yaqinlashgani chiziladi. */
.pdfv {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg); display: flex; flex-direction: column;
}
.pdfv__bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--surface); flex: none;
}
.pdfv__name {
  font-size: 12.5px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1;
}
.pdfv__pages { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pdfv__tools { display: flex; gap: 6px; flex: none; }
.pdfv__tools .btn { padding: 4px 9px; }

.pdfv__scroll {
  /* Balandlikni JS ekranda qolgan joyga qarab qoʻyadi; bu yerdagisi u
     ishga tushgunicha amal qiladi. min-height kichik: aks holda JS qoʻygan
     balandlikni orqaga surib, koʻruvchi ekrandan chiqib ketardi. */
  /* Kattalashtirilgan sahifa konteynerdan keng boʻlishi mumkin — oʻshanda
     yon tomonga surish kerak, shuning uchun overflow-x yopiq emas. */
  height: 74vh; min-height: 240px; overflow: auto;
  padding: 12px; background: color-mix(in srgb, var(--ink) 6%, transparent);
  overscroll-behavior: contain;
}
.pdfv__loading { text-align: center; padding: 40px 0; font-size: 12.5px; color: var(--muted); }

/* Sahifa. Chizilmagani ham joy egallaydi, shuning uchun scroll sakramaydi.
   Enini JS qoʻyadi — bu yerda max-width turgani uchun kattalashtirish ish
   bermasdi: sahifa konteyner enidan oshmay, "+" tugmasi hech narsa
   qilmayotgandek koʻrinardi. */
.pdfv__page {
  background: #fff; border-radius: 6px; margin: 0 auto 12px;
  box-shadow: 0 1px 3px rgba(16,24,40,.14); overflow: hidden;
}
.pdfv__page:last-child { margin-bottom: 0; }
.pdfv__page canvas { display: block; width: 100%; height: auto; }

/* Butun ekran. Bu paytda element body ning bevosita bolasi boʻladi, shuning
   uchun uni hech narsa bosib qololmaydi. */
.pdfv.is-full {
  position: fixed; inset: 0; z-index: 2100; border-radius: 0; border: 0;
}
.pdfv.is-full .pdfv__bar { padding: 10px 14px; }
.pdfv.is-full .pdfv__scroll { height: auto; flex: 1; min-height: 0; }
body.pdf-full-open { overflow: hidden; }

@media (max-width: 720px) {
  .pdfv__scroll { height: 68vh; min-height: 240px; padding: 8px; }
  .pdfv__name { display: none; }          /* telefonda tugmalarga joy kerak */
  .pdfv__bar { padding: 7px 8px; }
}

/* ══ HUJJATLAR ═════════════════════════════════════════════════════════════
   Studiya beradigan fayllar roʻyxati. Bir xil koʻrinish uch joyda: admin
   sahifasida, dizaynerning Oʻqish boʻlimida va asosiy sahifasida. */
.doc-list { display: flex; flex-direction: column; gap: 9px; }
.doc {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.doc__icon {
  flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent-1) 12%, transparent); color: var(--accent-1);
}
.doc__icon svg { width: 19px; height: 19px; }
.doc__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc__main > b { font-size: 13.5px; overflow-wrap: anywhere; }
.doc__note { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.doc__meta { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.doc__go { flex: none; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 640px) {
  .doc { flex-wrap: wrap; }
  .doc__go { width: 100%; justify-content: flex-start; }
}

/* ══ INTIZOM TARTIBI ═══════════════════════════════════════════════════════
   Besh pogʻonali zina. Bosib oʻtilgani toʻlgan, hozirgisi ajratilgan,
   keyingilari xira — dizayner qaysi tomonga ketayotganini bir qarashda
   koʻrishi uchun. */
.dladder { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; counter-reset: none; }
.dladder__s {
  flex: 1 1 128px; min-width: 118px; position: relative;
  display: flex; flex-direction: column; gap: 5px;
  padding: 11px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg);
  color: var(--muted);
}
.dladder__n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700;
  background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--muted);
}
.dladder__t { font-size: 12px; font-weight: 600; line-height: 1.3; }
.dladder__here { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Bosib oʻtilgan pogʻonalar. */
.dladder__s.is-past { color: var(--ink); background: color-mix(in srgb, var(--paused) 10%, var(--surface)); border-color: color-mix(in srgb, var(--paused) 32%, var(--line)); }
.dladder__s.is-past .dladder__n { background: color-mix(in srgb, var(--paused) 26%, transparent); color: var(--ink); }

/* Hozirgi pogʻona. */
.dladder__s.is-now {
  color: var(--ink);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 22%, transparent);
}
.dladder__s.is-now .dladder__n { background: var(--danger); color: #fff; }
.dladder__s.is-now .dladder__here { color: var(--danger); }

/* Keyingisi nima boʻlishi. */
.dnext { font-size: 12.5px; color: var(--muted); padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.dnext.is-warn { color: var(--ink); background: color-mix(in srgb, var(--danger) 9%, transparent); }

/* Yozib qoʻyilgan pogʻonalar. Pogʻona nomi tepada, oʻz rangi bilan —
   qaysi bosqich ekani birinchi navbatda koʻzga tashlansin. */
.dsteps { display: flex; flex-direction: column; gap: 9px; }
.dstep {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  border-left: 3px solid var(--dstep-c, var(--line));
}
.dstep__h { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.dstep__tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 11px 4px 5px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--dstep-c, var(--ink)) 15%, transparent);
  color: var(--dstep-c, var(--ink));
}
.dstep__n {
  width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10.5px; background: var(--dstep-c, var(--ink)); color: #fff;
}
/* Har bir pogʻonaning oʻz rangi: pastdan yuqoriga qarab quyuqlashadi. */
.dstep--verbal    { --dstep-c: #5b8def; }
.dstep--letter    { --dstep-c: #d9a93a; }
.dstep--reprimand { --dstep-c: #e3863c; }
.dstep--review    { --dstep-c: #d9534f; }
.dstep--dismissal { --dstep-c: #b02a26; }
.dstep__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dstep__body > b { font-size: 13px; overflow-wrap: anywhere; }
.dstep__note { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.dstep__meta { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.dstep__go { flex: none; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Studiya qoidalari. Izohi yopiq turadi — roʻyxat qisqa va oʻqishli
   boʻlsin; uchburchak bosilganda ochiladi. */
.drules { display: flex; flex-direction: column; gap: 7px; }
.drule { border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.drule > summary, .drule--plain { display: flex; align-items: center; gap: 10px; padding: 10px 13px; cursor: pointer; list-style: none; }
.drule--plain { cursor: default; }
.drule > summary::-webkit-details-marker { display: none; }
.drule__t { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 650; overflow-wrap: anywhere; }
.drule__caret { flex: none; color: var(--muted); font-size: 15px; line-height: 1; transition: transform .16s ease; }
.drule[open] > summary .drule__caret { transform: rotate(180deg); }
.drule[open] > summary { border-bottom: 1px solid var(--line); }
.drule__b { display: block; font-size: 12px; color: var(--muted); line-height: 1.65; padding: 11px 13px; }
.drule.is-arch, .drule-row.is-arch { opacity: .55; }
.drules-admin { display: flex; flex-direction: column; gap: 9px; }
.drule-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.drule-row__m { flex: 1; min-width: 0; }
.drule-row__a { flex: none; display: flex; gap: 6px; }

@media (max-width: 640px) {
  .dstep { flex-wrap: wrap; }
  .dstep__go { width: 100%; justify-content: flex-start; }
  .drule-row { flex-wrap: wrap; }
}

/* Intizom boʻlimi: chapda odamlar, oʻngda tanlanganining yozuvi. */
.dsplit { display: grid; grid-template-columns: 290px minmax(0, 1fr); align-items: stretch; }
.dsplit__list { border-right: 1px solid var(--line); max-height: 560px; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.dsplit__one { padding: 16px; min-width: 0; }
.dperson {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; cursor: pointer; text-align: left; color: inherit;
}
.dperson:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.dperson.is-active { background: color-mix(in srgb, var(--accent-1) 11%, transparent); border-color: color-mix(in srgb, var(--accent-1) 32%, transparent); }
.dperson__m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dperson__m > b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 860px) {
  .dsplit { grid-template-columns: minmax(0, 1fr); }
  .dsplit__list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 240px; }
}

/* Muhokama natijasi — intizom yozuvidagi eng muhim maʼlumot, shuning uchun
   meta qatorida emas, alohida va kattaroq. */
.dout {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; padding: 6px 13px; border-radius: 999px;
  margin-bottom: 3px;
}
.dout svg { width: 15px; height: 15px; }
.dout--stay { background: color-mix(in srgb, var(--free, #3fa06a) 16%, transparent); color: var(--free, #3fa06a); }
.dout--leave { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

/* Super guruhning boʻlimlari. Har qatorda uchta narsa bor: boʻlim nomi,
   guruhda yozilishi kerak boʻlgan soʻz va Telegramdan kelgan raqam —
   shuning uchun qator, jadval emas. */
.tgtopics { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.tgtopics__h { font-size: 13px; font-weight: 650; margin-bottom: 5px; }
.tgtopic { display: grid; grid-template-columns: 1fr auto 120px; align-items: center; gap: 10px; margin-bottom: 8px; }
.tgtopic__n { font-size: 12.5px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tgtopic__c {
  font-size: 11.5px; color: var(--accent-1);
  background: color-mix(in srgb, var(--accent-1) 10%, transparent);
  border-radius: 7px; padding: 4px 9px; white-space: nowrap;
}
.tgtopic .input { padding: 8px 10px; font-size: 12.5px; }

@media (max-width: 640px) {
  /* Telefonda uchta ustun sigʻmaydi: nomi va soʻzi bir qatorda, raqam ostida. */
  .tgtopic { grid-template-columns: 1fr auto; gap: 7px 10px; margin-bottom: 12px; }
  .tgtopic .input { grid-column: 1 / -1; }
}

/* Har kimning oʻz ish vaqti: ism va ikkita soat. Telefonda soatlar ism
   ostiga tushadi — uchta ustun sigʻmaydi. */
.schedown { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.schedrow { display: grid; grid-template-columns: 1fr 120px 120px; align-items: center; gap: 10px; margin-bottom: 8px; }
.schedrow__n { font-size: 12.5px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.schedrow__n small { font-weight: 500; margin-left: 6px; }
.schedrow .input { padding: 8px 10px; font-size: 12.5px; }

@media (max-width: 640px) {
  .schedrow { grid-template-columns: 1fr 1fr; gap: 7px 10px; margin-bottom: 14px; }
  .schedrow__n { grid-column: 1 / -1; }
}

/* Baholar qaysi internetdan kelgani. Bitta mijoz bitta baho qoldiradi,
   shuning uchun uyum darrov koʻzga tashlanishi kerak. */
.rateips { border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; margin-bottom: 14px; background: var(--bg); }
.rateips__h { font-size: 12.5px; font-weight: 650; margin-bottom: 5px; }
.rateip { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12px; }
.rateip:first-of-type { border-top: 0; }
.rateip code { font-size: 11.5px; background: var(--elev); padding: 3px 8px; border-radius: 7px; overflow-wrap: anywhere; }
.rateip > span { font-weight: 600; white-space: nowrap; }
.rateip small { margin-left: auto; white-space: nowrap; }
.rateip.is-hot code { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.rateip.is-hot > span { color: var(--danger); }

/* Davomatdagi skaner surati. Profil rasmining oʻrnida turadi: kim kelgani
   shundan koʻrinadi. Guruhga yetib bormagani sariq halqa bilan ajralib
   turadi. */
.scanthumb {
  width: 34px; height: 34px; flex: none; padding: 0; border-radius: 10px;
  border: 2px solid transparent; background: var(--elev); overflow: hidden; cursor: pointer;
}
.scanthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanthumb:hover { border-color: var(--accent-1); }
.scanthumb.is-unsent { border-color: var(--warn, #c98a16); }
.scanbig { border-radius: 12px; overflow: hidden; background: var(--elev); max-width: 320px; margin: 0 auto; }
.scanbig img { width: 100%; display: block; }
.scanplace { font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 10px; overflow-wrap: anywhere; white-space: pre-line; }

/* Botning oxirgi xatosi va boʻlim sinovi. */
.tgerr {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px; font-size: 11.5px; line-height: 1.6;
  background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger);
  overflow-wrap: anywhere;
}
.tgtest { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.tgtest:first-child { border-top: 0; }
.tgtest b { min-width: 110px; }
.tgtest small { flex-basis: 100%; font-size: 11.5px; overflow-wrap: anywhere; }
.tgtest.is-bad b { color: var(--danger); }

/* ══ REYTING PANELI (.scd) ═════════════════════════════════════════════
   Devordagi ekranda ham, telefonda ham turadigan tirik taxta. Hamma sinf
   .scd nomi ostida: .kpis, .stack, .podium, .table kabi umumiy sinflarning
   oʻz kirish animatsiyasi, sahifalash va telefonda "karta" boʻlib qolishi
   bor — ular bu yerda faqat xalaqit beradi. Oʻlchamlar ekranga emas,
   taxtaning oʻz kengligiga qarab (container query) tanlanadi: yon panel
   ochiq-yopiqligi ham, televizor rejimi ham shunda bir xil ishlaydi. */

:root {
  --gold: #e8b53a;
  --gold-2: #f6d678;
  --silver: #9aa4b5;
  --bronze: #b5763a;
  --star: #f5a524;
  --att: #0d9488;
  /* Medal ustidagi raqam ikkala mavzuda ham bir xil quyuq rangda: medal
     rangi ochiq, 4.5:1 dan kam kontrast uzoqdan oʻqilmaydi. */
  --ink-gold: #4a3500;
  --ink-silver: #262d3a;
  --ink-bronze: #2b1606;
  --medal-1: linear-gradient(135deg, #e8b53a, #f6d678);
  --medal-2: linear-gradient(135deg, #9aa4b5, #c7cedb);
  --medal-3: linear-gradient(135deg, #b5763a, #d79f68);
  --gold-wash: color-mix(in srgb, var(--gold) 26%, var(--surface));
  /* "Jonli" yozuvi: yorugʻ mavzuda sof yashil oʻz yuvilgan foni ustida
     2.9:1 edi — kichik yozuv uchun kam. Biroz quyuqroq — 4.8:1. */
  --scd-live: color-mix(in srgb, var(--free) 70%, var(--ink));
}
[data-theme="dark"] {
  --scd-live: var(--free);
  --gold: #f0c95a;
  --gold-2: #f6d678;
  --silver: #c7cedb;
  --bronze: #d79f68;
  --star: #f7b543;
  --att: #2dd4bf;
  /* Qorongʻi fonda yupqa oltin ustida quyuq yozuv koʻrinmaydi — fon toʻqroq. */
  --gold-wash: color-mix(in srgb, var(--gold) 86%, var(--surface));
}

/* Faqat ekran oʻquvchi uchun. */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* `isolation` — taxtaning ichki qatlamlari (uchayotgan avatar, toj, konfetti
   z-index 30, davr menyusi 40) taxtaning oʻzida qoladi. Aks holda ular butun
   sahifa bilan bellashib, sahifa aylantirilganda yopishqoq yuqori panel
   (z-index 20) ustidan chizilardi. */
.scd { container: scd / inline-size; position: relative; isolation: isolate; }
/* Har bir grid va flex bolasi qisqara olsin: uzun ism yoki katta son
   butun taxtani yon tomonga itarib yubormasin. */
.scd :where(*) { min-width: 0; }
.scd__in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.scd__body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); gap: 12px; }
.scd__col { display: flex; flex-direction: column; gap: 12px; }
.scd__fx { position: absolute; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
/* Fonda yangilanganda .content oʻz kirish animatsiyasini qaytadan oʻynab,
   butun taxtani bir lahza xiralashtirardi. Taxta harakatini oʻzi boshqaradi. */
.content:has(> .scd) { animation: none; }
.content:has(> .scd.is-fit) { padding-bottom: 16px; }
/* Adminning yon paneli 900 px balandlikka sigʻmaydi va sahifani choʻzib,
   sigʻdirilgan taxtaning boshini ekrandan chiqarib yuborardi. Taxta
   sigʻdirilganda yon panel oʻzi aylanadi, sahifa emas. */
body:has(.scd.is-fit) .side { overflow-y: auto; }
@media (max-width: 820px) { .scd { padding-inline: 4px; } }

/* ── bosh qism ── */
.periodbar--compact { padding: 6px 8px; gap: 8px 10px; }
.periodbar--compact .seg button { padding-top: 6px; padding-bottom: 6px; }
.periodbar--compact .periodlabel { margin-left: 0; width: auto; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.periodmore { position: relative; flex: none; }
.periodmore > summary {
  list-style: none; cursor: pointer; user-select: none; white-space: nowrap;
  padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--muted); transition: color .15s, border-color .15s;
}
.periodmore > summary::-webkit-details-marker { display: none; }
.periodmore > summary::after { content: "▾"; margin-left: 6px; font-size: 10px; }
.periodmore > summary:hover, .periodmore[open] > summary { color: var(--accent-1); border-color: var(--accent-border); }
.periodmore__b {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  width: max-content; max-width: min(92vw, 520px); padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.periodbar__x { margin-left: auto; display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.scd-tvb { gap: 7px; }
.scd-tvb span { display: none; }
.scd-cap { font-size: clamp(11px, .85cqi, 14px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Vaqtinchalik izoh ("Oxirgi koʻrganingizdan beri", "Davr bugun boshlandi")
   telefondan kattaroq ekranda joy egallamaydi. Sarlavha qatoriga sigʻmay,
   u butun boshni ikki qatorga boʻlib yuborardi: sigʻdirilgan taxta 44 px
   pastga tushib, tasmadagi oxirgi baho yarmidan kesilardi, olti soniyadan
   keyin esa hammasi yana yuqoriga sakrardi. Endi u holat belgisi ostida,
   KPI plitkalarining boʻsh yuqori burchagida suzib turadi. */
@container scd (width >= 700px) {
  .scd-head .periodbar__x { position: relative; }
  .scd-head .periodbar__x > .scd-cap {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 6;
    max-width: min(60cqi, 520px); padding: 3px 10px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    pointer-events: none;
  }
}

.scd-pill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--scd-live); background: color-mix(in srgb, var(--free) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--free) 28%, transparent);
  font-variant-numeric: tabular-nums;
}
.scd-pill__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
/* Taxtadagi yagona toʻxtovsiz harakat — "jonli" ekanini bildiradi. */
.scd-pill.is-live .scd-pill__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor;
  animation: scdping 1.8s cubic-bezier(.2,.8,.2,1) infinite;
}
@keyframes scdping { from { transform: scale(1); opacity: .5; } to { transform: scale(2.6); opacity: 0; } }
.scd-pill.is-final { color: var(--muted); background: var(--elev); border-color: var(--line-2); }
.scd-pill__off { display: none; }
body.is-disconnected .scd-pill, .scd-pill.is-stale {
  color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
body.is-disconnected .scd-pill .scd-pill__dot::after, .scd-pill.is-stale .scd-pill__dot::after { display: none; }
body.is-disconnected .scd-pill__on, .scd-pill.is-stale .scd-pill__on { display: none; }
body.is-disconnected .scd-pill__off, .scd-pill.is-stale .scd-pill__off { display: inline; }

.scd-head.is-tv { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.scd-head__lbl { font-family: var(--serif); font-weight: 700; font-size: clamp(16px, 1.4cqi, 26px); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-head__x { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; flex: none; }
.scd-clock { font-family: var(--serif); font-weight: 800; font-variant-numeric: tabular-nums; font-size: clamp(16px, 1.5cqi, 28px); color: var(--ink-2); }
.scd-tvx { transition: opacity .25s; }

/* ── KPI ── */
.scd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.scd-kpi {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; row-gap: 3px;
  min-height: 72px; padding: 9px 14px 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-sm);
}
.scd-kpi.is-rating { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
.scd-kpi.is-rating > .scd-kpi__l, .scd-kpi.is-rating > .scd-kpi__v, .scd-kpi.is-rating > .scd-kpi__s { grid-column: 1; }
.scd-kpi.is-rating > .scd-hist { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.scd-kpi__l { display: flex; align-items: center; gap: 8px; font-size: clamp(11px, .85cqi, 14px); line-height: 1.25; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-kpi__l::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--accent-1); flex: none; }
.scd-kpi.is-good .scd-kpi__l::before { background: var(--free); }
.scd-kpi.is-warn .scd-kpi__l::before { background: var(--paused); }
.scd-kpi.is-bad .scd-kpi__l::before { background: var(--danger); }
.scd-kpi__v { display: flex; align-items: baseline; gap: 2px; line-height: 1.08; }
.scd-kpi__n { font-family: var(--serif); font-weight: 800; font-size: clamp(18px, 1.6cqi, 30px); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-kpi__n.is-none { color: var(--faint); }
.scd-kpi__u { font-size: clamp(13px, 1.1cqi, 20px); font-weight: 700; color: var(--star); }
.scd-kpi__s { font-size: clamp(11px, .85cqi, 14px); line-height: 1.25; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-hist { display: grid; gap: 2px; width: clamp(92px, 9cqi, 170px); }
.scd-hist__r { display: grid; grid-template-columns: 20px minmax(0, 1fr) 24px; align-items: center; gap: 5px; font-size: 10px; line-height: 1.05; color: var(--muted); font-variant-numeric: tabular-nums; }
.scd-hist__t { height: 5px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--line) 60%, transparent); }
.scd-hist__t i { display: block; height: 100%; border-radius: 3px; background: var(--star); }
.scd-hist__n { text-align: right; }
.scd-hist1, .scd-abar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--line) 60%, transparent); }
.scd-hist1 { display: none; margin-top: 4px; }
.scd-hist1 i, .scd-abar i { display: block; height: 100%; flex: none; }
.scd-hist1 .h5 { background: var(--star); }
.scd-hist1 .h4 { background: color-mix(in srgb, var(--star) 60%, var(--surface)); }
.scd-hist1 .h3 { background: var(--faint); }
.scd-hist1 .h2 { background: color-mix(in srgb, var(--danger) 60%, var(--surface)); }
.scd-hist1 .h1 { background: var(--danger); }
/* Davomat chizigʻi plitka tagida yotadi — balandlik qoʻshmaydi. */
.scd-abar { position: absolute; left: 14px; right: 14px; bottom: 7px; }
.scd-kpi[data-kpi="att"] { padding-bottom: 17px; }
.scd-abar .a { background: var(--att); }
.scd-abar .l { background: var(--paused); }
.scd-abar .x { background: var(--danger); }

/* ── panellar ── */
.scd .panel { min-width: 0; }
.scd-ph { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.scd-ph__t { font-family: var(--serif); font-weight: 700; font-size: clamp(14px, 1.2cqi, 20px); line-height: 1.35; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-link { margin-left: auto; flex: none; padding: 2px 0; border: 0; background: none; color: var(--accent-1); font-size: clamp(12px, 1cqi, 17px); font-weight: 600; white-space: nowrap; cursor: pointer; }
.scd-link:hover { text-decoration: underline; }
.scd-empty .empty { padding: 56px 20px; }

/* Umumiy avatar doirasi: oʻlchamini oʻrab turgan joy beradi. */
.scd-av {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: var(--elev); color: var(--muted); font-weight: 700; line-height: 1; letter-spacing: 0;
}

/* ── shohsupa ── */
.scd-pod { position: relative; padding: 12px 12px 10px; }
.scd-pod__g { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; gap: 12px; }
/* DOM tartibi 1, 2, 3 (ekran oʻquvchi shunday oʻqisin), koʻrinishi 2-1-3. */
.scd-pl[data-rank="1"] { grid-column: 2; grid-row: 1; }
.scd-pl[data-rank="2"] { grid-column: 1; grid-row: 1; }
.scd-pl[data-rank="3"] { grid-column: 3; grid-row: 1; }
.scd-pl {
  --av: clamp(44px, 4.6cqi, 88px); --mc: var(--silver); --mg: var(--medal-2); --mi: var(--ink-silver);
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 15px 8px 9px; border: 1px solid var(--line); border-radius: var(--r-l);
  background: var(--surface); color: inherit; font: inherit; text-align: center; cursor: pointer;
  transition: box-shadow .2s, border-color .2s;
}
.scd-pl::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--mg); }
.scd-pl:hover { box-shadow: var(--shadow); }
.scd-pl:focus-visible, .scd-row:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }
.scd-pl.is-1 {
  --av: clamp(60px, 6.4cqi, 120px); --mc: var(--gold); --mg: var(--medal-1); --mi: var(--ink-gold);
  padding-top: calc(8px + var(--av) * .27);
  background: color-mix(in srgb, var(--gold) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--gold) 35%, var(--line));
}
[data-theme="dark"] .scd-pl.is-1 { background: color-mix(in srgb, var(--gold) 13%, var(--surface)); }
.scd-pl.is-3 { --mc: var(--bronze); --mg: var(--medal-3); --mi: var(--ink-bronze); }
.scd-pl.is-empty { cursor: default; background: transparent; border-style: dashed; border-color: var(--line-2); min-height: calc(var(--av) + 72px); justify-content: center; }
.scd-pl.is-empty::before { display: none; }
.scd-pl.is-newlead { outline: 2px solid var(--gold); outline-offset: -2px; }
.scd-pl.is-gain, .scd-row.is-gain { box-shadow: inset 2px 0 0 var(--free); }
.scd-pl__av { position: relative; flex: none; width: var(--av); height: var(--av); margin-bottom: 14px; font-size: calc(var(--av) * .32); }
.scd-pl__ring {
  display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--elev);
  box-shadow: 0 0 0 3px var(--mc), 0 0 0 9px color-mix(in srgb, var(--mc) 18%, transparent);
}
.scd-pl.is-empty .scd-pl__ring { box-shadow: none; border: 2px dashed var(--line-2); background: transparent; }
.scd-pl.is-empty .scd-medal { background: var(--elev); color: var(--faint); border: 1px dashed var(--line-2); }
.scd-medal {
  position: absolute; left: 50%; top: calc(100% - 10px); width: 26px; height: 26px; margin-left: -13px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--mg); color: var(--mi); box-shadow: 0 0 0 2px var(--surface);
  font-family: var(--serif); font-weight: 800; font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums;
}
/* Toj avatar ustida, biroz qiyshiq. Joyi left/margin bilan beriladi —
   transform butunlay harakatga qoladi. */
.scd-crown {
  position: absolute; left: 50%; bottom: calc(100% - 4px); z-index: 1;
  width: calc(var(--av) * .36); margin-left: calc(var(--av) * -.18);
  transform: rotate(-8deg); transform-origin: 50% 100%; line-height: 0; pointer-events: none;
}
.scd-crown__i { display: block; }
.scd-crownsvg { display: block; width: 100%; height: auto; overflow: visible; }
.scd-crownsvg path, .scd-crownsvg rect, .scd-crownsvg circle {
  fill: url(#scdCrownG); stroke: color-mix(in srgb, var(--gold) 55%, #000); stroke-width: 1;
  vector-effect: non-scaling-stroke; stroke-linejoin: round;
}
.scd-pl__name {
  max-width: 100%; font-weight: 600; font-size: clamp(12px, 1.15cqi, 21px); line-height: 1.22;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.scd-pl__tot { position: relative; font-family: var(--serif); font-weight: 800; font-size: clamp(16px, 1.45cqi, 26px); line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scd-pl.is-1 .scd-pl__tot { font-size: clamp(20px, 1.9cqi, 34px); }
.scd-pl__tot b { display: inline-block; font-weight: inherit; }
.scd-pl__meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 8px; font-size: clamp(11px, .85cqi, 14px); line-height: 1.3; }
.scd-pl__today { display: inline-block; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scd-pl__today .up, .scd-mv.up { color: var(--free); }
.scd-pl__today .down, .scd-mv.down { color: var(--danger); }
.scd-mv.flat { color: var(--faint); }
.scd-mv.is-new { color: var(--accent-1); }
.scd-pl__stars { display: inline-block; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scd-st { color: var(--star); }
.scd-pl__parts { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px 9px; font-size: clamp(11px, .85cqi, 14px); line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
.scd-pl__parts > span, .scd-legend > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.scd-pl__parts i, .scd-legend i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.scd .m > i { background: var(--accent-1); }
.scd .s > i { background: var(--star); }
.scd .a > i { background: var(--att); }
.scd-pl__gap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px 6px; font-size: clamp(11px, .85cqi, 14px); line-height: 1.3; color: var(--muted); }
.scd-pill2 { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.scd-pill2.is-race { background: color-mix(in srgb, var(--paused) 18%, var(--surface)); color: color-mix(in srgb, var(--paused) 62%, var(--ink)); }
.scd-pill2.is-gold { background: var(--gold-wash); color: var(--ink-gold); }
.scd-pod__empty { margin: 10px 0 2px; text-align: center; color: var(--muted); font-size: clamp(12px, 1cqi, 17px); }
.scd-pod.is-solo { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
/* Yetakchi almashganda: shohsupaning tepa chetida, oʻrtada. */
.scd-banner {
  position: absolute; top: 0; left: 50%; z-index: 6; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 7px; max-width: 92%;
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, var(--surface)); box-shadow: var(--shadow);
  color: var(--ink); font-size: clamp(12px, 1cqi, 17px); font-weight: 600; white-space: nowrap; pointer-events: none;
}
.scd-banner svg { flex: none; color: color-mix(in srgb, var(--gold) 70%, var(--ink)); }
.scd-banner span { overflow: hidden; text-overflow: ellipsis; }

/* ── jadval ── */
.scd-list { display: flex; flex-direction: column; flex: 1 1 auto; }
.scd-legend { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px 10px; font-size: clamp(11px, .85cqi, 14px); color: var(--muted); }
.scd-cols, .scd-row { display: grid; grid-template-columns: 28px 34px 32px minmax(0, 1fr) 120px 84px; column-gap: 10px; align-items: center; }
.scd-list.no-mv .scd-cols, .scd-list.no-mv .scd-row { grid-template-columns: 28px 32px minmax(0, 1fr) 120px 84px; }
.scd-cols { padding: 5px 14px 0; font-size: 11px; line-height: 1.3; color: var(--muted); }
.scd-cols__mv { grid-column: 2; text-align: center; white-space: nowrap; overflow: visible; }
.scd-list.no-mv .scd-cols__mv { grid-column: 1 / -1; text-align: left; }
.scd-list__b { padding: 2px 6px; }
.scd-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: var(--scd-rowh, 52px); }
.scd-rows > li { display: flex; min-width: 0; }
.scd-rows > li + li { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.scd-row {
  position: relative; width: 100%; height: 100%; padding: 0 8px; border: 0; border-radius: 10px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.scd-row:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.scd-row.is-un { opacity: .55; }
.scd-row__rk {
  display: grid; place-items: center; width: 26px; height: 24px; border-radius: 8px;
  background: var(--elev); border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.scd-row__mv { width: 34px; text-align: center; font-size: 11px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scd-row__mv.up { color: var(--free); }
.scd-row__mv.down { color: var(--danger); }
.scd-row__mv.flat { color: var(--faint); }
.scd-new { display: inline-block; padding: 1px 5px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-1); font-size: 9.5px; letter-spacing: .03em; }
.scd-row__av { width: 32px; height: 32px; flex: none; font-size: 12px; }
.scd-row__nm { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.scd-row__n { font-weight: 600; font-size: clamp(13px, 1.2cqi, 20px); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Kompozitsiya chizigʻi: nol nuqtasidan oʻngga qoʻshilgan, chapga olingan ball. */
.scd-bar { position: relative; display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--line) 60%, transparent); }
.scd-bar__segs { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.scd-seg { position: absolute; top: 0; bottom: 0; display: block; }
.scd-seg.m { background: var(--accent-1); }
.scd-seg.s { background: var(--star); }
.scd-seg.a { background: var(--att); }
.scd-seg.mn, .scd-seg.sn, .scd-seg.an { background: repeating-linear-gradient(45deg, var(--danger) 0 3px, color-mix(in srgb, var(--danger) 40%, transparent) 3px 6px); }
.scd-bar__z { position: absolute; top: -2px; bottom: -2px; width: 1px; margin-left: -.5px; background: var(--line-2); }
.scd-row__st { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: clamp(12px, 1cqi, 17px); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scd-row__st.is-few { opacity: .6; }
.scd-row__st.is-none { color: var(--faint); }
.scd-row__st b { font-weight: 700; }
.scd-row__c { color: var(--muted); font-size: .9em; }
.scd-row__s1 { display: none; color: var(--star); }
.scd-stars { position: relative; display: inline-block; flex: none; line-height: 1; letter-spacing: 1px; font-size: .95em; }
.scd-stars__bg { color: var(--line-2); }
.scd-stars__fg { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--star); }
.scd-row__tot { position: relative; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; column-gap: 3px; text-align: right; }
.scd-row__tot b { display: inline-block; font-family: var(--serif); font-weight: 800; font-size: clamp(15px, 1.25cqi, 22px); line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scd-eq { color: var(--muted); font-weight: 700; cursor: help; }
.scd-row__td { flex-basis: 100%; font-size: 11px; font-weight: 600; line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scd-row__td.up { color: var(--free); }
.scd-row__td.down { color: var(--danger); opacity: .7; }
.scd-div { padding: 6px 8px 2px; font-size: 11px; line-height: 1.3; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
/* Tabrik chipi: ball yonida bir zum turadi, keyin koʻtarilib yoʻqoladi. */
.scd-gain {
  position: absolute; right: calc(100% + 6px); top: 50%; margin-top: -10px; z-index: 2;
  display: inline-block; padding: 0 7px; border-radius: 999px; transform-origin: 100% 50%;
  background: color-mix(in srgb, var(--free) 14%, var(--surface)); color: var(--free);
  font-family: var(--font); font-size: 12px; font-weight: 700; line-height: 20px; letter-spacing: 0; white-space: nowrap; pointer-events: none;
}
.scd-pl .scd-gain { right: auto; left: calc(100% + 6px); transform-origin: 0 50%; }

/* ── yoʻnalishlar ── */
.scd-cats__b { display: grid; padding: 2px 8px 6px; }
.scd-cat { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 5px 6px; }
.scd-cat + .scd-cat { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.scd-cat.c-kassa { --cc: var(--accent-1); }
.scd-cat.c-fav { --cc: var(--star); }
.scd-cat.c-five { --cc: var(--gold); }
.scd-cat.c-orders { --cc: var(--working); }
.scd-cat.c-today { --cc: var(--free); }
.scd-cat__ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--cc); background: color-mix(in srgb, var(--cc) 12%, transparent); }
.scd-cat__m { display: flex; flex-direction: column; gap: 3px; }
.scd-cat__l { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-cat__who { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: clamp(13px, 1.2cqi, 20px); line-height: 1.2; }
.scd-cat__who .scd-av { width: 24px; height: 24px; flex: none; font-size: 10px; }
.scd-cat__n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-cat__who.is-none { font-weight: 400; font-size: clamp(12px, 1cqi, 17px); color: var(--muted); }
.scd-cat__v { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.scd-cat__main { display: inline-flex; align-items: baseline; gap: 1px; max-width: 100%; }
.scd-cat__num { font-family: var(--serif); font-weight: 800; font-size: clamp(14px, 1.2cqi, 21px); line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-cat__num.is-none { color: var(--faint); }
.scd-cat__u { color: var(--star); font-weight: 700; }
/* Ikkinchi oʻrin ham --muted: u maʼlumot (kim ikkinchi, qanchaga), bezak
   emas. --faint bu oʻlchamda 2.6:1 edi va uzoqdan oʻqilmasdi. */
.scd-cat__s, .scd-cat__ru { max-width: 100%; font-size: clamp(11px, .85cqi, 14px); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }

/* ── oxirgi baholar ── */
.scd-feed { display: flex; flex-direction: column; flex: 1 1 auto; }
.scd-feed__b { padding: 2px 8px 8px; }
.scd-fl { list-style: none; margin: 0; padding: 0; }
.scd-fi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 3px; padding: 8px 8px 8px 10px; }
.scd-fi + .scd-fi { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.scd-fi.is-5 { box-shadow: inset 2px 0 0 var(--gold); }
.scd-fi.is-clip { display: none; }
.scd-fi__1 { display: flex; align-items: center; gap: 8px; font-size: clamp(12px, 1cqi, 17px); line-height: 1.3; }
/* Izoh devorga chiqmaydi — yulduzlar bahoning yagona soʻzi, shuning uchun yirik. */
.scd-fi__st { display: inline-flex; gap: 2px; flex: none; color: var(--line-2); font-size: clamp(13px, 1.1cqi, 19px); line-height: 1; }
.scd-fi__st i { display: inline-block; font-style: normal; }
.scd-fi__st i.on { color: var(--star); }
.scd-fi__who { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.scd-fi__who .scd-av { width: 18px; height: 18px; flex: none; font-size: 8px; }
.scd-fi__d { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-fi__t { margin-left: auto; flex: none; font-size: clamp(11px, .85cqi, 14px); color: var(--muted); white-space: nowrap; }
.scd-fi__2 { display: flex; align-items: center; gap: 6px; font-size: clamp(12px, 1cqi, 17px); line-height: 1.4; color: var(--ink-2); }
.scd-fi__cu { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-feed__empty { padding: 20px 12px; text-align: center; font-size: clamp(12px, 1cqi, 17px); line-height: 1.6; color: var(--muted); }
.scd-feed__more { display: none; width: 100%; margin-top: 6px; padding: 9px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--accent-1); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ── qoidalar ── */
.scd-rules .scorerules { flex-wrap: nowrap; justify-content: center; overflow: hidden; margin: 0; }
.scd-rules .scorerules span { white-space: nowrap; font-size: clamp(11px, .85cqi, 14px); }
.scd-rulesm p { margin: 12px 0 0; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.scd-card-x { display: flex; flex-direction: column; gap: 4px; margin: -4px 0 14px; font-size: 13px; color: var(--ink-2); }

/* ── harakat qatlami ── */
.scd-fly { position: absolute; will-change: transform; }
.scd-fly__av {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 50%;
  background: var(--elev); color: var(--muted); font-weight: 700; font-size: calc(var(--av) * .32); line-height: 1; box-shadow: var(--shadow);
}
.scd-fly__crown { display: block; width: 100%; height: 100%; transform: rotate(-8deg); transform-origin: 50% 100%; }
.scd-fly__crown .scd-crownsvg { width: 100%; height: 100%; }
.scd-sweep {
  position: absolute; top: 0; bottom: 0; left: 0; z-index: 3; width: 40%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
}
[data-theme="dark"] .scd-sweep { background: linear-gradient(90deg, transparent, rgba(255, 224, 150, .25), transparent); }
.scd-ring { position: absolute; box-sizing: border-box; border: 3px solid var(--gold); border-radius: 50%; opacity: 0; }
.scd-gain.is-loss { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }

.scd-confetti { position: absolute; z-index: 3; display: block; }

/* Hodisa kartasi (yangi baho, yopilgan buyurtma): taxta oʻrtasida bir zum
   turadi, orqasi biroz xiralashadi, keyin oʻz joyiga ketadi. */
.scd-veil {
  position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  background: color-mix(in srgb, var(--surface) 28%, transparent);
}
.scd-ev {
  position: absolute; z-index: 2; box-sizing: border-box; width: min(90%, clamp(290px, 26cqi, 400px));
  display: grid; justify-items: center; gap: 8px; padding: 22px 24px 18px; text-align: center; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .42); will-change: transform, opacity;
}
.scd-ev::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); }
.scd-ev.is-5 { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.scd-ev.is-5::before { background: linear-gradient(90deg, var(--gold), var(--gold-2), var(--gold)); }
.scd-ev.is-low::before { background: var(--danger); }
.scd-ev.is-pay { border-color: color-mix(in srgb, var(--free) 35%, var(--line)); }
.scd-ev.is-pay::before { background: var(--free); }
.scd-ev__k { font-size: clamp(11px, .85cqi, 13px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.scd-ev.is-pay .scd-ev__k { color: var(--free); }
.scd-ev__st { display: inline-flex; gap: 3px; font-size: clamp(24px, 2.2cqi, 34px); line-height: 1; color: var(--line-2); }
.scd-ev__st i { display: inline-block; font-style: normal; }
.scd-ev__st i.on { color: var(--star); text-shadow: 0 0 14px color-mix(in srgb, var(--star) 40%, transparent); }
.scd-ev__ok { width: clamp(40px, 3.4cqi, 52px); height: auto; overflow: visible; }
.scd-ev__ok circle { fill: color-mix(in srgb, var(--free) 12%, transparent); stroke: var(--free); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.scd-ev__ok path { fill: none; stroke: var(--free); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; }
.scd-ev__who { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; font-size: clamp(15px, 1.3cqi, 20px); }
.scd-ev__who .scd-av { width: clamp(30px, 2.4cqi, 38px); height: clamp(30px, 2.4cqi, 38px); flex: none; font-size: 12px; }
.scd-ev__who b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-ev__pts { font-family: var(--serif); font-size: clamp(18px, 1.6cqi, 24px); font-weight: 800; color: var(--free); font-variant-numeric: tabular-nums; }
.scd-ev__pts b { font-weight: inherit; }
.scd-ev__cu { max-width: 100%; font-size: clamp(12px, 1cqi, 15px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scd-ev__pts.is-neg { color: var(--danger); }

/* Oʻtgan oy gʻolibi — ismi yonida kichik oltin belgi. */
.scd-champ {
  display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 1px; padding: 2px 8px 2px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 16%, transparent); color: color-mix(in srgb, var(--gold) 70%, var(--ink));
  font-size: 11px; font-weight: 700; line-height: 1.3; white-space: nowrap; vertical-align: middle;
}
.scd-champ svg { width: 12px; height: 12px; flex: none; }
.scd-row__n .scd-champ { margin: 0 0 0 7px; }
[data-theme="dark"] .scd-champ { color: var(--gold-2); }

/* Dizaynerga tabrik: ekran oʻrtasida, orqasi xira; bosilsa yopiladi. */
.cheer {
  position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px; cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}
.cheer .scd-ev { position: relative; width: min(100%, 380px); gap: 9px; padding: 24px 24px 20px; }
.cheer .scd-ev__pts { font-size: 26px; }
.cheer__code { font-size: 13px; color: var(--muted); }
.cheer__note { font-size: 13px; color: var(--muted); }
.cheer__why { padding: 3px 11px; border-radius: 999px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size: 12.5px; font-weight: 650; }
.cheer__rank { font-size: 14px; font-weight: 650; color: var(--ink-2); }

/* Bildirishnomaga ruxsat soʻrash — pastda, bir marta. */
.pushask {
  position: fixed; left: 50%; bottom: 20px; z-index: 70; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; width: min(560px, calc(100% - 24px)); padding: 12px 14px; box-sizing: border-box;
  background: var(--elev); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg, var(--shadow));
  animation: pushIn .3s ease-out;
}
@keyframes pushIn { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.pushask__ic { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--accent-soft); color: var(--accent-1); }
.pushask__ic svg { width: 20px; height: 20px; }
.pushask__t { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; }
.pushask__t small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.pushask__a { display: flex; gap: 6px; margin-left: auto; flex: none; }
@media (max-width: 560px) {
  .pushask { bottom: 84px; flex-wrap: wrap; }
  .pushask__a { width: 100%; justify-content: flex-end; }
}

/* Sozlamalar: oy gʻoliblari roʻyxati. */
.champlist { display: grid; }
.champrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; }
.champrow + .champrow { border-top: 1px solid var(--line); }
.champrow__m { width: 130px; font-weight: 650; }
.champrow__n { display: grid; flex: 1 1 140px; min-width: 0; }
.champrow__n small { font-size: 11.5px; }
.champrow__s { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.champrow__s.is-sent { color: var(--free); }
.champrow__s svg { width: 13px; height: 13px; }

/* ── sigʻdirish: butun taxta ekranda, sahifa aylanmaydi ── */
.scd.is-fit .scd__in { height: 100%; grid-template-rows: auto auto minmax(0, 1fr); }
.scd.is-fit.is-tv .scd__in { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.scd.is-fit .scd__body, .scd.is-fit .scd__col { min-height: 0; }
.scd.is-fit .scd-pod, .scd.is-fit .scd-cats { flex: none; }
.scd.is-fit .scd-pod.is-solo { flex: 1 1 auto; }
.scd.is-fit .scd-list, .scd.is-fit .scd-feed { flex: 1 1 0; min-height: 0; }
.scd.is-fit .scd-list__b { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.scd.is-fit .scd-feed__b { flex: 1 1 0; min-height: 0; overflow: hidden; }

/* ── telefon: bitta ustun ── */
@container scd (width < 700px) {
  .scd__in { gap: 10px; }
  .scd__body, .scd__col { display: contents; }
  .scd-head { order: 0; }
  .scd-pod { order: 1; }
  .scd-kpis { order: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .scd-list { order: 3; }
  .scd-cats { order: 4; }
  .scd-feed { order: 5; }
  .scd-rules { order: 6; }
  .periodbar__x { margin-left: 0; justify-content: flex-start; }
  .scd-kpi { padding: 10px 12px; }
  .scd-kpi[data-kpi="att"] { padding-bottom: 18px; }
  .scd-abar { left: 12px; right: 12px; }
  .scd-kpi.is-rating { grid-template-columns: minmax(0, 1fr); }
  .scd-kpi.is-rating > .scd-hist { display: none; }
  .scd-hist1 { display: flex; }
  .scd-pod { padding: 12px 6px 8px; }
  .scd-pod__g { gap: 8px; }
  .scd-pl { padding: 12px 4px 8px; gap: 2px; border-radius: 14px; }
  .scd-pl.is-1 { padding-top: calc(10px + var(--av) * .3); }
  .scd-pl__parts, .scd-pl__gap { display: none; }
  .scd-pl__meta { flex-direction: column; gap: 0; }
  .scd-banner { max-width: 96%; padding: 5px 10px; }
  .scd-cols, .scd-row { grid-template-columns: 24px 26px 28px minmax(0, 1fr) 44px 60px; column-gap: 6px; }
  .scd-list.no-mv .scd-cols, .scd-list.no-mv .scd-row { grid-template-columns: 24px 28px minmax(0, 1fr) 44px 60px; }
  .scd-cols { padding: 5px 8px 0; }
  .scd-list__b { padding: 2px 4px 6px; }
  .scd-kpi[data-kpi="money"] .scd-kpi__n { font-size: 17px; }
  .scd-rows { grid-auto-rows: 52px; }
  .scd-row { padding: 0 4px; }
  .scd-row__rk { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }
  .scd-row__mv { width: 26px; }
  /* "YANGI" (ruschasi "НОВЫЙ") 26 px ustunga sigʻmaydi: avatar ustiga
     chiqib, oxirgi harflari yopilardi ("YANG"). Telefonda u urgʻu rangidagi
     nuqta; soʻzning oʻzi ekran oʻquvchi va ishora (title) uchun qoladi. */
  .scd-new { position: relative; width: 8px; height: 8px; padding: 0; border-radius: 50%; background: var(--accent-1); vertical-align: middle; }
  .scd-new__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .scd-row__av { width: 28px; height: 28px; font-size: 11px; }
  .scd-row__nm { gap: 4px; }
  .scd-bar { height: 3px; border-radius: 2px; }
  .scd-bar__z { top: -1px; bottom: -1px; }
  .scd-stars, .scd-row__c { display: none; }
  .scd-row__s1 { display: inline; }
  .scd-row__st { gap: 0; }
  .scd-feed:not(.is-open) .scd-fi.is-more { display: none; }
  .scd-feed:not(.is-open) .scd-feed__more { display: block; }
  .scd-gain { font-size: 11px; line-height: 18px; margin-top: -9px; }
}

/* ── planshet: shohsupa va jadval toʻliq kenglikda, pastda ikki ustun ── */
@container scd (700px <= width < 1000px) {
  .scd__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scd__body, .scd__col { display: contents; }
  .scd-head, .scd-kpis, .scd-pod, .scd-list, .scd-rules, .scd-empty { grid-column: 1 / -1; }
}

/* ── keng ekran va televizor ── */
@container scd (width >= 1480px) {
  .scd__in, .scd__body, .scd__col { gap: 16px; }
  .scd-tvb span { display: inline; }
  .scd-kpis { gap: 16px; }
  .scd-kpi { min-height: 104px; padding: 12px 18px 14px; }
  .scd-kpi[data-kpi="att"] { padding-bottom: 18px; }
  .scd-abar { left: 18px; right: 18px; bottom: 7px; }
  .scd-kpi__l, .scd-kpi__s { line-height: 1.15; }
  .scd-ph { padding: 11px 18px; }
  .scd-pod { padding: 12px 16px 10px; }
  .scd-pod__g { gap: 16px; }
  .scd-pl { padding-left: 12px; padding-right: 12px; gap: 3px; }
  .scd-medal { width: 30px; height: 30px; margin-left: -15px; font-size: 15px; }
  .scd-pl__av { margin-bottom: 19px; }
  .scd-cols, .scd-row { grid-template-columns: 36px 40px 44px minmax(0, 1fr) 160px 110px; column-gap: 12px; }
  .scd-list.no-mv .scd-cols, .scd-list.no-mv .scd-row { grid-template-columns: 36px 44px minmax(0, 1fr) 160px 110px; }
  .scd-cols { font-size: 12px; }
  .scd-rows { grid-auto-rows: var(--scd-rowh, 64px); }
  .scd-row__rk { width: 32px; height: 30px; font-size: 14px; }
  .scd-row__mv { width: 40px; }
  .scd-row__av { width: 44px; height: 44px; font-size: 15px; }
  .scd-bar { height: 8px; border-radius: 4px; }
  .scd-row__td { font-size: 13px; }
  .scd-cat { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 9px 8px; }
  .scd-cat__ic { width: 40px; height: 40px; border-radius: 12px; }
  .scd-cat__who .scd-av { width: 30px; height: 30px; font-size: 12px; }
  .scd-fi { padding: 10px 10px 10px 12px; }
  .scd-fi__who .scd-av { width: 22px; height: 22px; font-size: 9px; }
}

/* ── ekran rejimi (devordagi televizor) ── */
body.is-tv .side, body.is-tv .topbar, body.is-tv .tabbar { display: none !important; }
body.is-tv .shell { grid-template-columns: minmax(0, 1fr); }
body.is-tv .content { padding: 24px; }
/* Ekran hammaga koʻrinadi: pul doim xira, ball esa ochiq. */
body.is-tv .scd .priv { filter: blur(9px); user-select: none; }
body.is-tv .scd [data-action="score-person"] { pointer-events: none; cursor: default; }
/* Devordagi ekranda matn belgilanmaydi: tasodifiy ikki marta bosish bilan
   qolgan belgi jonli yangilanishni ushlab turardi. */
body.is-tv .scd { user-select: none; }
body.tv-idle, body.tv-idle * { cursor: none !important; }
body.tv-idle .scd-tvx { opacity: 0; pointer-events: none; }
/* Klaviatura bilan kelgan fokus chiqish tugmasini koʻrinmas qoldirmaydi. */
body.tv-idle .scd-tvx:focus-visible { opacity: 1; pointer-events: auto; }

/* ── Reyting: besh yulduz, sabab ─────────────────────────────────────── */
.scd-kpi__u.is-gold, .scd-cat__u.is-gold { color: var(--gold); font-size: .62em; letter-spacing: -.04em; margin-left: 6px; }
.scd-cat__u { margin-left: 4px; font-size: .72em; color: var(--muted); font-weight: 600; }
.scd-kpi.is-five .scd-kpi__l::before { background: var(--gold); }
.scd-kpi.is-pts .scd-kpi__l::before { background: var(--free); }

/* Admin roʻyxatida: bir-ikki yulduzda mijoz aytgan sabab. */
.rateflag.is-why { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); cursor: default; }


/* ── Tirik taxta: ekran qotib turmasin, lekin shovqin ham qilmasin ─────
   Doimiy harakat ataylab oz va sekin: orqa fondagi xira nur, shohsupaning
   yengil nafasi, birinchi oʻrinda kamdan-kam oʻtadigan yaltirash va
   yoʻnalishlarning navbatma-navbat yoritilishi. Hammasi transform va
   opacity bilan, soxta elementlarda — jonli harakatlar (FLIP, toj
   koʻchishi) tegadigan elementlarga qoʻl tegmaydi. "Kamroq harakat"
   sozlamasida hammasi oʻchadi. */
.scd__amb { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; border-radius: var(--r-l); }
.scd__amb i { position: absolute; width: 48%; aspect-ratio: 1; border-radius: 50%; opacity: .09; will-change: transform; }
.scd__amb i:nth-child(1) { left: -6%; top: -18%; background: radial-gradient(circle, var(--gold) 0%, transparent 62%); }
.scd__amb i:nth-child(2) { right: -10%; top: 20%; background: radial-gradient(circle, var(--accent-1) 0%, transparent 62%); }
.scd__amb i:nth-child(3) { left: 28%; bottom: -30%; background: radial-gradient(circle, var(--accent-2) 0%, transparent 62%); }
[data-theme="dark"] .scd__amb i { opacity: .07; }
.scd-pod { isolation: isolate; }
.scd-pod::before {
  content: ""; position: absolute; left: 50%; top: 42%; width: 70%; aspect-ratio: 1; z-index: -1; pointer-events: none;
  margin-left: -35%; transform: translateY(-50%); border-radius: 50%; opacity: .35;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 18%, transparent) 0%, transparent 60%);
}
.scd-pl.is-1::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, .3) 50%, transparent 100%);
  transform: translateX(-130%);
}
[data-theme="dark"] .scd-pl.is-1::after { background: linear-gradient(105deg, transparent 0%, rgba(255, 224, 150, .12) 50%, transparent 100%); }
.scd-cat { position: relative; border-radius: 10px; }
.scd-cat::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cc, var(--accent-1)) 8%, transparent), transparent 85%);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--cc, var(--accent-1)) 70%, transparent);
}
.scd-cats__b { position: relative; isolation: isolate; }

@media (prefers-reduced-motion: no-preference) {
  .scd__amb i:nth-child(1) { animation: scdDrift1 40s ease-in-out infinite alternate; }
  .scd__amb i:nth-child(2) { animation: scdDrift2 48s ease-in-out infinite alternate; }
  .scd__amb i:nth-child(3) { animation: scdDrift3 56s ease-in-out infinite alternate; }
  .scd-pod::before { animation: scdBreath 9s ease-in-out infinite; }
  .scd-pl.is-1::after { animation: scdShine 14s ease-in-out 4s infinite; }
  .scd-pl.is-1 .scd-crownsvg { animation: scdCrownSway 6s ease-in-out infinite; transform-origin: 50% 100%; }
  .scd-pl.is-1 .scd-pl__ring { animation: scdHalo 5s ease-in-out infinite; }
  /* Yoʻnalishlar navbat bilan, sekin yoritiladi — har biriga 5 soniya. */
  .scd-cat::before { animation: scdSpot 25s ease-in-out infinite; }
  .scd-cat:nth-child(2)::before { animation-delay: 5s; }
  .scd-cat:nth-child(3)::before { animation-delay: 10s; }
  .scd-cat:nth-child(4)::before { animation-delay: 15s; }
  .scd-cat:nth-child(5)::before { animation-delay: 20s; }
}
@keyframes scdDrift1 { to { transform: translate(10%, 12%) scale(1.08); } }
@keyframes scdDrift2 { to { transform: translate(-12%, -8%) scale(.94); } }
@keyframes scdDrift3 { to { transform: translate(8%, -14%) scale(1.1); } }
@keyframes scdBreath { 0%, 100% { opacity: .25; transform: translateY(-50%) scale(.96); } 50% { opacity: .5; transform: translateY(-50%) scale(1.02); } }
@keyframes scdShine { 0% { opacity: 0; transform: translateX(-130%); } 6% { opacity: 1; } 18% { opacity: 1; transform: translateX(260%); } 19%, 100% { opacity: 0; transform: translateX(260%); } }
@keyframes scdCrownSway { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-2px) rotate(2deg); } }
@keyframes scdHalo { 0%, 100% { box-shadow: 0 0 0 3px var(--mc), 0 0 0 9px color-mix(in srgb, var(--mc) 18%, transparent); } 50% { box-shadow: 0 0 0 3px var(--mc), 0 0 0 12px color-mix(in srgb, var(--mc) 10%, transparent); } }
@keyframes scdSpot { 0%, 100% { opacity: 0; } 5%, 16% { opacity: 1; } 21% { opacity: 0; } }
