/* Qaymoq + matte yashil palitra: yaltiroqsiz, yumshoq, gradientsiz */
:root {
  --bg: #fcfaf5; --panel: #ffffff; --panel-2: #f5f0e5; --line: #ebe4d4;
  --text: #2a2f27; --muted: #6e7064; --accent: #4f6b52; --accent-ink: #ffffff;
  --accent-soft: #e8ede1;
  --red: #a6493b; --red-bg: #f1dcd3; --green: #4f6b52; --green-bg: #dfe5d6; --amber: #9a6a2f; --amber-bg: #f0e2c8;
  --shadow: 0 1px 0 rgba(60,55,40,.05);
  --radius: 14px; color-scheme: light;
}
/* Tizim tungi rejimda bo'lsa ham oq-qaymoq fon qoladi; to'q rang faqat data-theme="dark" bilan */
:root[data-theme="dark"] {
  --bg: #1c201b; --panel: #252a24; --panel-2: #2e342c; --line: #3a4137;
  --text: #ece5d5; --muted: #a8a594; --accent: #8fa889; --accent-ink: #1c201b;
  --accent-soft: #33402f;
  --red: #d9897a; --red-bg: #3d2722; --green: #9cb894; --green-bg: #2c3829; --amber: #d6aa6c; --amber-bg: #3a3020;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--accent); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--text); text-decoration: none; }
.brand b { color: var(--accent); }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent) center/18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8f4ea' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E"); display: inline-block; }
main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 80px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.93); }
.btn.danger { color: var(--red); }
.btn.big { padding: 14px 20px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=password], input[type=search], textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
label.f { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
label.f span.muted { font-weight: 400; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; }
.list { display: grid; gap: 10px; }
.mcard { display: grid; gap: 4px; text-decoration: none; color: inherit; }
.mcard:hover { border-color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.pill.rec { background: var(--red-bg); color: var(--red); }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.wait { background: var(--amber-bg); color: var(--amber); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.rec .dot { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.empty { text-align: center; padding: 48px 16px; }

/* jonli majlis */
.live { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.live > * { min-width: 0; }
.video { width: 100%; aspect-ratio: 4/3; background: #000; border-radius: 10px; object-fit: cover; display: block; }
.meter { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--green); transition: width .1s; }
.timer { font-variant-numeric: tabular-nums; font-size: 32px; font-weight: 700; letter-spacing: .5px; }
.banner { padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.banner.err { background: var(--red-bg); color: var(--red); }
.banner.warn { background: var(--amber-bg); color: var(--amber); }
.transcript { max-height: calc(100vh - 210px); min-height: 300px; overflow-y: auto; display: grid; gap: 10px; align-content: start; padding-right: 4px; }
.line { display: grid; grid-template-columns: 56px 1fr; gap: 8px; }
.line time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.line b { display: block; font-size: 13px; }
.qa { display: grid; gap: 10px; }
.qa .q { font-weight: 600; }
.qa .a { background: var(--accent-soft); padding: 10px 12px; border-radius: 10px; }

/* hisobot */
.report { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.report > * { min-width: 0; }
.sec ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.prio-yuqori { color: var(--red); font-weight: 600; }
.bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.sec h2, .card > h2 { color: var(--accent); }
.score { font-size: 28px; font-weight: 700; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.scroll-x { overflow-x: auto; }
/* jonli rejim */
.live-card.on { border-color: var(--accent); background: var(--accent-soft); }
.live-caption { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
/* bosh sahifa */
.start { max-width: 680px; margin: 24px auto 0; text-align: center; display: grid; gap: 14px; padding: 32px 24px; }
.start-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; background: var(--accent) center/34px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E"); }
.start p { margin: 0 auto; max-width: 520px; }
.start-row { flex-wrap: nowrap; }
.start-row input { flex: 1; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
button.mcard { text-align: left; font: inherit; color: inherit; cursor: pointer; }
details > summary { cursor: pointer; }
details[open] > summary { margin-bottom: 12px; }
/* hisobot / xodimlar */
.report { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.report > * { min-width: 0; }
table.tasks select { min-width: 150px; padding: 6px 8px; }
.nowrap { white-space: nowrap; }
.small-btn { padding: 5px 10px; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; box-shadow: none; flex-wrap: wrap; }
.line b { display: block; font-size: 13px; color: var(--accent); }
/* vazifalar xodim bo'yicha */
.tgroup + .tgroup { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tgroup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tgroup-head .pill { margin-left: auto; }
.tgroup ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.tgroup select { padding: 2px 6px; font-size: 12px; width: auto; }
.deadline { color: var(--amber); font-size: 13px; font-weight: 600; white-space: nowrap; }
/* 3D Kilua */
.orb-wrap { position: relative; height: 280px; margin: -6px -6px 0; border-radius: 12px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, var(--accent-soft) 0%, transparent 70%); }
.orb-wrap canvas { width: 100%; height: 100%; display: block; }
.live-card.on .orb-wrap { background: radial-gradient(ellipse at 50% 55%, #dfead3 0%, transparent 72%); }
/* majlis sahifasi paydo bo'lishi */
.live > *, .live + details { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.live > *:nth-child(2) { animation-delay: .12s; }
.live + details { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .live > *, .live + details { animation: none; } }
/* chaqiruv so'zi */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.wake-heard[hidden] { display: none; }
.wake-heard { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; }

@media (max-width: 820px) { .live, .report { grid-template-columns: 1fr; } .transcript { max-height: 60vh; } .start-row { flex-wrap: wrap; } .start-row .btn { width: 100%; justify-content: center; } }
@media print {
  .top, .noprint, #toast { display: none !important; }
  body { background: #fff; color: #000; } .report { grid-template-columns: 1fr; } .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
