/* ===== Sokin palitra: ko‘zni charchatmaydigan, past to‘yinganlikdagi shalfey-yashil va qum ohanglari.
   Sof oq (#fff) va sof qora ishlatilmaydi — yorqinlik farqi yumshoq, lekin matn kontrasti WCAG AA (≥4.5:1). ===== */
:root {
  --bg: #f3f5f0; --bg-2: #eaf0ea; --surface: #fbfcf9; --ink: #2b3a36; --muted: #5f6f69; --line: #dde4dc;
  --brand: #4a7a6d; --brand-2: #6f9c8e; --brand-ink: #f8fbf9; --accent: #d8b67c; --accent-ink: #4a3714;
  --danger: #a9584c; --warn: #8c6327; --ok: #3f7d5f; --info: #4f7391;
  --c-tension: #c07a62; --c-wpm: #5d8aa8;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(43,58,54,.05), 0 8px 28px rgba(43,58,54,.07);
  --shadow-lg: 0 18px 50px rgba(43,58,54,.14);
  --ease: cubic-bezier(.22,.7,.2,1);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1a2220; --bg-2: #1f2a27; --surface: #222d2a; --ink: #dde6e1; --muted: #9eaca6; --line: #31403b;
    --brand: #8cbfaf; --brand-2: #6fa392; --brand-ink: #13201c; --accent: #d9bd8a; --accent-ink: #2a1f0b;
    --danger: #e0968a; --warn: #e2b46e; --ok: #8fcfaa; --info: #9cc0dc;
    --c-tension: #e3a089; --c-wpm: #9cc0dc; --shadow: 0 1px 2px rgba(0,0,0,.2); --shadow-lg: 0 18px 50px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { line-height: 1.55; font-size: 16px; }
a { color: var(--brand); }
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; margin: .2em 0 .4em; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 1.2em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.1em 0 .4em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; gap: 1.5rem; align-items: center; padding: .75rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--ink); display: flex; gap: .5rem; align-items: center; }
.brand-mark { color: var(--accent); background: var(--brand); border-radius: 8px; padding: 0 .35rem; font-size: .8rem; line-height: 1.8; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); padding: .4rem .75rem; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a[aria-current] { color: var(--brand-ink); background: var(--brand); }
.rec-indicator { margin-left: auto; display: none; color: var(--danger); font-weight: 700; text-decoration: none; animation: pulse 1.4s infinite; }
body[data-recording="true"] .rec-indicator { display: inline; }
@keyframes pulse { 50% { opacity: .45; } }

