/* ============ Ilmiy Yordamchi — uslublar ============ */
:root {
  --ink: #1f3a5f;
  --ink-2: #2c5282;
  --ink-soft: #e6ecf4;
  --paper: #f7f3ea;
  --paper-2: #efe8d8;
  --card: #ffffff;
  --text: #23262b;
  --muted: #646b76;
  --line: #e2dccd;
  --accent: #b5562e;
  --ok: #2f7d4f;
  --ok-bg: #e5f3ea;
  --warn: #9a6a00;
  --warn-bg: #fbf1d6;
  --bad: #b23b3b;
  --bad-bg: #f9e3e3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 58, 95, .06), 0 4px 18px rgba(31, 58, 95, .05);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.6 var(--sans); color: var(--text); background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--ink-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
code { background: var(--paper-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 28px; padding-bottom: 56px; }
.narrow { max-width: 520px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.15rem; font-weight: 650; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: Georgia, serif; font-size: 1.1rem; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .94rem; }
.nav a:hover { background: var(--ink-soft); text-decoration: none; }
.nav a.on { color: var(--ink); background: var(--ink-soft); }
.nav a.btn { color: #fff; }
.nav-user { display: inline-flex; align-items: center; gap: 8px; }
.quota { background: var(--ink); color: #fff; font-size: .75rem; padding: 1px 8px; border-radius: 99px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ---------- Tugmalar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--ink); color: #fff; border: 1px solid var(--ink); padding: 10px 18px; border-radius: 8px; font: 600 .95rem var(--sans); cursor: pointer; transition: background .15s, transform .05s; text-decoration: none !important; }
.btn:hover { background: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink-soft); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #962f2f; }
.btn-sm { padding: 6px 12px; font-size: .86rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.muted-inv { opacity: .7; font-weight: 400; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; font-size: .86rem; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 10px; border-radius: 6px; }
.icon-btn:hover { background: var(--bad-bg); color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kartalar, formalar ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
.form .lbl { display: block; }
.req { color: var(--accent); font-style: normal; }
input, select, textarea { width: 100%; font: 400 .95rem/1.5 var(--sans); color: var(--text); background: #fff; border: 1px solid #d6cfbf; border-radius: 8px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(44, 82, 130, .14); }
input[disabled] { background: var(--paper); color: var(--muted); }
input[type=checkbox] { width: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
input[type=file] { padding: 7px; background: var(--paper); }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px !important; font-weight: 400 !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gap { gap: 20px; }
.grid2.gap > .card { margin-bottom: 0; }
.grid2.gap { margin-bottom: 20px; }
.upload-row { display: flex; justify-content: space-between; align-items: center; margin-top: -2px; }

/* ---------- Xabarlar ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; font-size: .94rem; border: 1px solid transparent; }
.landing > .alert { max-width: 1140px; margin: 16px auto; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #c7e5d2; }
.alert-error { background: var(--bad-bg); color: var(--bad); border-color: #f0c9c9; }
.alert-info { background: var(--ink-soft); color: var(--ink); border-color: #cdd8e7; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--warn-bg); border: 1px solid #efdca8; color: #5f4500; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 22px; }
.notice.ok { background: var(--ok-bg); border-color: #c7e5d2; color: #1d5a37; }
.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-muted { background: var(--paper-2); color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; transition: .25s; z-index: 50; font-size: .92rem; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Auth ---------- */
.auth { max-width: 500px; margin: 20px auto; }
.auth .card { padding: 32px; }

/* ---------- Sahifa sarlavhasi ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.center-head { text-align: center; max-width: 620px; margin: 0 auto 30px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: .9rem; }

/* ---------- Asboblar ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 26px; }
.tool-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.tool-card:hover { border-color: var(--ink-2); transform: translateY(-2px); box-shadow: 0 8px 26px rgba(31,58,95,.09); text-decoration: none; }
.tool-card h3 { margin: 14px 0 6px; }
.tool-card p { color: var(--muted); font-size: .9rem; margin: 0; }
.tool-ico { width: 42px; height: 42px; border-radius: 10px; background: var(--ink-soft); color: var(--ink); display: grid; place-items: center; flex-shrink: 0; }
.ico { width: 22px; height: 22px; }

.tool-layout { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 20px; align-items: start; }
.tool-layout .card { margin-bottom: 0; }
.tool-form { align-self: start; }
.tool-title { display: flex; gap: 14px; margin-bottom: 18px; }
.tool-title h1 { font-size: 1.35rem; margin: 0 0 4px; }
.tool-title p { margin: 0; font-size: .88rem; }
.tool-output { min-height: 520px; display: flex; flex-direction: column; padding: 0; }
.tool-output.single { min-height: 0; }
.out-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.out-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.out-status { font-size: .9rem; }
.out-status.live { color: var(--ink-2); }
.out-status.live::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: pulse 1s infinite; }
.out-status.ok { color: var(--ok); }
.out-status.bad { color: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }
.out { padding: 28px 32px; flex: 1; }
.empty { color: var(--muted); max-width: 440px; margin: 80px auto; text-align: center; }
.thinking { display: flex; gap: 6px; justify-content: center; padding: 80px 0; }
.thinking span { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); animation: bounce 1.2s infinite ease-in-out; }
.thinking span:nth-child(2) { animation-delay: .15s; }
.thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* Natija matni */
.prose { font-size: 1rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose h1 { font-size: 1.6rem; margin-top: 0; }
.prose h2 { font-size: 1.25rem; margin-top: 1.6em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .3em; }
.prose blockquote { margin: 0 0 1em; padding: 8px 16px; border-left: 3px solid var(--accent); background: var(--paper); color: #4a4f57; border-radius: 0 6px 6px 0; }
.prose blockquote p { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--paper); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose code { white-space: pre-wrap; }
.narrow-prose { max-width: 780px; margin-left: auto; margin-right: auto; padding: 32px 40px; }

/* ---------- Ro'yxatlar ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--text); }
.list a:hover { text-decoration: none; background: var(--paper); }
.list-row { display: flex; align-items: center; }
.list-row > a { flex: 1; min-width: 0; }
.list-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: .74rem; font-weight: 600; background: var(--ink-soft); color: var(--ink); padding: 2px 9px; border-radius: 6px; white-space: nowrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: .88rem; }
.chip:hover { text-decoration: none; border-color: var(--ink-2); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .dot { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .74rem; margin-left: 4px; }
.search input { min-width: 260px; }
.search.wide { margin-bottom: 16px; }
.search.wide input { max-width: 420px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.pager a { padding: 4px 11px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); }
.pager a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--paper); }

/* ---------- Tariflar ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 36px; }
.plan { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.plan h3 { font-size: 1.2rem; margin-bottom: 8px; }
.plan .btn { margin-top: auto; }
.plan p { margin-top: 12px; }
.plan-hl { border: 2px solid var(--ink); }
.plan-flag { position: absolute; top: -12px; left: 24px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.price { font-family: var(--serif); font-size: 1.9rem; font-weight: 650; color: var(--ink); line-height: 1.2; margin-bottom: 4px; }
.plan-feat { list-style: none; padding: 0; margin: 16px 0; }
.plan-feat li { padding: 5px 0 5px 24px; position: relative; font-size: .93rem; }
.plan-feat li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 11px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.faq h3 { margin-top: 1.4em; }

.pay-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.pay-summary { position: sticky; top: 82px; }
.pay-summary h2 { margin: 4px 0 10px; }
.pay-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.pay-click { background: #0d6ef6; border-color: #0d6ef6; }
.pay-payme { background: #00b4c4; border-color: #00b4c4; }
.pay-steps { padding-left: 1.2em; margin: 0 0 20px; }
.pay-steps li { margin-bottom: 12px; }
.card-num { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; padding: 12px 16px; background: var(--paper); border: 1px dashed #cfc5ad; border-radius: 8px; }
.card-num span { font: 600 1.25rem/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .06em; color: var(--ink); }
.sub-card { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.sub-card p { margin: 0; flex: 1; }
.sub-stats { display: flex; gap: 32px; flex: 1; }
.stat { font-family: var(--serif); font-size: 1.6rem; font-weight: 650; color: var(--ink); line-height: 1.2; }

/* ---------- Admin ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { margin: 0; padding: 18px 20px; }
.stat-card .stat { font-size: 1.35rem; margin-top: 4px; }
.bar-row { display: grid; grid-template-columns: 100px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .9rem; }
.bar { height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink-2); border-radius: 99px; }
.pay-item { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 18px 22px; }
.pay-item-main { display: grid; gap: 4px; flex: 1; min-width: 260px; }
.pay-item-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.reject { display: flex; gap: 6px; }
.reject input { padding: 5px 10px; font-size: .86rem; width: 180px; }
.plans-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.plans-admin .card { margin: 0; }
.narrow-form { max-width: 680px; }
.narrow-form h2 { margin-top: 10px; }
.small-chips .chip { padding: 4px 12px; font-size: .84rem; }

/* ---------- Bosh sahifa ---------- */
.hero { background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08; margin-bottom: 20px; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.lead { font-size: 1.12rem; color: #4a4f57; max-width: 540px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-paper { position: relative; height: 340px; }
.paper { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 50px rgba(31,58,95,.14); padding: 22px 24px; width: 300px; }
.paper:first-child { right: 30px; top: 10px; z-index: 2; transform: rotate(1.5deg); }
.paper-2 { right: 110px; top: 210px; transform: rotate(-3deg); width: 240px; }
.paper-tag { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.paper-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.paper-row b { color: var(--ink); font-family: var(--serif); }
.paper-row b.warn { color: var(--accent); }
.paper-note { margin-top: 14px; font-size: .82rem; background: var(--warn-bg); color: #6b4d00; padding: 8px 10px; border-radius: 6px; }
.paper-line { height: 9px; border-radius: 4px; background: var(--ink-soft); margin-bottom: 10px; }
.w80 { width: 80%; } .w60 { width: 60%; } .w70 { width: 70%; }
.section { padding-top: 64px; padding-bottom: 64px; }
.section-title { font-size: 1.9rem; margin-bottom: 28px; }
.tool-card.static { box-shadow: var(--shadow); }
.band { background: var(--ink); color: #dbe3ee; }
.band .section-title { color: #fff; }
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: s; }
.steps-list li { counter-increment: s; display: flex; flex-direction: column; gap: 6px; }
.steps-list li::before { content: counter(s); font-family: var(--serif); font-size: 2.2rem; color: #e9a27f; line-height: 1; margin-bottom: 6px; }
.steps-list b { color: #fff; font-size: 1.05rem; }
.steps-list span { font-size: .93rem; }
.integrity-box { max-width: 820px; margin: 0 auto; border-left: 4px solid var(--accent); padding: 8px 0 8px 28px; }
.integrity-box p { font-size: 1.05rem; color: #3e434b; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--card); padding: 28px 0 22px; margin-top: 20px; }
.footer-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-in p { margin: 4px 0 0; font-size: .9rem; }
.footer-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; font-size: .9rem; }

/* ---------- Moslashuvchanlik ---------- */
@media (max-width: 960px) {
  .tool-layout, .pay-layout { grid-template-columns: 1fr; }
  .tool-form, .pay-summary { position: static; max-height: none; }
  .hero-in { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 48px; }
  .hero-paper { display: none; }
  .steps-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 62px; background: var(--card); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; box-shadow: 0 10px 20px rgba(0,0,0,.06); }
  .nav-open .nav { display: flex; }
  .nav a { padding: 11px 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .out { padding: 20px 18px; }
  .out-bar { padding: 12px 18px; }
  .narrow-prose { padding: 22px 20px; }
  .wrap { padding: 0 16px; }
  .steps-list { grid-template-columns: 1fr; }
  .notice { flex-direction: column; align-items: flex-start; }
  .search input { min-width: 0; }
  .pay-item-side { align-items: stretch; width: 100%; }
  .reject input { width: auto; flex: 1; }
  h1 { font-size: 1.5rem; }
  .section { padding-top: 44px; padding-bottom: 44px; }
}
