/* =====================================================================
   AgroM Shartnoma AI — dizayn tizimi (yorug' / qorong'i mavzu, animatsiyalar)
   ===================================================================== */
:root {
  --bg: #f3f6f1;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #e3f1dc 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #fdf3dc 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f6f9f4;
  --surface-3: #eef3ea;
  --border: #e1e8dc;
  --border-strong: #cfd9c8;
  --text: #17231a;
  --muted: #637162;
  --brand: #2e8b3a;
  --brand-2: #1c5e26;
  --brand-3: #46b058;
  --brand-soft: #e5f3e2;
  --brand-grad: linear-gradient(135deg, #2e8b3a 0%, #1c5e26 100%);
  --accent: #e9a91f;
  --accent-soft: #fff4d6;
  --danger: #d0443a;
  --danger-soft: #fdecea;
  --warn-soft: #fff6dd;
  --info: #2f6fb3;
  --info-soft: #e8f1fb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(18, 38, 20, .05);
  --shadow: 0 1px 2px rgba(18, 38, 20, .05), 0 8px 24px -8px rgba(18, 38, 20, .10);
  --shadow-lg: 0 20px 50px -12px rgba(18, 38, 20, .28);
  --topbar: rgba(22, 74, 31, .86);
  --input-bg: #ffffff;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --doc-font: "Times New Roman", "Noto Serif", Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1410;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(46,139,58,.16) 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(233,169,31,.08) 0%, transparent 55%);
  --surface: #151d17;
  --surface-2: #1a241c;
  --surface-3: #212d23;
  --border: #263428;
  --border-strong: #33463a;
  --text: #e6eee5;
  --muted: #95a593;
  --brand: #4cb35c;
  --brand-2: #8fd897;
  --brand-3: #5fc56f;
  --brand-soft: rgba(76, 179, 92, .14);
  --brand-grad: linear-gradient(135deg, #3aa04a 0%, #23752f 100%);
  --accent: #f0b73a;
  --accent-soft: rgba(240, 183, 58, .13);
  --danger: #ef6b60;
  --danger-soft: rgba(239, 107, 96, .13);
  --warn-soft: rgba(240, 183, 58, .12);
  --info: #79aef0;
  --info-soft: rgba(121, 174, 240, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -10px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --topbar: rgba(14, 22, 16, .82);
  --input-bg: #111813;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
body { background-image: var(--bg-grad); background-attachment: fixed; min-height: 100vh; transition: background-color .3s var(--ease), color .3s var(--ease); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; font-weight: 800; } h2 { font-size: 1.18rem; font-weight: 700; } h3 { font-size: 1.02rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: .78rem; word-break: break-all; }
.hidden { display: none !important; }
::selection { background: rgba(46, 139, 58, .25); }

/* ---------- ikonka ---------- */
.ic { display: inline-block; vertical-align: -0.2em; flex: none; }
.btn .ic { margin: 0 -1px; }

/* ---------- yuqori panel ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 24px; background: var(--topbar); color: #fff;
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar a { color: #fff; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; text-decoration: none !important; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #f5c04a, #e09a12); display: grid; place-items: center; color: #1c3f12; font-weight: 900;
  box-shadow: 0 4px 14px -4px rgba(233,169,31,.8), inset 0 -2px 0 rgba(0,0,0,.12); transition: transform .4s var(--ease); }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-sub { font-weight: 500; opacity: .75; }
.topbar nav { display: flex; gap: 4px; margin-left: 10px; }
.topbar nav a { padding: 6px 12px; border-radius: 99px; opacity: .85; font-weight: 600; font-size: .92rem; transition: background .2s, opacity .2s; }
.topbar nav a.active, .topbar nav a:hover { opacity: 1; text-decoration: none; background: rgba(255,255,255,.12); }
.topbar .spacer { flex: 1; }
.ai-pill { font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); display: inline-flex; align-items: center; gap: 6px; }
.ai-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7ee28b; box-shadow: 0 0 0 3px rgba(126,226,139,.25); animation: breathe 2.4s infinite; }
.ai-pill.off::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(233,169,31,.25); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; display: inline-grid; place-items: center; cursor: pointer;
  transition: background .2s, transform .2s var(--ease); }
.icon-btn:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }
.theme-btn .ic { transition: transform .5s var(--ease); }
.theme-btn:hover .ic { transform: rotate(25deg); }
.menu-btn { display: none; }
.lang-select { width: auto; padding: 6px 28px 6px 10px; font-size: .8rem; font-weight: 600; background-color: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.16); border-radius: 10px; }
.lang-select option { color: #17231a; }
.bell { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; text-decoration: none !important; transition: background .2s; }
.bell:hover { background: rgba(255,255,255,.12); }
.bell.ring .ic { animation: ring 1s var(--ease); transform-origin: 50% 10%; }
.bell-count { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #2b1d00; font-size: .68rem; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--topbar); animation: pop .35s var(--ease); }
.user-name { opacity: .85; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1240px; margin: 0 auto; padding: 26px 24px 40px; }

/* ---------- kartalar va panjaralar ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), background-color .3s; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .faq > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

/* ---------- formalar ---------- */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; background: var(--input-bg); color: var(--text);
  transition: border-color .2s, box-shadow .2s, background-color .3s; }
input:hover, select:hover, textarea:hover { border-color: var(--brand-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(46, 139, 58, .16); }
input:disabled { opacity: .65; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23879686' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
textarea { resize: vertical; min-height: 80px; }
input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button { border: 0; background: var(--brand-soft); color: var(--brand-2); padding: 6px 12px; border-radius: 8px; font-weight: 600; margin-right: 10px; cursor: pointer; }
.field { margin-bottom: 14px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
fieldset:disabled { opacity: .7; }

/* ---------- tugmalar ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; overflow: hidden; isolation: isolate;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s, color .2s; }
.btn:hover { background: var(--surface-2); border-color: var(--brand-3); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(46, 139, 58, .25); }
.btn.primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px rgba(46, 139, 58, .65); }
.btn.primary:hover { box-shadow: 0 10px 22px -8px rgba(46, 139, 58, .8); filter: brightness(1.05); }
.btn.accent { background: linear-gradient(135deg, #f6c24c, #e39d10); border-color: transparent; color: #2b1d00; box-shadow: 0 6px 16px -6px rgba(233, 169, 31, .7); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 11px; font-size: .84rem; border-radius: 9px; }
.btn.lg { padding: 13px 24px; font-size: 1rem; border-radius: 12px; }
/* to'lqin effekti */
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .22; pointer-events: none; animation: ripple .6s var(--ease); z-index: -1; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------- belgilar ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--surface-3); border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.badge.draft { background: var(--surface-3); }
.badge.negotiation { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.partially_signed { background: var(--accent-soft); color: #9a6a00; border-color: transparent; }
:root[data-theme="dark"] .badge.partially_signed { color: var(--accent); }
.badge.signed { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.badge.cancelled { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.live { background: var(--danger-soft); color: var(--danger); border-color: transparent; animation: livePulse 1.8s infinite; }
.badge.negotiation::before, .badge.partially_signed::before, .badge.signed::before, .badge.cancelled::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lang-chip { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-2); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.lang-chip button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 0 0 2px; font-size: 1rem; line-height: 1; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 12px; animation: fadeUp .4s var(--ease) both; }
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.alert.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert.success { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }

/* ---------- jadvallar va ro'yxatlar ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .15s; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; border-radius: 10px;
  transition: background-color .15s, transform .2s var(--ease); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); transform: translateX(3px); }
.list-item.compact { padding: 7px 6px; }
.li-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; }
.li-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.li-body > * { overflow: hidden; text-overflow: ellipsis; }

/* ---------- statistika ---------- */
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat > b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat span.small { display: block; margin-top: 4px; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--brand-soft); opacity: .7; transition: transform .5s var(--ease); }
.stat:hover::after { transform: scale(1.25); }
.stat > * { position: relative; z-index: 1; }
.stat.attention { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.stat.attention::after { background: var(--accent-soft); }
.link-card { color: var(--text); text-decoration: none !important; display: block; }
.link-card:hover { border-color: var(--brand-3); transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ---------- tablar ---------- */
.tabs { position: relative; display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; border: 0; background: none; padding: 11px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
  border-radius: 10px 10px 0 0; transition: color .2s, background-color .2s; }
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; border-radius: 3px; background: var(--brand); transform: scaleX(0); transition: transform .3s var(--ease); }
.tabs button.active { color: var(--brand-2); }
.tabs button.active::after { transform: scaleX(1); }

/* ---------- hujjat turlari / usta ---------- */
.type-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; background: var(--surface); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.type-card:hover { border-color: var(--brand-3); transform: translateY(-3px); box-shadow: var(--shadow); }
.type-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.type-card h3 { margin-bottom: 4px; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; counter-reset: step; }
.steps span { position: relative; flex: 1; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-align: center; font-weight: 600; color: var(--muted); font-size: .9rem; overflow: hidden; transition: all .3s var(--ease); }
.steps span.on { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(46,139,58,.7); }

/* ---------- hujjat (qog'oz) ---------- */
.doc-wrap { display: grid; gap: 16px; }
.doc-wrap.cols-2 { grid-template-columns: 1fr 1fr; }
.doc-wrap.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.doc { background: #fff; border: 1px solid #e3e6df; border-radius: 6px; padding: 44px 48px; font: 14.5px/1.6 var(--doc-font); color: #111; box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 18px 40px -18px rgba(0,0,0,.25);
  animation: paperIn .5s var(--ease) both; }
:root[data-theme="dark"] .doc { border-color: #2c3a2f; }
.doc h1 { text-align: center; font-size: 1.15rem; letter-spacing: .02em; margin-bottom: 4px; font-weight: 700; }
.doc .num { text-align: center; margin-bottom: 14px; }
.doc .place { display: flex; justify-content: space-between; margin-bottom: 16px; }
.doc .preamble { text-indent: 2em; text-align: justify; }
.doc h2 { font-size: 1rem; text-align: center; margin: 18px 0 8px; font-weight: 700; letter-spacing: 0; }
.doc p.clause { margin: 0 0 6px; text-align: justify; }
.doc .req { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; font-size: .9rem; }
.doc .req h3 { font-size: .95rem; margin-bottom: 6px; }
.doc .req div p { margin: 0 0 3px; }
.doc .sigline { margin-top: 14px; display: flex; align-items: flex-end; gap: 8px; min-height: 60px; }
.doc .sigline img { height: 56px; }
.doc .sigline .line { flex: 1; border-bottom: 1px solid #333; }
.doc .stamp-meta { font: 11px/1.4 var(--font); color: #2a5f2d; border: 1px dashed #7bb07e; border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.doc .footer { margin-top: 24px; padding-top: 10px; border-top: 1px solid #ccc; display: flex; gap: 12px; align-items: center; font: 11px/1.4 var(--font); color: #555; }
.doc .footer .qr { flex: none; width: 84px; height: 84px; }
.doc .footer .qr svg { width: 84px; height: 84px; display: block; }
.doc .lang-chip { background: #e5f3e2; color: #1c5e26; }
.doc[dir="rtl"] { text-align: right; }
.doc[dir="rtl"] p.clause, .doc[dir="rtl"] .preamble { text-align: right; }
.edit-section { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.edit-section textarea { min-height: 60px; margin-bottom: 6px; font-family: var(--doc-font); }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding: 4px; scroll-behavior: smooth; }
.msg { max-width: 78%; padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--border); animation: msgIn .35s var(--ease) both; }
.msg.mine { align-self: flex-end; background: var(--brand-soft); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.msg.system { align-self: center; background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); font-size: .84rem; max-width: 90%; text-align: center; border-radius: 99px; padding: 6px 14px; }
.msg.change_request { border-left: 4px solid var(--accent); }
.msg.ai { background: var(--info-soft); border-color: transparent; }
.msg .meta { font-size: .74rem; color: var(--muted); margin-bottom: 4px; }
.msg .tr { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border-strong); font-size: .88rem; color: var(--brand-2); }
.msg .att { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; font-size: .85rem; transition: border-color .2s; }
.msg .att:hover { border-color: var(--brand-3); }
.msg p { margin: 0; white-space: pre-wrap; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.chat-input textarea { min-height: 46px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }

/* ---------- xatarlar ---------- */
.risk { border-left: 4px solid; padding: 11px 13px; border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; animation: fadeUp .4s var(--ease) both; }
.risk.high { border-color: var(--danger); } .risk.medium { border-color: var(--accent); } .risk.low { border-color: var(--brand-3); }
.score { font-size: 2.4rem; font-weight: 900; letter-spacing: -.03em; }

/* ---------- modal va toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 16, 9, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fadeIn .2s ease both; }
.modal { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 24px; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modalIn .35s var(--ease) both; }
.modal.wide { width: min(900px, 100%); }
.modal-bg.closing { animation: fadeOut .2s ease both; }
.modal-bg.closing .modal { animation: modalOut .2s ease both; }
canvas.sigpad { width: 100%; height: 180px; border: 1.5px dashed var(--brand-3); border-radius: 12px; background: #fcfffb; touch-action: none; cursor: crosshair; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: #18241a; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: 420px; font-size: .92rem;
  animation: toastIn .4s var(--ease) both; }
.toast .ic { color: #7ee28b; }
.toast.error { background: #a8332b; } .toast.error .ic { color: #ffd2cc; }
.toast.out { animation: toastOut .3s ease both; }

/* ---------- yuklanish ---------- */
.spinner { width: 22px; height: 22px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.gen-box { text-align: center; padding: 50px 20px; }
.gen-box .spinner { width: 46px; height: 46px; border-width: 4px; margin-bottom: 14px; }
.ai-orb { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: conic-gradient(from 0deg, var(--brand), var(--accent), var(--brand-3), var(--brand)); animation: spin 2.2s linear infinite; position: relative; }
.ai-orb::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-page { display: grid; gap: 16px; }
.sk-line { height: 18px; } .sk-title { height: 34px; width: 40%; } .sk-card { height: 120px; }

/* ---------- auth ---------- */
.auth-wrap { max-width: 760px; margin: 30px auto; }
.auth-box { max-width: 440px; margin: 48px auto; }
.auth-box h1 { margin-bottom: 18px; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }

/* ---------- bosh sahifa ---------- */
.landing-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center; background: linear-gradient(135deg, #1c5e26 0%, #2e8b3a 55%, #3c9e49 100%); color: #fff; border-radius: 24px; padding: 56px 48px; box-shadow: var(--shadow-lg); }
.landing-hero::before, .landing-hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; pointer-events: none; }
.landing-hero::before { width: 380px; height: 380px; right: -80px; top: -120px; background: #f2b632; animation: blob 14s ease-in-out infinite; }
.landing-hero::after { width: 300px; height: 300px; left: -100px; bottom: -140px; background: #7ee28b; animation: blob 18s ease-in-out infinite reverse; }
.landing-hero > * { position: relative; z-index: 1; }
.landing-hero h1 { font-size: 2.6rem; line-height: 1.12; margin-bottom: 16px; letter-spacing: -.03em; }
.landing-hero .lead { font-size: 1.08rem; opacity: .92; margin-bottom: 26px; max-width: 560px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); padding: 5px 12px; border-radius: 99px; margin-bottom: 16px; }
.btn.ghost-light { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.45); }
.btn.ghost-light:hover { background: rgba(255,255,255,.16); border-color: #fff; }
.hero-doc { position: relative; height: 290px; }
.hero-sheet { position: absolute; width: 74%; background: #fff; color: #222; border-radius: 10px; padding: 18px 20px; box-shadow: 0 18px 40px rgba(0,0,0,.28); font: 700 .72rem/1.3 var(--doc-font); }
.hero-sheet span { display: block; height: 7px; background: #e6e9e3; border-radius: 4px; margin-top: 10px; }
.hero-sheet span.short { width: 60%; }
.hero-sheet.s1 { left: 0; top: 76px; z-index: 3; animation: float 6s ease-in-out infinite; }
.hero-sheet.s2 { left: 12%; top: 38px; z-index: 2; opacity: .94; animation: float 7s ease-in-out -2s infinite; }
.hero-sheet.s3 { left: 24%; top: 0; z-index: 1; opacity: .86; animation: float 8s ease-in-out -4s infinite; }
.hero-sig { margin-top: 12px; display: inline-flex; align-items: center; gap: 5px; font: 600 .7rem var(--font); color: #1c5e26; border: 1px dashed #7bb07e; border-radius: 6px; padding: 4px 8px; animation: stampIn 1s var(--ease) 1.2s both; }
.landing-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: -30px 32px 0; position: relative; z-index: 2; }
.landing-stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; text-align: center; }
.landing-stats b { display: block; font-size: 2rem; font-weight: 900; color: var(--brand-2); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.landing-stats span { color: var(--muted); font-size: .85rem; }
.landing-section { margin-top: 64px; }
.landing-section > h2 { text-align: center; font-size: 1.7rem; font-weight: 800; margin-bottom: 26px; }
.feature .f-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 12px; background: var(--brand-soft); color: var(--brand-2); transition: transform .35s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-3); }
.feature:hover .f-icon { transform: rotate(-8deg) scale(1.08); }
.step { position: relative; padding-top: 32px; }
.step-n { position: absolute; top: -16px; left: 20px; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, #f6c24c, #e39d10); color: #2b1d00; font-weight: 900; display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(233,169,31,.8); }
.lang-example { display: inline-flex; gap: 4px; align-items: center; padding: 7px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: .85rem; transition: transform .2s var(--ease); }
.lang-example:hover { transform: translateY(-2px); }
.doc-type-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; display: flex; flex-direction: column; gap: 2px; transition: border-color .2s, transform .2s var(--ease); }
.doc-type-item:hover { border-color: var(--brand-3); transform: translateY(-2px); }
.plan ul { padding-left: 0; margin: 12px 0 0; list-style: none; }
.plan li { margin-bottom: 8px; padding-left: 24px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e8b3a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center/10px no-repeat; }
.plan.highlight { border: 2px solid var(--brand); transform: scale(1.02); }
.plan.highlight::before { content: "★"; position: absolute; top: 14px; right: 16px; color: var(--accent); font-size: 1.1rem; }
.plan { position: relative; }
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--brand); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details[open] p { animation: fadeUp .35s var(--ease) both; }
.faq details p { margin: 10px 0 0; }
.landing-cta { margin-top: 64px; text-align: center; background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft)); border: 1px solid var(--border); border-radius: 24px; padding: 44px 20px; }
.landing-cta h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 18px; }
.landing-footer { margin-top: 44px; padding: 20px 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- bildirishnomalar ---------- */
.notif-list { padding: 8px; }
.notif { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; color: var(--text); text-decoration: none !important; transition: background-color .15s, transform .2s var(--ease); }
.notif + .notif { margin-top: 2px; }
.notif:hover { background: var(--surface-2); transform: translateX(3px); }
.notif.unread { background: var(--brand-soft); }
.notif .n-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--brand-2); }
.notif .n-body { display: flex; flex-direction: column; min-width: 0; }
.notif .n-time { white-space: nowrap; text-align: right; }

/* ---------- admin ---------- */
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 40px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: .88rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-3), var(--brand)); border-radius: 6px; transform-origin: left; animation: grow .9s var(--ease) both; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.col-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 8px 0; }
.col-chart span { flex: 1; min-height: 3px; background: linear-gradient(180deg, var(--brand-3), var(--brand)); border-radius: 4px 4px 1px 1px; transform-origin: bottom; animation: growY .8s var(--ease) both; transition: filter .2s; }
.col-chart span:hover { filter: brightness(1.2); }
.big-404 { font-size: 6rem; font-weight: 900; line-height: 1; margin-bottom: 8px; letter-spacing: -.05em; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: float 5s ease-in-out infinite; }

/* ---------- kabinet ---------- */
main:has(.cabinet) { max-width: 1400px; }
.cabinet { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 22px; align-items: start; }
.side { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.side-new { justify-content: center; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: background-color .2s, color .2s, transform .2s var(--ease); }
.side nav a:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.side nav a.active { background: var(--brand-soft); color: var(--brand-2); }
.side nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); animation: growY .35s var(--ease) both; }
.s-icon { width: 22px; display: grid; place-items: center; }
.s-label { flex: 1; }
.s-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #2b1d00; font-size: .7rem; font-weight: 800; display: grid; place-items: center; animation: pop .35s var(--ease); }
.side-user { border-top: 1px solid var(--border); padding: 10px 4px 2px; display: flex; flex-direction: column; font-size: .85rem; overflow: hidden; }
.side-user span { overflow: hidden; text-overflow: ellipsis; }
.view { min-width: 0; }
.view.enter > * { animation: fadeUp .45s var(--ease) both; }
.view.enter > *:nth-child(2) { animation-delay: .05s; } .view.enter > *:nth-child(3) { animation-delay: .1s; } .view.enter > *:nth-child(4) { animation-delay: .15s; } .view.enter > *:nth-child(n+5) { animation-delay: .2s; }
.view.enter .grid > .card { animation: fadeUp .5s var(--ease) both; }
.view.enter .grid > .card:nth-child(2) { animation-delay: .06s; } .view.enter .grid > .card:nth-child(3) { animation-delay: .12s; } .view.enter .grid > .card:nth-child(4) { animation-delay: .18s; } .view.enter .grid > .card:nth-child(n+5) { animation-delay: .24s; }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9c1b6; }
.presence.on { color: var(--brand-2); }
.presence.on::before { background: #2ecc40; box-shadow: 0 0 0 0 rgba(46,204,64,.5); animation: onlinePulse 2s infinite; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .74rem; flex: none; }
.cp-card { display: flex; flex-direction: column; gap: 4px; }
.cp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
pre.minutes { white-space: pre-wrap; font: 13.5px/1.6 var(--doc-font); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; max-height: 420px; overflow-y: auto; animation: fadeUp .4s var(--ease) both; }

/* ---------- uchrashuv xonasi ---------- */
.room-lobby { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; max-width: 1200px; margin: 0 auto; animation: fadeUp .45s var(--ease) both; }
body.in-room main { max-width: none; padding: 0; }
body.in-room { background: #0b110c; background-image: none; }
.room { display: grid; grid-template-columns: minmax(0, 1fr) 330px; height: calc(100vh - 57px); background: radial-gradient(900px 500px at 30% 0%, #18301c, #0b110c 70%); color: #e9efe7; animation: fadeIn .4s ease both; }
.room-main { display: flex; flex-direction: column; min-width: 0; }
.room-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; gap: 10px; }
.room-head a { color: #a7d7a9; }
.room .alert { color: #4a3b00; margin: 0 14px 6px; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ecc40; display: inline-block; animation: onlinePulse 2s infinite; }
.video-grid { flex: 1; display: grid; gap: 12px; padding: 10px 16px; grid-template-columns: 1fr; grid-auto-rows: 1fr; min-height: 0; }
.video-grid[data-n="2"] { grid-template-columns: 1fr 1fr; }
.video-grid[data-n="3"], .video-grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
.video-grid[data-n="5"], .video-grid[data-n="6"] { grid-template-columns: 1fr 1fr 1fr; }
.tile { position: relative; background: linear-gradient(160deg, #1d2a1e, #121a13); border-radius: 18px; overflow: hidden; min-height: 160px; border: 2px solid rgba(255,255,255,.04);
  transition: border-color .2s, box-shadow .2s; animation: tileIn .45s var(--ease) both; }
.tile.speaking { border-color: #3ddc58; box-shadow: 0 0 0 4px rgba(61,220,88,.18); }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; position: absolute; inset: 0; transition: opacity .3s; }
.tile.has-video video { opacity: 1; }
.tile.local video { transform: scaleX(-1); }
.tile .avatar { position: absolute; inset: 0; margin: auto; width: 100px; height: 100px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.tile.speaking .avatar { animation: speak 1s ease-in-out infinite; }
.tile.has-video .avatar { display: none; }
.tile-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: linear-gradient(transparent, rgba(0,0,0,.65)); font-size: .85rem; }
.tile-name { background: rgba(0,0,0,.35); padding: 3px 9px; border-radius: 8px; backdrop-filter: blur(6px); }
.tile-icons .ic { color: #ff8f86; }
.tile-state { position: absolute; top: 10px; left: 12px; font-size: .78rem; color: #ffd27a; }
.waiting { text-align: center; color: #a9b8a6; padding: 6px; font-size: .9rem; display: flex; justify-content: center; align-items: center; gap: 10px; }
.controls { display: flex; justify-content: center; gap: 12px; padding: 14px; }
.ctl { width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; position: relative; display: grid; place-items: center;
  backdrop-filter: blur(8px); transition: background-color .2s, transform .2s var(--ease); }
.ctl .ic { width: 22px; height: 22px; }
.ctl:hover { background: rgba(255,255,255,.16); transform: translateY(-2px); }
.ctl:active { transform: scale(.92); }
.ctl:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.ctl.off { background: #d0443a; border-color: transparent; }
.ctl.active { background: var(--brand); border-color: transparent; }
.ctl.notify::after { content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pop .3s var(--ease); }
.ctl.hang { background: #d0443a; width: 70px; border-radius: 28px; border-color: transparent; }
.ctl.hang:hover { background: #e2554b; }
.ctl[data-tip]:hover::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; font-size: .74rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; animation: fadeIn .15s both; }
.room-side { background: var(--surface); color: var(--text); display: flex; flex-direction: column; padding: 12px; min-height: 0; border-left: 1px solid rgba(255,255,255,.06); animation: slideInRight .35s var(--ease) both; }
.room-side.collapsed { display: none; }
.room:has(.room-side.collapsed) { grid-template-columns: minmax(0, 1fr); }
.room-side .pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.room-side textarea { flex: 1; font-family: var(--doc-font); }
.room-chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.room-chat .msg { max-width: 92%; }

/* ---------- kiruvchi qo'ng'iroq ---------- */
.incoming-call { text-align: center; }
.incoming-call .pulse { width: 92px; height: 92px; margin: 4px auto 14px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; animation: callPulse 1.4s infinite; }
.incoming-call .pulse .ic { width: 38px; height: 38px; animation: ring 1.2s ease-in-out infinite; }

/* ---------- animatsiyalar ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes paperIn { from { opacity: 0; transform: translateY(16px) rotate(-.4deg); } to { opacity: 1; transform: none; } }
@keyframes tileIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(9deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes blob { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(-30px, 20px) scale(1.1); } 66% { transform: translate(20px, -15px) scale(.92); } }
@keyframes stampIn { from { opacity: 0; transform: scale(1.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes onlinePulse { 0% { box-shadow: 0 0 0 0 rgba(46,204,64,.55); } 70% { box-shadow: 0 0 0 7px rgba(46,204,64,0); } 100% { box-shadow: 0 0 0 0 rgba(46,204,64,0); } }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes callPulse { 0% { box-shadow: 0 0 0 0 rgba(46,139,58,.55); } 70% { box-shadow: 0 0 0 26px rgba(46,139,58,0); } 100% { box-shadow: 0 0 0 0 rgba(46,139,58,0); } }
@keyframes speak { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- moslashuvchan ---------- */
@media (max-width: 900px) {
  .grid-2, .grid-3, .hero, .doc-wrap.cols-2, .doc-wrap.cols-3, .landing-hero, .grid-2-1, .room-lobby { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 16px; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .menu-btn { display: inline-grid; margin-left: auto; }
  .topbar nav, .topbar #ai-pill, .topbar .spacer { display: none; }
  .topbar.open nav { display: flex; flex-direction: column; width: 100%; order: 10; margin: 4px 0 0; gap: 4px; animation: fadeUp .3s var(--ease) both; }
  .topbar .user-name { display: none; }
  .doc { padding: 24px 18px; }
  .doc .req { grid-template-columns: 1fr; }
  .landing-hero { padding: 34px 22px; border-radius: 20px; }
  .landing-hero h1 { font-size: 1.85rem; }
  .hero-doc { display: none; }
  .landing-stats { grid-template-columns: repeat(2, 1fr); margin: 16px 0 0; }
  .msg { max-width: 92%; }
  .chat-input { flex-direction: column; align-items: stretch; }
  .chat-input .stack { min-width: 0 !important; }
  .row.between > .row { flex-wrap: wrap; }
  .notif { grid-template-columns: 34px 1fr; }
  .notif .n-icon { width: 34px; height: 34px; }
  .notif .n-time { grid-column: 2; text-align: left; }
  table { font-size: .88rem; }
  .cabinet { grid-template-columns: 1fr; gap: 12px; }
  .side { position: static; padding: 8px; flex-direction: row; overflow-x: auto; align-items: center; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side nav { flex-direction: row; }
  .side nav a { white-space: nowrap; padding: 8px 10px; }
  .side nav a.active::before { display: none; }
  .side .s-label { display: none; }
  .side nav a.active .s-label { display: inline; }
  .side-new span, .side-user { display: none; }
  .side-new { padding: 8px 12px; }
  .room { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 57px); }
  .room-side { border-left: 0; min-height: 320px; }
  .video-grid { min-height: 60vh; }
  .video-grid[data-n="2"] { grid-template-columns: 1fr; }
  .ctl { width: 48px; height: 48px; }
  .plan.highlight { transform: none; }
}
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } }

/* ---------- chop etish ---------- */
@media print {
  body { background: #fff !important; background-image: none !important; }
  .topbar, .no-print, .toast-stack, .side { display: none !important; }
  main { max-width: none; padding: 0; }
  .cabinet { display: block; }
  .doc { border: 0; padding: 0; font-size: 12pt; box-shadow: none; animation: none; }
  .doc-wrap { gap: 8mm; }
  .doc-wrap.cols-1 .doc + .doc { page-break-before: always; }
  .doc-wrap.cols-2, .doc-wrap.cols-3 { font-size: 10pt; }
  @page { size: A4; margin: 16mm 14mm; }
}

/* ---------------------------------------------------------------- LEX: yuridik xizmatlar */
.badge.warn { background: var(--warn-soft); color: #9a6a00; border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.success { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.badge.muted { color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0 0 12px; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-weight: 500; }
.legal-chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.legal-history { max-height: 70vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.legal-history .list-item { flex-direction: column; align-items: flex-start; gap: 2px; }
.legal-history .list-item.active { background: var(--brand-soft); }
.legal-chat { display: flex; flex-direction: column; min-height: 60vh; }
.legal-msgs { flex: 1; overflow: auto; max-height: 58vh; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.legal-msg { display: flex; }
.legal-msg > div { max-width: 85%; padding: 10px 14px; border-radius: 14px; line-height: 1.55; }
.legal-msg.user { justify-content: flex-end; }
.legal-msg.user > div { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.legal-msg.assistant > div { background: var(--surface-3); border-bottom-left-radius: 4px; }
.legal-ask { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.legal-ask textarea { flex: 1; }
.legal-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex: none; }
.legal-service p, .legal-lawyer p { margin: 6px 0 10px; }
.legal-notes { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; margin-bottom: 10px; }
.legal-note { background: var(--surface-3); border-radius: 10px; padding: 8px 12px; }
.legal-note.me { background: var(--brand-soft); }
.legal-paper textarea { width: 100%; min-height: 70vh; font: 14px/1.6 "Times New Roman", serif; border: 0; resize: vertical; background: transparent; color: var(--text); }
@media (max-width: 860px) { .legal-chat-layout { grid-template-columns: 1fr; } .legal-history { max-height: 180px; } }
