/* ===========================================================
   XStation manual — design tokens
   Signature idea: the manual borrows the fuel-pump's own visual
   vocabulary — status pills (Voľný/Tankuje/Blokovaný), amber
   digit-display accents, and physical keycaps for shortcuts —
   instead of generic docs-site styling.
   =========================================================== */
:root {
  /* Palette */
  --ink:        #14181f;   /* near-black, primary text */
  --ink-soft:   #4b5261;   /* secondary text */
  --paper:      #faf8f4;   /* warm receipt-paper canvas */
  --paper-dim:  #f1ede4;   /* card / zebra background on paper */
  --panel:      #12151b;   /* dark control-panel sidebar */
  --panel-line: #262c37;   /* sidebar hairlines */
  --panel-text: #b9c0cc;   /* sidebar inactive text */
  --amber:      #ff9a1f;   /* pump digit-display accent */
  --amber-dim:  #7a4a10;
  --green:      #1f8a52;   /* "Voľný" status */
  --green-bg:   #e6f4ec;
  --red:        #c2402f;   /* "Blokovaný" status */
  --red-bg:     #fbe9e6;
  --line:       #e4ddcf;   /* hairline on paper */
  --shadow:     0 8px 24px rgba(20, 24, 31, 0.10);

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  --sidebar-w: 300px;
  --content-max: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

::selection { background: var(--amber); color: #1a1200; }

/* ---------------- Layout shell ---------------- */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--panel);
  color: var(--panel-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 0 40px;
  border-right: 1px solid var(--panel-line);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--panel-line);
}
.sidebar-brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255,154,31,0.18);
  animation: pulse 2.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,154,31,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(255,154,31,0.06); }
}
.sidebar-brand strong {
  font-family: var(--font-display);
  color: #fff;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.sidebar-brand span {
  display: block;
  font-size: 11px;
  color: var(--panel-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-search {
  margin: 0 16px 14px;
  position: relative;
}
.sidebar-search input {
  width: 100%;
  background: #1b2028;
  border: 1px solid var(--panel-line);
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px 9px 30px;
  font-size: 13.5px;
  font-family: var(--font-body);
}
.sidebar-search input::placeholder { color: #6b7280; }
.sidebar-search input:focus {
  outline: none;
  border-color: var(--amber);
}
.sidebar-search::before {
  content: "";
  position: absolute;
  left: 10px; top: 50%;
  width: 12px; height: 12px;
  margin-top: -6px;
  border: 1.6px solid #6b7280;
  border-radius: 50%;
}
.sidebar-search::after {
  content: "";
  position: absolute;
  left: 19px; top: 50%;
  margin-top: 3px;
  width: 6px; height: 1.6px;
  background: #6b7280;
  transform: rotate(45deg);
}

nav.toc { padding: 6px 10px; }
nav.toc a {
  display: block;
  color: var(--panel-text);
  text-decoration: none;
  font-size: 13.6px;
  padding: 7px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  white-space: normal;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
nav.toc a.level-1 {
  font-family: var(--font-display);
  color: #e7e9ee;
  font-weight: 600;
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
nav.toc a.level-2 {
  padding-left: 24px;
  font-size: 13.2px;
}
nav.toc a:hover {
  background: #1b2028;
  color: #fff;
}
nav.toc a.active {
  background: rgba(255,154,31,0.12);
  border-left-color: var(--amber);
  color: var(--amber);
}
nav.toc .navhide { display: none !important; }

.sidebar-foot {
  padding: 16px 20px 0;
  margin-top: 16px;
  border-top: 1px solid var(--panel-line);
  font-size: 11.5px;
  color: #6b7280;
  line-height: 1.5;
}

/* Mobile toggle */
.menu-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 60;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.menu-toggle span {
  width: 18px; height: 2px; background: #e7e9ee; border-radius: 2px;
}
.scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,12,16,0.5);
  z-index: 45;
}

/* ---------------- Main content ---------------- */
main.content {
  flex: 1;
  min-width: 0;
  padding: 56px 40px 120px;
  display: flex;
  justify-content: center;
}
.content-inner {
  max-width: var(--content-max);
  width: 100%;
}

.doc-hero {
  margin-bottom: 34px;
}
.doc-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--amber-dim);
  background: #fff2df;
  border: 1px solid #f0d4a8;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.doc-hero h1 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.1;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.doc-hero p.lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0;
}
.doc-hero .hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink); }
.btn.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn.primary:hover { background: #000; }

/* headings inside content */
h1.kap {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--ink);
  margin: 64px 0 6px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}