main { max-width: 1180px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.view:focus { outline: none; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; border-top: 1px solid var(--line); }

.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; align-items: center; padding: 1.5rem 0 2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--warn); margin: 0; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 60ch; }
.hero-points { list-style: none; margin: 0; padding: 1.25rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero-points li { padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.hero-points li:last-child { border: 0; }
.note { font-size: .88rem; color: var(--muted); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: .6rem .8rem; border-radius: 10px; }

.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: .6rem 1rem; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.btn:hover { border-color: var(--brand); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-ghost { background: transparent; }
.btn-small { padding: .35rem .7rem; font-size: .9rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.filters { display: grid; gap: .75rem; margin: .5rem 0 .75rem; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; width: fit-content; flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; padding: .45rem .9rem; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); }
input[type=search], input[type=text], input[type=url], input[type=password], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; min-width: 0; }
input[type=search] { flex: 1 1 260px; }
textarea { width: 100%; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; }
.chip-on { background: var(--accent); color: #2b1b00; border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; box-shadow: var(--shadow); }
.card h3 { margin: .3rem 0 0; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .btn { margin-top: auto; align-self: flex-start; }
.card-top { display: flex; justify-content: space-between; gap: .5rem; }
.badge { white-space: nowrap; font-size: .78rem; font-weight: 700; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); padding: .15rem .55rem; border-radius: 999px; }
.badge-soft { background: var(--bg); color: var(--muted); }
.meta { font-size: .85rem !important; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0 .5rem; }
.tag { font-size: .78rem; color: var(--warn); background: color-mix(in srgb, var(--accent) 16%, transparent); padding: .1rem .45rem; border-radius: 6px; }
.empty { padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.reco { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1.25rem 1.25rem; margin-bottom: 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ok { color: var(--ok); }

.status-wrap { display: flex; gap: .75rem; align-items: center; }
.status { font-weight: 700; padding: .35rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.status[data-state="recording"] { color: var(--danger); border-color: var(--danger); }
.status[data-state="paused"] { color: var(--warn); }
.status[data-state="summary"] { color: var(--ok); }
.status[data-state="error"] { background: var(--danger); color: #fff; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 800; }
.diag-grid { display: grid; grid-template-columns: 360px 1fr; gap: 1rem; margin-top: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.panel h2:first-child { margin-top: 0; }
.cam-box { aspect-ratio: 4/3; background: #0d1318; border-radius: 10px; overflow: hidden; display: grid; place-items: center; margin-bottom: .75rem; }
.cam { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-ph { color: #9aa8b3; font-size: .95rem; padding: 1rem; text-align: center; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-size: .92rem; margin: .4rem 0 .8rem; }
.controls { margin-bottom: .5rem; }
.level { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 1rem; }
.level-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--accent), var(--danger)); transition: width .2s; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.metric { background: var(--bg); border-radius: 10px; padding: .6rem .75rem; }
.metric-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.metric-value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: .75rem; font-weight: 600; color: var(--muted); }
.chart-wrap { margin-top: 1rem; }
#live-chart { width: 100%; height: auto; background: var(--bg); border-radius: 10px; }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.lg::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: .35rem; vertical-align: middle; }
.lg-t::before { background: var(--c-tension); } .lg-w::before { background: var(--c-wpm); }
.alert { padding: .75rem 1rem; border-radius: 10px; margin: .75rem 0; }
.alert-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.alert-warn { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.alert-warn ol { margin: .5rem 0; padding-left: 1.2rem; }
.summary { margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 1.5rem; box-shadow: var(--shadow); }
.summary h2 { margin-top: .2rem; }
.issues { list-style: none; padding: 0; display: grid; gap: .5rem; }
.issues li { display: grid; gap: .1rem; padding: .6rem .8rem; border-left: 4px solid var(--brand); background: var(--bg); border-radius: 0 10px 10px 0; }
.issues li span { color: var(--muted); font-size: .92rem; }
.issues .sev-diqqat { border-color: var(--accent); } .issues .sev-muhim { border-color: var(--danger); }
.obs li, .reco-list li { margin: .25rem 0; }

.ai-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1rem; margin-top: 1rem; }
.field { display: grid; gap: .25rem; font-size: .88rem; font-weight: 600; margin-bottom: .7rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.ctx-preview { white-space: pre-wrap; font-size: .78rem; background: var(--bg); padding: .6rem; border-radius: 8px; max-height: 220px; overflow: auto; }
.chat { display: flex; flex-direction: column; min-height: 540px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding: .5rem 0; max-height: 60vh; }
.chat-empty { text-align: center; margin: auto; }
.msg { max-width: 85%; padding: .6rem .85rem; border-radius: 12px; background: var(--bg); }
.msg-user { align-self: flex-end; background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.msg-who { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.pending .msg-text { color: var(--muted); font-style: italic; }
.chat-input { border-top: 1px solid var(--line); padding-top: .75rem; display: grid; gap: .5rem; }

.modal { border: 0; border-radius: 16px; padding: 0; width: min(720px, 94vw); max-height: 88vh; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal::backdrop { background: rgba(10,16,20,.55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: .5rem 1.25rem 1.5rem; }
.media { width: 100%; border-radius: 10px; margin: .5rem 0; }
.video-demo { display: grid; place-items: center; gap: .5rem; padding: 1.5rem; background: #0d1318; color: #c9d4dc; border-radius: 12px; margin: .5rem 0 .75rem; }
.orb { width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--accent), var(--brand)); transition: transform 4s ease-in-out; }
.orb.grow { transform: scale(1.6); }
.steps li { padding: .3rem .5rem; border-radius: 8px; }
.steps li.active { background: color-mix(in srgb, var(--accent) 25%, transparent); font-weight: 700; }
.prose p { max-width: 70ch; }

.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 100; max-width: min(420px, 92vw); }
.toast { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; padding: .7rem .9rem; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: 0 8px 30px rgba(0,0,0,.2); font-size: .92rem; }
.toast-error { background: var(--danger); color: #fff; } .toast-warn { background: var(--accent); color: #2b1b00; } .toast-ok { background: var(--ok); color: #fff; }
.toast-x { background: none; border: 0; color: inherit; font-size: 1.1rem; cursor: pointer; line-height: 1; }

@media (max-width: 900px) {
  .hero, .diag-grid, .ai-grid { grid-template-columns: 1fr; }
  .topbar { gap: .75rem; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Auth ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(420px, 100%); display: grid; gap: .25rem; padding: 1.75rem; }
.auth-card h1 { font-size: 1.5rem; }
.auth-brand { margin-bottom: .5rem; }
.auth-card input { width: 100%; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.rec-indicator + .userbox { margin-left: 1rem; }
body:not([data-recording="true"]) .userbox { margin-left: auto; }
.user-link { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; display: grid; line-height: 1.15; }
.user-link small { color: var(--muted); font-weight: 500; font-size: .75rem; }
.hero-simple { padding: 2rem 0; }

/* ---- Mashqlar ---- */
.empty-state { text-align: center; padding: 2rem; }
.plan-list { list-style: none; padding: 0; display: grid; gap: .6rem; margin-top: 1rem; }
.plan-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.plan-num { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; }
.plan-main h3 { margin: 0 0 .2rem; }
.plan-main p { margin: .1rem 0; }
.ex-form .row .field { flex: 1 1 160px; }
.tags-field { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: 0 0 .7rem; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.tags-field legend { font-size: .88rem; font-weight: 600; padding: 0 .3rem; }
.check-inline { font-size: .9rem; display: inline-flex; gap: .3rem; align-items: center; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); padding: .5rem; }
.table td { border-bottom: 1px solid var(--line); padding: .55rem .5rem; vertical-align: top; }
.table .actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.row-off td { opacity: .55; }
.row-warn td { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.status-pill { font-size: .78rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; }
.st-pending { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--warn); }
.st-published { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.st-rejected { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.review-list { display: grid; gap: .8rem; }
.review-card { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; background: var(--bg); }
.review-card h3 { margin-top: 0; }
.review-note { flex: 1 1 220px; }
.panel + .panel, .panel + section, section + .panel { margin-top: 1rem; }
.warn { color: var(--warn); }
.steps li.done { opacity: .55; text-decoration: line-through; }
.player-live { font-weight: 700; padding: .6rem .8rem; background: var(--bg); border-radius: 10px; margin: .6rem 0; font-variant-numeric: tabular-nums; }
.player-cam { max-height: 220px; border-radius: 10px; margin: .5rem 0; }
.reading { background: var(--bg); border-radius: 10px; padding: .25rem 1rem .5rem; margin-top: .75rem; }
.reading p { font-size: 1.1rem; line-height: 1.7; }
.result-box { border-radius: 12px; padding: .5rem 1rem; margin-top: 1rem; border: 1px solid var(--line); }
.res-ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.res-retry { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---- Admin ---- */
.admin-stats { margin: .5rem 0 1rem; }
.align-end { align-items: flex-end; }
.align-end .field { flex: 1 1 180px; margin-bottom: 0; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .9rem .2rem; margin: 0 0 .7rem; }
.perm-group legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; }
.perm-group .check { margin: .35rem 0; }
.perm-group .check span { display: grid; }
.perm-count { font-variant-numeric: tabular-nums; font-weight: 700; }
.temp-pass { font-size: 1.25rem; font-weight: 800; padding: .4rem .7rem; background: var(--bg); border-radius: 8px; letter-spacing: .05em; user-select: all; }
.bar-wrap { display: flex; align-items: center; gap: .4rem; }
.bar { width: 90px; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--ok); }
@media (max-width: 700px) { .plan-item { grid-template-columns: 34px 1fr; } .plan-item .btn { grid-column: 2; justify-self: start; } .userbox small { display: none; } }

/* =====================================================================
   SOKIN DIZAYN QATLAMI v2 — yumshoq shakllar, iliq fon, sekin animatsiyalar
   ===================================================================== */
html { scroll-behavior: smooth; }
body { line-height: 1.6; letter-spacing: .005em; background: var(--bg); }
/* Juda sekin harakatlanuvchi, past shaffoflikdagi fon "bulutlari" (30 s sikl) */
body::before, body::after { content: ""; position: fixed; z-index: -1; border-radius: 50%; filter: blur(80px); opacity: .45; pointer-events: none; }
body::before { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 28%, transparent), transparent 70%); animation: drift 32s ease-in-out infinite alternate; }
body::after { width: 40vw; height: 40vw; right: -10vw; bottom: -12vw; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%); animation: drift 38s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(6vw, 4vw) scale(1.12); } }

.topbar { background: color-mix(in srgb, var(--bg) 80%, transparent); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.brand-mark { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--accent); border-radius: 10px; }
.nav a { transition: background .35s var(--ease), color .35s var(--ease); }
.nav a:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--ink); }
.nav a[aria-current] { background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }

h1 { font-weight: 750; letter-spacing: -.02em; }
.accent-text { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { color: var(--brand); }
.note { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--radius-sm); }

/* Tugmalar: yumshoq, sezilarli lekin keskin bo‘lmagan javob */
.btn { border-radius: 12px; transition: transform .25s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease); }
.btn:hover:not([disabled]) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(43,58,54,.10); }
.btn:active:not([disabled]) { transform: translateY(0) scale(.985); }
.btn-primary { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 80%, var(--brand-2))); border-color: transparent; }
.btn-lg { padding: .8rem 1.3rem; font-size: 1.02rem; }
.btn-danger { color: var(--danger); }
.toast-error, .status[data-state="error"] { background: var(--danger); }

.card, .panel, .summary, .hero-points, .plan-item { border-radius: var(--radius); border-color: color-mix(in srgb, var(--line) 85%, transparent); background: var(--surface); }
.card { transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.card-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; }
.card .author { margin-top: .2rem; }
.badge { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.tag { color: var(--warn); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.chip { transition: all .3s var(--ease); }
.chip-on { background: var(--accent); color: var(--accent-ink); }
.seg { border-radius: 14px; } .seg-btn { border-radius: 11px; transition: background .35s var(--ease), color .35s var(--ease); }
.metric { border-radius: var(--radius-sm); background: var(--bg-2); }
.level-fill { background: linear-gradient(90deg, var(--ok), var(--accent), var(--c-tension)); }

/* Hero: "nafas olayotgan" vizual (4 s nafas olish + 4 s chiqarish = tinch nafas ritmi) */
.hero { grid-template-columns: 1.5fr 1fr; }
.hero-visual { position: relative; display: grid; place-items: center; min-height: 300px; }
.breath-ring, .breath-core { position: absolute; border-radius: 50%; }
.breath-ring.r1 { width: 260px; height: 260px; background: color-mix(in srgb, var(--brand) 10%, transparent); animation: breathe 8s ease-in-out infinite; }
.breath-ring.r2 { width: 200px; height: 200px; background: color-mix(in srgb, var(--brand) 14%, transparent); animation: breathe 8s ease-in-out infinite .4s; }
.breath-core { width: 140px; height: 140px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 40px color-mix(in srgb, var(--brand) 35%, transparent); display: grid; place-items: center; animation: breathe 8s ease-in-out infinite .8s; }
.breath-label { position: absolute; bottom: 0; margin: 0; color: var(--muted); font-size: .9rem; letter-spacing: .04em; animation: fadeBreath 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.92); } 50% { transform: scale(1.08); } }
@keyframes fadeBreath { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.wave { display: flex; gap: 4px; align-items: center; height: 46px; }
.wave i { display: block; width: 5px; height: 100%; border-radius: 3px; background: var(--brand-ink); opacity: .9; animation: wave 1.6s ease-in-out infinite; transform-origin: center; }
.wave.small { height: 28px; } .wave.small i { background: var(--brand); }
@keyframes wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* Paydo bo‘lish animatsiyalari */
.reveal { animation: rise .7s var(--ease) both; }
.card.enter { animation: rise .6s var(--ease) both; }
.view:not([hidden]) { animation: fadeIn .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal[open] { animation: pop .35s var(--ease); }
.modal::backdrop { background: rgba(26,34,32,.45); backdrop-filter: blur(3px); animation: fadeIn .3s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.toast { animation: slideIn .4s var(--ease); border-radius: 14px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.plan-item { animation: rise .55s var(--ease) both; }
.plan-item:nth-child(2) { animation-delay: .06s; } .plan-item:nth-child(3) { animation-delay: .12s; } .plan-item:nth-child(4) { animation-delay: .18s; } .plan-item:nth-child(n+5) { animation-delay: .24s; }
.status[data-state="recording"]::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: .45rem; animation: softPulse 2s ease-in-out infinite; }
@keyframes softPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.rec-indicator { animation: softPulse 2s ease-in-out infinite; }
.orb { background: radial-gradient(circle at 35% 35%, var(--accent), var(--brand)); }
.steps li { transition: background .5s var(--ease), opacity .5s var(--ease); }

/* Material boshqaruvi */
.manage-bar { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; padding: .8rem 1rem; margin: .4rem 0 1rem;
  background: color-mix(in srgb, var(--brand) 7%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: var(--radius); }
.material-form .row .field { flex: 1 1 140px; }
.material-form input[type=text], .material-form input[type=url], .material-form textarea, .material-form select { width: 100%; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1.3rem; border: 2px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: var(--radius);
  background: var(--bg-2); cursor: pointer; text-align: center; font-weight: 500; transition: background .3s var(--ease), border-color .3s var(--ease); }
.dropzone:hover, .dropzone.over { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); border-color: var(--brand); }
.file-input:focus-visible + .dropzone { outline: 3px solid var(--accent); outline-offset: 2px; }
.drop-icon { font-size: 1.6rem; color: var(--brand); }
.progress { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-top: .5rem; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .3s var(--ease); }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: #111; margin: .5rem 0; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media { border-radius: var(--radius-sm); }
.audio-card { display: grid; gap: .7rem; justify-items: center; padding: 1rem; background: var(--bg-2); border-radius: var(--radius); margin: .5rem 0; }
.audio-card audio { width: 100%; }
.pdf-card { display: flex; gap: 1rem; align-items: center; padding: 1rem; background: var(--bg-2); border-radius: var(--radius); margin: .5rem 0; }
.pdf-card .row { margin-top: .5rem; }
.pdf-icon { width: 56px; height: 70px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--brand-ink);
  background: linear-gradient(160deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow); flex: none; }

@media (max-width: 900px) { .hero-visual { min-height: 220px; } .breath-ring.r1 { width: 200px; height: 200px; } .breath-ring.r2 { width: 150px; height: 150px; } .breath-core { width: 104px; height: 104px; } }
/* Harakatga sezgir foydalanuvchilar: barcha animatsiyalar o‘chadi */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
