:root {
  --bg: #fff;
  --text: #000;
  --muted: rgba(0, 0, 0, 0.45);
  --border: rgba(0, 0, 0, 0.12);
  --input-border: #ccc;
  --btn-bg: #fc0;
  --btn-hover: #ffdb4d;
  --accent: #f00;
  --font: Arial, Helvetica, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ——— шапка как у Яндекса: логотип слева, ссылки справа ——— */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover {
  color: var(--text);
}

/* ——— центр страницы ——— */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
  text-align: center;
}

.title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--muted);
  max-width: 420px;
}

/* ——— строка поиска в стиле Яндекса ——— */
.search-form {
  width: min(640px, 100%);
}

.search-form__row {
  display: flex;
  gap: 0;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.search-form__row:focus-within {
  border-color: #ffdb4d;
  box-shadow: 0 0 0 1px #ffdb4d;
}

.search-form__input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: none;
  outline: none;
  font: 16px var(--font);
  background: transparent;
}

.search-form__input::placeholder {
  color: rgba(0, 0, 0, 0.35);
  opacity: 1;
}

.search-form__btn {
  padding: 0 20px;
  border: none;
  background: var(--btn-bg);
  font: 16px var(--font);
  cursor: pointer;
  white-space: nowrap;
}

.search-form__btn:hover:not(:disabled) {
  background: var(--btn-hover);
}

.search-form__btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ——— свёрнутые параметры ——— */
.options {
  margin-top: 12px;
  text-align: left;
  font-size: 14px;
  color: var(--muted);
}

.options summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.options summary::-webkit-details-marker {
  display: none;
}

.options__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.options label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.options input,
.options select {
  padding: 8px 10px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font: 14px var(--font);
  background: #fff;
}

.options__check {
  flex-direction: row !important;
  align-items: center;
  padding-top: 22px;
}

.options__check input {
  width: auto;
}

/* ——— статус и результат ——— */
.status {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.status--error {
  color: #c00;
}

.countdown {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.countdown #countdown-sec {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.result {
  width: min(720px, 100%);
  margin-top: 24px;
}

.result__actions {
  margin-bottom: 12px;
}

.result__download {
  padding: 8px 16px;
  font-size: 14px;
}

.result__image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

.result__pdf {
  display: block;
  width: 100%;
  height: min(70vh, 640px);
  border: 1px solid var(--border);
}

.note {
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ——— SEO-контент ——— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.content-section {
  border-top: 1px solid var(--border);
  padding: 40px 16px;
}

.content-section--alt {
  background: #fafafa;
}

.content-section__inner {
  max-width: 720px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
}

.content-section h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 400;
}

.content-section h3 {
  margin: 24px 0 12px;
  font-size: 17px;
  font-weight: 400;
}

.steps,
.features {
  margin: 0 0 16px;
  padding-left: 20px;
}

.steps li,
.features li {
  margin-bottom: 8px;
}

.code-block {
  margin: 16px 0;
  padding: 14px 16px;
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
}

.code-block code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  word-break: break-all;
}

.faq {
  margin: 0;
}

.faq dt {
  margin-top: 20px;
  font-weight: 600;
  color: var(--text);
}

.faq dt:first-child {
  margin-top: 0;
}

.faq dd {
  margin: 8px 0 0;
  color: var(--muted);
}

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  line-height: 1.6;
}

.legal h1 {
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 12px;
}

.legal h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 12px;
}

.legal p,
.legal ul {
  margin: 0 0 12px;
  color: var(--muted);
}

.legal ul {
  padding-left: 20px;
}

.legal a {
  color: var(--text);
}

.legal pre.code-block {
  margin: 12px 0 16px;
  padding: 14px 16px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.legal pre.code-block code {
  color: var(--text);
  white-space: pre;
}

.guides-teaser {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.guides-teaser a {
  color: var(--text);
}

/* ——— API ——— */
.api {
  max-width: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
  color: var(--muted);
  border-top: none;
}

.api h2 {
  font-size: 22px;
}

.api p {
  margin: 0 0 12px;
}

.api code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

/* ——— подвал ——— */
.footer {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}

.footer__copy {
  color: var(--muted);
}

.feedback-lead {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.feedback-form {
  max-width: 520px;
  display: grid;
  gap: 16px;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 140px;
}

.label-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.feedback-form__actions {
  margin-top: 4px;
}

.feedback-alt {
  margin-top: 28px;
  font-size: 14px;
  color: var(--muted);
}

.docs-link {
  font-weight: 600;
  color: var(--text);
}

/* ——— API docs ——— */
.docs {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.docs h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 400;
}

.docs__lead {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.docs__toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.docs__toc a {
  color: var(--muted);
  text-decoration: none;
}

.docs__toc a:hover,
.docs__toc a[aria-current="page"] {
  color: var(--text);
}

.docs__section {
  margin-bottom: 40px;
}

.docs__section h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 400;
}

.docs__section h3 {
  margin: 24px 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.docs__section p,
.docs__section ul {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.docs__section ul {
  padding-left: 20px;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

.docs__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.docs__table th,
.docs__table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.docs__table th {
  background: #fafafa;
  font-weight: 600;
  color: var(--text);
}

.docs__table td {
  color: var(--muted);
}

.docs__table code {
  font-size: 12px;
  color: var(--text);
}

@media (max-width: 600px) {
  .search-form__row {
    flex-direction: column;
  }

  .search-form__btn {
    padding: 12px;
  }

  .options__grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav {
    flex-wrap: wrap;
    gap: 10px 12px;
    justify-content: flex-end;
  }

  .title {
    font-size: 22px;
  }
}