h1.kap:first-of-type { border-top: none; margin-top: 0; }
h1.kap .num {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 16px;
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}
h2 {
  font-family: var(--font-display);
  font-size: 21px;
  color: var(--ink);
  margin: 38px 0 12px;
  scroll-margin-top: 24px;
}
h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin: 26px 0 8px;
  scroll-margin-top: 24px;
}
h3::before {
  content: "▸";
  color: var(--amber);
  margin-right: 7px;
  font-size: 13px;
}

p {
  margin: 0 0 14px;
  color: #2a2f38;
}
p.italic { font-style: italic; color: var(--ink-soft); }
p.bold { font-weight: 700; }
p.center { text-align: center; }
p.small { font-size: 12.5px; color: var(--ink-soft); }

a { color: var(--amber-dim); }

code {
  font-family: var(--font-mono);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.88em;
}

/* keycaps */
kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: linear-gradient(#fff, #ececec);
  border: 1px solid #c9c9c9;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 7px;
  color: #23262b;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
  margin: 0 1px;
}

/* status pills - reuse the pump's own state vocabulary as callouts */
.pill-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 10px;
  padding: 12px 15px;
  margin: 16px 0;
  font-size: 14.5px;
  border: 1px solid transparent;
}
.pill-note .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.pill-note.info { background: #eef2fb; border-color: #cdd8f2; color: #2a3a63; }
.pill-note.info .dot { background: #3760c9; }
.pill-note.tip { background: var(--green-bg); border-color: #bfe3cd; color: #144a2d; }
.pill-note.tip .dot { background: var(--green); }
.pill-note.warn { background: var(--red-bg); border-color: #f0c4bd; color: #6d2015; }
.pill-note.warn .dot { background: var(--red); }
.pill-note b { display:block; margin-bottom: 2px; }

/* figures / image cards */
.figure {
  margin: 20px 0 26px;
  text-align: center;
}
.figure.row {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.figure.row .fig-item { flex: 1 1 240px; max-width: 320px; }
.img-card {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  max-width: 100%;
}
.img-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(20,24,31,0.14);
}
.img-card img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.caption {
  font-size: 12.6px;
  color: var(--ink-soft);
  margin-top: 8px;
  font-style: italic;
}

/* keyboard shortcuts table */
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 30px;
  font-size: 13.6px;
}
.shortcuts-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  padding: 8px 10px;
}
.shortcuts-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.shortcuts-table tr:hover td { background: var(--paper-dim); }
.shortcuts-table .icon-cell { text-align: center; }
.shortcuts-table .icon-cell img { height: 40px; width: auto; vertical-align: middle; margin: 0 3px; }

ul.plain { margin: 0 0 14px; padding-left: 20px; }
ul.plain li { margin-bottom: 4px; }

/* lightbox */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,12,16,0.86);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

footer.doc-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    width: 82vw;
    max-width: 320px;
  }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; }
  main.content { padding: 90px 20px 100px; }
  .doc-hero h1 { font-size: 30px; }
}

/* ---------------- Print ---------------- */
@media print {
  .sidebar, .menu-toggle, .scrim, .doc-hero .hero-actions, .lightbox { display: none !important; }
  main.content { padding: 0; }
  .shell { display: block; }
  h1.kap { break-before: page; border-top: none; }
  .img-card { box-shadow: none; break-inside: avoid; }
  .figure { break-inside: avoid; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar-brand .dot { animation: none; }
  .img-card, nav.toc a, .sidebar { transition: none; }
}
