/* Minimal texnik uslublar: faqat joylashuv, jadval chegaralari va o'qish qulayligi. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  color: #111;
  background: #fff;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 8px;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.3rem;
  margin-top: 24px;
}

h3 {
  font-size: 1.08rem;
  margin-top: 18px;
}

p,
ol,
ul {
  margin: 8px 0;
}

li {
  margin: 0 0 10px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 0;
  margin: 12px 0;
  border-top: 1px solid #777;
  border-bottom: 1px solid #777;
}

nav a {
  color: #0645ad;
}

nav a[aria-current="page"] {
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

.k-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px;
  margin: 12px 0;
  border: 1px solid #999;
}

.k-control input {
  width: 4.5rem;
  padding: 4px;
  text-align: center;
  font: inherit;
}

section {
  margin: 24px 0;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  margin: 12px 0;
}

caption {
  padding: 0 0 6px;
  text-align: left;
  font-weight: 700;
}

th,
td {
  border: 1px solid #444;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f0f0;
}

tbody th {
  font-weight: 600;
}

pre {
  max-width: 100%;
  padding: 10px;
  overflow-x: auto;
  border: 1px solid #555;
  background: #f7f7f7;
}

code,
kbd {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

pre code {
  overflow-wrap: normal;
  font-size: 0.9rem;
}

.terminal-output {
  min-height: 9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #f2f2f2;
  background: #111;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 8px 0;
}

button {
  padding: 6px 12px;
  font: inherit;
  color: #111;
  background-color: #e9e9e9;
  cursor: pointer;
}

button:hover {
  background-color: #ddd;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid #0645ad;
  outline-offset: 2px;
}

input,
select {
  max-width: 100%;
  padding: 5px 7px;
  font: inherit;
  color: #111;
  background-color: #fff;
}

input[aria-invalid="true"] {
  border: 1px solid #a00000;
  background-color: #fff5f5;
}

.demo-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin: 12px 0;
}

.demo-form label {
  display: block;
  margin-bottom: 2px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-row input {
  width: 10rem;
}

.test-block {
  padding: 10px;
  margin: 16px 0;
  border: 1px solid #555;
  background: #fafafa;
}

.test-block h3 {
  margin-top: 0;
}

details {
  padding: 8px;
  margin: 10px 0;
  border: 1px solid #777;
}

summary {
  font-weight: 700;
  cursor: pointer;
}

details p {
  margin: 8px 0 0;
}

.hint {
  color: #444;
  font-size: 0.9rem;
}

footer {
  padding-top: 8px;
  margin-top: 24px;
  border-top: 1px solid #777;
  font-size: 0.9rem;
}

[hidden] {
  display: none !important;
}

/* Print/PDF: navigatsiya, tugmalar va demo formani yashiramiz. */
@media print {
  html {
    scroll-behavior: auto;
  }

  body {
    max-width: none;
    padding: 0;
    color: #000;
    background: #fff;
    font-size: 10.5pt;
  }

  nav,
  .k-control,
  .copy-row,
  .demo-form,
  .hint,
  button {
    display: none !important;
  }

  section {
    break-inside: avoid;
  }

  details,
  .test-block,
  table tr {
    break-inside: avoid;
  }

  #kod,
  #kod pre {
    break-inside: auto;
  }

  pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border-color: #000;
    background: #f7f7f7;
  }

  .terminal-output {
    color: #f2f2f2;
    background: #111;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
