:root {
  --ink: #17212b;
  --muted: #5f6f7e;
  --line: #d8e0e8;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --paper: #fff;
  --soft: #f6f9fb;
  --code: #eef3f6;
  --warn: #fff7ed;
  --ok: #eefbf3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #edf2f6;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.58;
}

header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 28px 20px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 56px;
}

h1 { margin: 0; font-size: 34px; line-height: 1.12; }
h2 { margin: 34px 0 12px; font-size: 25px; }
h3 { margin: 24px 0 8px; font-size: 20px; }
h4 { margin: 18px 0 6px; font-size: 17px; }
p { margin: 8px 0; }
a { color: var(--accent-dark); font-weight: 800; }

.app-language-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(23, 33, 43, .08);
}

.app-language-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.app-language-bar a {
  min-width: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-weight: 900;
}

.app-language-bar a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.doc-nav a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--soft);
  text-decoration: none;
}

.doc-language-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.doc-language-switch strong {
  margin-right: 4px;
}

.doc-language-switch button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.doc-language-switch button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.doc-lang-panel[hidden] {
  display: none !important;
}

.doc-lang-panel {
  margin-top: 16px;
}

section, .panel {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--paper);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

.card strong, .card span { display: block; }
.card span { color: var(--muted); font-size: 13px; font-weight: 800; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  background: var(--paper);
}

th, td {
  border: 1px solid var(--line);
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

th { background: var(--soft); }
code { background: var(--code); padding: 2px 5px; border-radius: 4px; }
ul, ol { padding-left: 24px; }
li { margin: 5px 0; }

.tutorial {
  border-left: 4px solid var(--accent);
  background: #f2fbfa;
}

.warning {
  border-left: 4px solid #d97706;
  background: var(--warn);
}

.ok {
  border-left: 4px solid #149447;
  background: var(--ok);
}

.screenshot-note {
  border: 1px dashed #9fb2c3;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
  color: var(--muted);
  font-weight: 700;
}

.doc-screenshot {
  margin: 16px 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 16px 30px rgba(23, 33, 43, .10);
}

.doc-screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.doc-screenshot figcaption {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.field-code {
  white-space: nowrap;
  font-weight: 900;
}

.error-code {
  color: #991b1b;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
}

.doc-toc {
  columns: 2;
  column-gap: 28px;
}

.doc-toc li {
  break-inside: avoid;
}

.small { color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
  h1 { font-size: 28px; }
  .grid { grid-template-columns: 1fr; }
  table { font-size: 14px; }
  .doc-toc { columns: 1; }
}
