/* Добавлено X-WORLD (X-Table, 2026): файла нет в исходном GridCraft. */
/* X-Table manual — shared stylesheet for every language version (ru.html, en.html, zh.html …).
   Self-contained: no external fonts, images or scripts. Colours are tokens on :root;
   the dark theme is the default, the light theme follows prefers-color-scheme,
   and [data-theme="light"] / [data-theme="dark"] on <html> override both. */

:root {
  --bg: #04070b;
  --panel: #0b1420;
  --panel-2: #0f1b2b;
  --line: rgba(160, 190, 220, .18);
  --fg: #e8f1fb;
  --muted: #8ea3bd;
  --accent: #62e08d;
  --accent-2: #62e08d;
  --accent-soft: rgba(98, 224, 141, .12);
  --on-accent: #04170c;
  --code-bg: rgba(160, 190, 220, .08);
  --warn: #f2c14e;
  --warn-soft: rgba(242, 193, 78, .10);
  --tip-soft: rgba(98, 224, 141, .08);
  --header-bg: rgba(4, 7, 11, .82);
  --hero: linear-gradient(120deg, rgba(18, 48, 86, .85) 0%, rgba(11, 20, 32, .95) 55%, rgba(26, 64, 52, .55) 100%);
  --page-bg: radial-gradient(ellipse at 50% -10%, #123056 0%, var(--bg) 60%);
  --logo-filter: none;
  --xt-logo-dark: none; --xt-logo-white: block;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .25);
  --radius: 10px;
  --radius-sm: 8px;
  --header-h: 60px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef1fb;
    --panel: #ffffff;
    --panel-2: #f6f7fd;
    --line: rgba(20, 40, 70, .14);
    --fg: #0d1b2a;
    --muted: #5a6b80;
    --accent: #7c4dff;
    --accent-2: #1f9d55;
    --accent-soft: rgba(124, 77, 255, .10);
    --on-accent: #ffffff;
    --code-bg: rgba(20, 40, 70, .06);
    --warn: #a86a00;
    --warn-soft: rgba(242, 166, 30, .12);
    --tip-soft: rgba(31, 157, 85, .09);
    --header-bg: rgba(238, 241, 251, .86);
    --hero: linear-gradient(120deg, #e6dcff 0%, #fbe0f0 50%, #dbe8ff 100%);
    --page-bg: var(--bg);
    --logo-filter: invert(1) brightness(.12);
    --xt-logo-dark: block; --xt-logo-white: none;
    --shadow: 0 1px 2px rgba(20, 40, 70, .06), 0 8px 24px rgba(60, 50, 140, .07);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #eef1fb;
  --panel: #ffffff;
  --panel-2: #f6f7fd;
  --line: rgba(20, 40, 70, .14);
  --fg: #0d1b2a;
  --muted: #5a6b80;
  --accent: #7c4dff;
  --accent-2: #1f9d55;
  --accent-soft: rgba(124, 77, 255, .10);
  --on-accent: #ffffff;
  --code-bg: rgba(20, 40, 70, .06);
  --warn: #a86a00;
  --warn-soft: rgba(242, 166, 30, .12);
  --tip-soft: rgba(31, 157, 85, .09);
  --header-bg: rgba(238, 241, 251, .86);
  --hero: linear-gradient(120deg, #e6dcff 0%, #fbe0f0 50%, #dbe8ff 100%);
  --page-bg: var(--bg);
  --logo-filter: invert(1) brightness(.12);
  --xt-logo-dark: block; --xt-logo-white: none;
  --shadow: 0 1px 2px rgba(20, 40, 70, .06), 0 8px 24px rgba(60, 50, 140, .07);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #04070b;
  --panel: #0b1420;
  --panel-2: #0f1b2b;
  --line: rgba(160, 190, 220, .18);
  --fg: #e8f1fb;
  --muted: #8ea3bd;
  --accent: #62e08d;
  --accent-2: #62e08d;
  --accent-soft: rgba(98, 224, 141, .12);
  --on-accent: #04170c;
  --code-bg: rgba(160, 190, 220, .08);
  --warn: #f2c14e;
  --warn-soft: rgba(242, 193, 78, .10);
  --tip-soft: rgba(98, 224, 141, .08);
  --header-bg: rgba(4, 7, 11, .82);
  --hero: linear-gradient(120deg, rgba(18, 48, 86, .85) 0%, rgba(11, 20, 32, .95) 55%, rgba(26, 64, 52, .55) 100%);
  --page-bg: radial-gradient(ellipse at 50% -10%, #123056 0%, var(--bg) 60%);
  --logo-filter: none;
  --xt-logo-dark: none; --xt-logo-white: block;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--page-bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--fg);
  font-family: "Golos Text", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

[dir="rtl"] body { text-align: right; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 700; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0 0 .9em; padding-inline-start: 1.3em; }
li { margin: .2em 0; }
b, strong { font-weight: 650; }

code, kbd, .kbd {
  font-family: ui-monospace, "Cascadia Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  font-size: .88em;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .05em .35em;
  white-space: nowrap;
}

code.wrap, pre code { white-space: pre-wrap; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: .02em .42em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--fg);
  text-align: center;
  white-space: nowrap;
  line-height: 1.45;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
}
.skip:focus { left: 16px; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px 18px;
  flex-wrap: wrap;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--fg);
  text-decoration: none;
}

/* X-Table product logo in the header: the dark wordmark on the light theme, the white one on the
   dark theme. The X keeps its blue-violet gradient in both. */
.product-logo {
  display: block;
  height: 34px;
  width: auto;
}
.product-logo.for-light { display: var(--xt-logo-dark); }
.product-logo.for-dark { display: var(--xt-logo-white); }

/* X-WORLD company logo: white artwork, darkened on the light theme. Used small, as the owner mark. */
.logo {
  display: block;
  height: 14px;
  width: auto;
  filter: var(--logo-filter);
}

.site-title {
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
  padding-inline-start: 14px;
  border-inline-start: 1px solid var(--line);
}

.header-tools {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lang {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
  min-width: 0;
}

.lang li { margin: 0; flex: 0 0 auto; }

.lang a {
  display: block;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.lang a:hover { color: var(--fg); border-color: var(--line); }

.lang a[aria-current="page"] {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle {
  flex: 0 0 auto;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
}

.theme-toggle:hover { border-color: var(--accent); }

/* The toggle names the theme it switches to; the text lives in the HTML. */
.theme-toggle .to-dark { display: none; }
.theme-toggle .to-light { display: inline; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .to-dark { display: inline; }
  :root:not([data-theme="dark"]) .theme-toggle .to-light { display: none; }
}
:root[data-theme="light"] .theme-toggle .to-dark { display: inline; }
:root[data-theme="light"] .theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline; }

/* ---------------------------------------------------------------- layout */

.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  padding: 14px 10px 14px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
}

.toc-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px 6px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.toc li { margin: 0; }

.toc a {
  display: block;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border-inline-start: 2px solid transparent;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover { background: var(--accent-soft); border-inline-start-color: var(--accent); }

.toc .sub a { padding-inline-start: 20px; font-size: 13px; color: var(--muted); }
.toc .sub a:hover { color: var(--fg); }

main { min-width: 0; }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
  margin: 0 0 22px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.card > h2 {
  font-size: 24px;
  margin: 0 0 14px;
  padding-inline-start: 14px;
  border-inline-start: 4px solid var(--accent);
}

.card h3 {
  font-size: 18px;
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.card h4 { font-size: 16px; margin: 18px 0 8px; }

.card > :last-child { margin-bottom: 0; }

.lead { font-size: 17px; color: var(--fg); }
.muted { color: var(--muted); }

.hero {
  background: var(--hero);
  border-color: var(--line);
}

.hero h1 {
  font-size: 32px;
  margin: 0 0 6px;
}

.hero .subtitle {
  font-size: 17px;
  color: var(--muted);
  margin: 0 0 18px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  margin: 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.facts b { display: block; margin-bottom: 2px; }

/* A path through the interface: Файл › Экспорт. */
.path { font-weight: 600; }

/* ---------------------------------------------------------------- button lists */

dl.items { margin: 0 0 12px; }

dl.items > div {
  display: grid;
  grid-template-columns: minmax(170px, 250px) minmax(0, 1fr);
  gap: 4px 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

dl.items > div:last-child { border-bottom: 0; }

dl.items dt { font-weight: 650; }
dl.items dt kbd { font-weight: 400; margin-top: 4px; }
dl.items dt .alt { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
dl.items dd { margin: 0; }
dl.items dd ul { margin: 6px 0 0; }
dl.items dd p:last-child { margin-bottom: 0; }

.group-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 4px;
}

/* ---------------------------------------------------------------- notes */

.note, .warn {
  margin: 14px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent-2);
  border-radius: var(--radius-sm);
  background: var(--tip-soft);
}

.warn {
  border-inline-start-color: var(--warn);
  background: var(--warn-soft);
}

.note > :last-child, .warn > :last-child { margin-bottom: 0; }
.note b:first-child, .warn b:first-child { margin-inline-end: 4px; }

/* ---------------------------------------------------------------- tables */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

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

thead th {
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--accent-soft); }

td code { white-space: nowrap; }
table.functions td:first-child { font-weight: 650; white-space: nowrap; }
table.functions td:last-child code { white-space: pre-wrap; word-break: break-word; }
table.keys td:first-child { white-space: nowrap; }

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

/* ---------------------------------------------------------------- footer */

.site-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 24px 40px;
  color: var(--muted);
  font-size: 14px;
}

.owner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.back-top {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .header-inner { padding: 8px 16px; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
    gap: 16px;
  }

  .toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 12px;
  }

  .toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 6px;
  }

  .toc .sub { display: none; }

  .toc a { font-size: 13.5px; padding: 6px 8px; }

  .cols-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .card { padding: 18px 16px; border-radius: var(--radius-sm); }
  .card > h2 { font-size: 21px; }
  .hero h1 { font-size: 26px; }
  :root { --header-h: 100px; }
  .site-title { font-size: 14px; padding-inline-start: 10px; }
  .brand { gap: 10px; }
  .product-logo { height: 28px; }
  .header-tools { margin-inline-start: 0; width: 100%; justify-content: space-between; }

  dl.items > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  /* Outside tables, long inline code may wrap rather than widen the page. */
  p code, li code, dd code { white-space: normal; overflow-wrap: anywhere; }

  th, td { padding: 8px 10px; font-size: 14px; }
}

@media (max-width: 400px) {
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .site-title { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .toc, .back-top, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { display: block; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0 0 12px; break-inside: auto; }
  .table-wrap { overflow: visible; border: 0; }
  a { color: inherit; text-decoration: none; }
}
