/* UzLLM — dizayn: foydalanuvchi bergan uslub (Nunito, #2c2c2c, #0A84FF, 14px radius) asosida */
:root {
  --bg: #2c2c2c;
  --bg-2: #333335;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --gray: rgba(235, 235, 245, 0.6);
  --gray-2: rgba(235, 235, 245, 0.3);
  --line: rgba(84, 84, 88, 0.65);
  --accent: #0A84FF;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --green: #30D158;
  --red: #FF453A;
  --orange: #FF9F0A;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 20px;
  background: #2c2c2c;
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 34px; font-weight: 800; line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.3px; }
h2 { font-size: 24px; font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 19px; font-weight: 800; margin: 0 0 8px; }
p { margin: 0 0 12px; }

.gray { color: rgba(235, 235, 245, 0.6); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.bold { font-weight: 800; }
.mono, code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

a { color: #0A84FF; text-decoration: none; }
a:hover { text-decoration: underline; }

.list { border: 1px solid rgba(84, 84, 88, 0.65); border-radius: 14px; overflow: hidden; background: var(--surface); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(84, 84, 88, 0.65); }
.row:last-child { border-bottom: none; }
.row .label { display: flex; align-items: center; gap: 10px; }

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #0A84FF;
  color: #ffffff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s, transform .05s, opacity .15s;
  text-decoration: none !important;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.auto { width: auto; padding: 10px 18px; }
.btn.sm { width: auto; padding: 7px 12px; font-size: 15px; border-radius: 10px; }
.btn.ghost { background: var(--surface-2); color: #fff; }
.btn.outline { background: transparent; border: 1px solid var(--line); color: #fff; }
.btn.danger { background: rgba(255, 69, 58, .15); color: var(--red); }
.btn svg { width: 18px; height: 18px; }

/* Layout */
.container { max-width: 1120px; margin: 0 auto; }
.narrow { max-width: 440px; margin: 0 auto; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } body { padding: 14px; } h1 { font-size: 30px; } }
.stack > * + * { margin-top: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 24px; } .mt-s { margin-top: 12px; } .mb { margin-bottom: 24px; }
.section { margin-top: 48px; }
.hidden { display: none !important; }

/* Header */
.nav {
  position: sticky; top: 0; z-index: 50; margin: -20px -20px 28px; padding: 12px 20px;
  background: rgba(44, 44, 44, 0.82); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 620px) { .nav { margin: -14px -14px 22px; padding: 10px 14px; } }
.nav-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff !important; font-weight: 800; font-size: 20px; text-decoration: none !important; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #0A84FF, #5E5CE6); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; color: #fff; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a { color: var(--gray); padding: 7px 11px; border-radius: 10px; font-weight: 600; font-size: 15.5px; display: flex; align-items: center; gap: 6px; text-decoration: none; }
.nav-links a svg { width: 17px; height: 17px; }
.nav-links a:hover { color: #fff; background: var(--surface-2); }
.nav-links a.active { color: #fff; background: var(--surface-2); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.balance-pill { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: #fff !important; font-weight: 700; font-size: 15px; text-decoration: none !important; white-space: nowrap; }
.balance-pill svg { width: 16px; height: 16px; color: var(--accent); }
.menu-btn { display: none; background: none; border: none; color: #fff; padding: 6px; cursor: pointer; }
@media (max-width: 980px) {
  .menu-btn { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; padding: 10px 14px 16px; background: rgba(44,44,44,.97); border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-inner { justify-content: space-between; }
}
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #3a3a3c; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; color: #fff; background: none; border: none; border-bottom: 1px solid var(--line); font: inherit; font-size: 15.5px; cursor: pointer; text-align: left; text-decoration: none; }
.dropdown-menu > :last-child { border-bottom: none; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu svg { width: 17px; height: 17px; color: var(--gray); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; color: #fff; cursor: pointer; font-family: inherit; font-size: 15px; }

/* Cards */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); }
.card.hover { transition: border-color .15s, background .15s; }
.card.hover:hover { border-color: rgba(10,132,255,.6); background: var(--surface-2); }
.card-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }
.card-icon svg { width: 22px; height: 22px; }

/* Hero */
.hero { padding: 36px 0 12px; text-align: center; }
.hero h1 { font-size: 46px; max-width: 820px; margin: 0 auto 16px; }
.hero h1 .accent { color: var(--accent); }
.hero p.lead { font-size: 19px; color: var(--gray); max-width: 640px; margin: 0 auto 26px; }
@media (max-width: 620px) { .hero h1 { font-size: 34px; } .hero p.lead { font-size: 17px; } }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--gray); font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.badge svg { width: 15px; height: 15px; color: var(--green); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--gray); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag.blue { background: var(--accent-soft); color: #64B5FF; }
.tag.green { background: rgba(48,209,88,.14); color: var(--green); }
.tag.orange { background: rgba(255,159,10,.14); color: var(--orange); }
.tag.red { background: rgba(255,69,58,.14); color: var(--red); }

/* Model cards */
.model-logo { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex: none; }
.model-logo img { width: 28px; height: 28px; }
.model-logo.sm { width: 32px; height: 32px; border-radius: 9px; } .model-logo.sm img { width: 20px; height: 20px; }
.model-card { display: flex; flex-direction: column; gap: 12px; }
.model-head { display: flex; gap: 12px; align-items: center; }
.model-head .name { font-weight: 800; font-size: 18px; }
.model-id { font-family: ui-monospace, monospace; font-size: 13.5px; color: var(--gray); }
.model-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meta-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.meta-item .k { font-size: 12.5px; color: var(--gray); display: flex; align-items: center; gap: 5px; }
.meta-item .k svg { width: 13px; height: 13px; }
.meta-item .v { font-weight: 700; font-size: 15px; }

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 14px; color: var(--gray); margin-bottom: 6px; font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.18);
  color: #fff; font-family: inherit; font-size: 17px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.45; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input.sm { padding: 8px 10px; font-size: 15px; border-radius: 10px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(120,120,128,.32); border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 24px; height: 24px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Code */
pre.code { position: relative; margin: 0; padding: 16px; background: #1e1e1e; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; font-size: 14px; line-height: 1.55; color: #e6e6e6; }
code.inline { background: var(--surface-2); padding: 2px 7px; border-radius: 7px; font-size: 14.5px; }
.copy-btn { position: absolute; top: 8px; right: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--gray); border-radius: 8px; padding: 5px 8px; cursor: pointer; display: flex; align-items: center; gap: 5px; font-family: inherit; font-size: 13px; }
.copy-btn:hover { color: #fff; }
.copy-btn svg { width: 14px; height: 14px; }
.tok-k { color: #FF7AB2; } .tok-s { color: #FC6A5D; } .tok-c { color: #6C7986; } .tok-n { color: #D0BF69; } .tok-f { color: #67B7A4; }
.tabs { display: flex; gap: 4px; padding: 4px; background: rgba(118,118,128,.18); border-radius: 11px; width: fit-content; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { background: none; border: none; color: var(--gray); padding: 6px 14px; border-radius: 8px; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button.active { background: #636366; color: #fff; }

/* Tables */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--gray); font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: .3px; background: var(--surface); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Toast */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #48484a; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15.5px; animation: up .2s ease; }
.toast svg { width: 18px; height: 18px; }
.toast.ok svg { color: var(--green); } .toast.err svg { color: var(--red); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: #3a3a3c; border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
@keyframes fade { from { opacity: 0; } }

/* Alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert.blue { background: var(--accent-soft); border-color: rgba(10,132,255,.35); } .alert.blue svg { color: var(--accent); }
.alert.green { background: rgba(48,209,88,.1); border-color: rgba(48,209,88,.3); } .alert.green svg { color: var(--green); }
.alert.orange { background: rgba(255,159,10,.1); border-color: rgba(255,159,10,.3); } .alert.orange svg { color: var(--orange); }

/* Playground */
.pg { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .pg { grid-template-columns: 1fr; } }
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 460px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 85%; padding: 11px 15px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--accent); border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: #3a3a3c; border-bottom-left-radius: 6px; }
.msg.err { align-self: center; background: rgba(255,69,58,.15); color: var(--red); font-size: 15px; }
.msg-meta { font-size: 12.5px; color: var(--gray); align-self: flex-start; margin-top: -8px; padding-left: 6px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea { flex: 1; min-height: 48px; max-height: 200px; resize: none; }
.chat-input .btn { width: 48px; height: 48px; padding: 0; flex: none; }
.empty { text-align: center; color: var(--gray); margin: auto; padding: 30px; }
.empty svg { width: 40px; height: 40px; color: var(--gray-2); margin-bottom: 8px; }
.img-result { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #1e1e1e; aspect-ratio: 1; display: grid; place-items: center; }
.img-result img { width: 100%; height: 100%; object-fit: contain; display: block; }
.spinner { width: 22px; height: 22px; border: 2.5px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.typing::after { content: '▍'; animation: blink 1s infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* Docs */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.docs-nav { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 2px; }
.docs-nav a { color: var(--gray); padding: 7px 10px; border-radius: 9px; font-weight: 600; font-size: 15.5px; }
.docs-nav a:hover { background: var(--surface-2); color: #fff; text-decoration: none; }
.docs section { margin-bottom: 40px; scroll-margin-top: 90px; }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.endpoint { display: flex; align-items: center; gap: 10px; font-family: ui-monospace, monospace; font-size: 15px; margin-bottom: 10px; }
.method { padding: 3px 9px; border-radius: 7px; font-weight: 800; font-size: 13px; }
.method.get { background: rgba(48,209,88,.15); color: var(--green); } .method.post { background: var(--accent-soft); color: #64B5FF; }

/* Stat */
.stat .k { color: var(--gray); font-size: 14px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.stat .k svg { width: 16px; height: 16px; }
.stat .v { font-size: 30px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.big-balance { font-size: 44px; font-weight: 800; letter-spacing: -0.5px; }

footer.footer { max-width: 1120px; margin: 64px auto 0; padding: 22px 0 6px; border-top: 1px solid var(--line); color: var(--gray); font-size: 14.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.footer a { color: var(--gray); } footer.footer a:hover { color: #fff; }
.tg-btn { background: #229ED9 !important; }
svg.lucide { stroke-width: 2; }
