:root {
  --bg: #f6f7fb; --card: #fff; --text: #1b2033; --muted: #6b7280; --line: #e5e7ef;
  --brand: #2f3fb7; --brand-2: #1f2c8f; --accent: #0f9d8a; --warn: #b45309; --danger: #c0392b;
  --radius: 12px; --shadow: 0 1px 2px rgba(20, 25, 60, .06), 0 4px 16px rgba(20, 25, 60, .05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11131c; --card: #1a1d29; --text: #e8eaf2; --muted: #9aa0b4; --line: #2a2e3e;
          --brand: #7d8cff; --brand-2: #6b7bf0; --accent: #34c7b2; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
h1 { font-size: 1.7rem; margin: .3rem 0 .4rem; line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 2rem 0 .7rem; }
h3 { margin: .2rem 0 .4rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .88em; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand); color: #fff; font-family: Georgia, serif; font-style: italic; }
nav { display: flex; align-items: center; gap: 16px; }

.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 9px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: .9em; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; }
.alert { background: #fff7e6; border: 1px solid #f5d38a; color: #6b4a00; border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.alert-error { background: #fdecea; border-color: #f2b8b2; color: #8a1f14; }
@media (prefers-color-scheme: dark) {
  .alert { background: #2d2614; border-color: #5b4a1d; color: #f3d48a; }
  .alert-error { background: #321a18; border-color: #5e2a24; color: #f3aaa2; }
}
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; padding: 48px 0 24px; }
.hero h1 { font-size: 2.3rem; }
.accent { color: var(--brand); }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 560px; }
.formula-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.formula-row code { font-size: 1.05em; }
.grades { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; margin-bottom: 6px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan-days { color: var(--muted); font-weight: 600; }
.plan-price { font-size: 1.6rem; font-weight: 700; margin: 4px 0 8px; }
.plan ul { padding-left: 18px; margin: 0; color: var(--muted); }
.note { margin: 32px 0; }
.note ul { margin: 0; padding-left: 20px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 28px 0 16px; }
.share { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 16px; }
.share code.copy { user-select: all; }
.share > div { min-width: 0; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat-v { font-size: 1.8rem; font-weight: 700; }
.stat-v small { font-size: .55em; color: var(--muted); font-weight: 500; }

.table-card { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: .82em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--bg); }
.row-warn td { background: rgba(245, 158, 11, .08); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .82em; font-weight: 600;
  background: var(--line); color: var(--muted); }
.badge-open { background: rgba(15, 157, 138, .14); color: var(--accent); }
.badge-warn { background: rgba(180, 83, 9, .12); color: var(--warn); }

.g { display: inline-block; min-width: 36px; text-align: center; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: .88em; color: #fff; }
.g-ap { background: #1e7b4f; } .g-a { background: #2c9a63; } .g-bp { background: #2f6fb7; }
.g-b { background: #4b8bd4; } .g-cp { background: #b7791f; } .g-c { background: #d69e2e; }
.g-none { background: var(--line); color: var(--muted); }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 10px; }
.bar { height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 7px; }
.bar-n { text-align: right; font-variant-numeric: tabular-nums; }

.diff { position: relative; display: inline-block; width: 120px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #2c9a63, #d6d9e4 50%, #c0392b); vertical-align: middle; }
.diff-dot { position: absolute; top: -4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--text); }

.form { display: grid; gap: 16px; max-width: 760px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
input[type=text], input:not([type]), textarea, input[type=file] {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text); }
textarea { font-family: ui-monospace, Consolas, monospace; resize: vertical; }
fieldset.fmt { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
fieldset.fmt legend { font-weight: 600; margin-bottom: 6px; }
label.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; cursor: pointer; }
label.radio:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.hint { font-size: .9em; color: var(--muted); display: none; }
pre.key { white-space: pre-wrap; margin: 0; }

.omr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-compact { display: grid; gap: 10px; align-content: start; }
.form-compact h3 { margin: 0; }
.form-compact p { margin: 0; }
.form-compact .btn { justify-self: start; }
.src { margin-right: 4px; }
form.rename { display: inline-flex; gap: 6px; }
form.rename input { padding: 5px 8px; font-size: .9em; min-width: 200px; }
.scan-row { margin-bottom: 10px; border-left: 4px solid var(--accent); }
.scan-warn { border-left-color: var(--warn); }
.scan-bad { border-left-color: var(--danger); }
.scan-line { white-space: pre-wrap; margin: 4px 0 0; font-family: inherit; }
.debug-img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.footer { color: var(--muted); font-size: .85em; padding: 40px 20px; text-align: center; }

.btn { white-space: nowrap; }
@media (max-width: 760px) {
  .hero, .steps, fieldset.fmt, .omr-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .wrap { padding: 0 16px; }
  nav { gap: 10px; }
  .nav-cabinet { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-v { font-size: 1.4rem; }
  .card { padding: 14px 16px; }
}

.method-card { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 16px; }
.radio-inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; cursor: pointer; }

.logo-img { width: 34px; height: 34px; border-radius: 10px; display: block; }

/* Sertifikatni tekshirish sahifasi */
.verify-card { max-width: 620px; margin: 24px auto; text-align: center; }
.verify-card h1 { margin: 6px 0 4px; }
.verify-ico { width: 64px; height: 64px; margin: 4px auto 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 32px; font-weight: 800; color: #fff; background: #c83232; }
.verify-ico.verify-ok { background: #1e7b4f; }
.verify-table { width: 100%; margin: 16px 0 8px; border-collapse: collapse; text-align: left; table-layout: fixed; }
.verify-table th, .verify-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top;
  white-space: normal; overflow-wrap: anywhere; }
.verify-table th { color: var(--muted); font-weight: 500; width: 40%; background: none; font-size: .9em;
  text-transform: none; letter-spacing: 0; }
@media (max-width: 480px) { .verify-card { margin: 8px auto; padding: 16px 12px; } .verify-table th, .verify-table td { padding: 8px 6px; } }

/* Yozuvli logo (sarlavha) */
.logo-wordmark { height: 44px; width: auto; display: block; }
@media (max-width: 480px) { .logo-wordmark { height: 38px; } }
