@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #202225;
  --bg-panel: #292c30;
  --ink: #eaecee;
  --ink-dim: #a3a8af;
  --ink-faint: #6f747b;
  --line: #3d4147;
  --line-bright: #565b62;
  --accent: #5fd0f0;
  --accent-dim: #327f96;
  --green: #7fd88f;
  --amber: #e8b76f;
  --red: #e08a7f;
  --lavender: #b3a3e0;
  --continent-europe: #7fd88f;
  --continent-asia: #e08a7f;
  --continent-africa: #e8b76f;
  --continent-north-america: #8fa3d6;
  --continent-south-america: #7fc4bd;
  --continent-oceania: #c99b7f;
  --continent-antarctica: #eef1f2;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 5px; border: 2.5px solid var(--bg-panel); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }
* { scrollbar-width: thin; scrollbar-color: var(--line-bright) var(--bg-panel); }

html, body { height: 100%; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
code, .mono { font-family: 'JetBrains Mono', monospace; }

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 25px;
  border-bottom: 0.7px solid var(--line);
  background: var(--bg-panel);
  flex-shrink: 0;
}
header.site-header .brand { font-weight: 600; font-size: 21.2px; letter-spacing: .01em; color: var(--accent); }
#auth-button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17.5px;
  padding: 8.8px 17.5px;
  border: 0.7px solid var(--accent-dim);
  background: transparent;
  color: var(--accent);
  border-radius: 7.5px;
  cursor: pointer;
}
#auth-button:hover { background: rgba(95,208,240,0.1); }

.layout { display: flex; flex: 1; min-height: 0; position: relative; }
/* Šípka späť hore (web v0.2.84): objaví sa po posunutí o jednu obrazovku, na celom webe */
#scroll-top-btn {
  position: absolute; right: 34px; bottom: 20px; z-index: 50;
  width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-panel); color: var(--accent);
  border: 0.7px solid var(--accent-dim); border-radius: 0;
  font-size: 20px; line-height: 1; cursor: pointer;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility .2s, border-color .15s;
}
#scroll-top-btn.visible { opacity: 1; visibility: visible; pointer-events: auto; }
/* V1.0.1: miesto pod koncom obsahu, aby šípka neprekrývala posledné riadky */
#page-content { padding-bottom: 80px; }
#scroll-top-btn:hover { border-color: var(--accent); }
nav#tree-nav {
  width: var(--nav-width, 287.5px);
  flex-shrink: 0;
  border-right: 0.7px solid var(--line);
  padding: 15px;
  background: var(--bg-panel);
  overflow-y: auto;
}
#nav-resize-handle {
  width: 6px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
}
#nav-resize-handle:hover, #nav-resize-handle.dragging { background: var(--accent-dim); }
main.content {
  flex: 1;
  margin: 0 auto;
  background-image: linear-gradient(#2c2f34 1.2px, transparent 1.2px), linear-gradient(90deg, #2c2f34 1.2px, transparent 1.2px);
  background-size: 30px 30px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  width: 100%;
}
.sheet-bar {
  padding: 10px 30px;
  border-bottom: 0.7px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16.2px;
  color: var(--ink-faint);
  letter-spacing: .04em;
  display: flex;
  justify-content: space-between;
}
.content-inner { max-width: 1200px; padding: 35px 30px; }

.badge-num {
  display: inline-block;
  background: var(--bg-panel);
  border: 0.7px solid var(--line);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16.2px;
  padding: 3.8px 10px;
  border-radius: 5px;
  margin-right: 10px;
}
.section-label { font-size: 18px; font-weight: 500; display: flex; align-items: center; margin: 25px 0 15px; }
h2.section-label { font-size: 21.2px; }

.tnode, .tleaf {
  display: flex;
  align-items: center;
  gap: 7.5px;
  padding: 8.8px 10px;
  font-size: 18px;
  border-radius: 6.2px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink-dim);
}
.tnode:hover, .tleaf:hover, .tnode:focus, .tleaf:focus, .tnode:focus-visible, .tleaf:focus-visible { background: var(--line); color: var(--ink); outline: none; }
.tnode.active, .tleaf.active { background: rgba(95,208,240,0.12); color: var(--accent); font-weight: 500; }
.tchild { display: none; margin-left: 22.5px; border-left: 0.7px solid var(--line); padding-left: 7.5px; }
.tchild.open { display: block; }
.tchevron { display: inline-block; transition: transform .15s; font-size: 16.2px; width: 15px; color: var(--ink-faint); }
.tchevron.open { transform: rotate(90deg); }
.tree-icon { font-size: 15px; width: 15px; display: inline-block; }
.lock-icon { font-size: 16.2px; margin-left: 5px; color: var(--ink-faint); }
.tleaf.locked { color: var(--ink-faint); cursor: not-allowed; }

.tnode-row { display: flex; align-items: center; gap: 2px; }
.tnode-row .tnode { flex: 1; min-width: 0; }
.tchevron-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  cursor: pointer; border-radius: 6.2px; color: var(--ink-faint);
}
.tchevron-btn:hover { background: var(--line); color: var(--ink); }
.tchevron-btn .tchevron { font-size: 18px; width: auto; }

.tnode-row.sub-row .tleaf { flex: 1; min-width: 0; }
.tchevron-btn.small { width: 27px; height: 27px; }
.tchevron-btn.small .tchevron { font-size: 14px; }
.tchild.sub-tchild { margin-left: 30px; }
.tleaf.sub { font-size: 16.2px; color: var(--ink-faint); }
.tleaf.sub:hover { color: var(--ink); }
.tleaf.sub.active { color: var(--accent); }
.dot { width: 8.8px; height: 8.8px; border-radius: 50%; display: inline-block; }
.dot-done { background: var(--green); }
.dot-active { background: var(--amber); }
.dot-paused { background: var(--red); }
.dot-planned { background: var(--ink-faint); }
.dot-private { background: var(--lavender); } /* V1.1.7: addon len na vlastné použitie, bez sťahovania (B-RABt) */

.addon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(187.5px, 1fr)); }
.addon-card { border: 0.7px solid var(--line); padding: 17.5px; text-decoration: none; color: var(--ink); background: var(--bg-panel); min-height: 162px; display: flex; flex-direction: column; }
.addon-card .notif-count { font-weight: 600; color: var(--ink); text-align: center; margin-top: auto; padding-top: 15px; }
.addon-grid a.addon-card + a.addon-card { border-left: none; margin-left: 0.7px; }
.addon-card:hover, .addon-card:focus, .addon-card:focus-visible { border-color: var(--accent-dim); outline: none; }
.addon-grid a.addon-card + a.addon-card:hover, .addon-grid a.addon-card + a.addon-card:focus, .addon-grid a.addon-card + a.addon-card:focus-visible {
  border-left: 0.7px solid var(--accent-dim);
  margin-left: 0;
}
.addon-card .code { font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--ink-faint); margin: 0 0 7.5px; letter-spacing: .05em; }
.addon-card .name { font-weight: 600; font-size: 21.2px; margin: 0; color: var(--lavender); }
.addon-card.sub .name { font-size: 18px; color: var(--ink); }
.addon-card .tagline { font-size: 16.2px; color: var(--ink-dim); margin: 5px 0 0; }

.model-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; }
.model-link-card { border: 0.7px solid var(--line); background: var(--bg-panel); display: flex; flex-direction: column; overflow: hidden; }
.model-link-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.model-link-card .body { padding: 12px 15px; flex: 1; display: flex; flex-direction: column; }
.model-link-card .name { font-weight: 600; font-size: 16px; margin: 0 0 4px; overflow-wrap: break-word; word-break: break-word; }
.model-link-card .prompt-oneline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-link-card .meta { font-size: 13px; color: var(--ink-dim); margin: 0 0 6px; overflow-wrap: break-word; word-break: break-word; text-align: center; }
.model-link-card .desc { font-size: 14px; line-height: 1.5; margin: 0 0 6px; overflow-wrap: break-word; word-break: break-word; }
/* V1.0.4: rozbalený popis zachová zalomenia riadkov (skrátený ostáva v jednom riadku s „…“) */
.model-link-card .desc:not(.prompt-oneline) { white-space: pre-line; }
.model-link-card .tags { font-size: 13px; color: var(--ink-faint); margin: 0 0 8px; }
.model-link-card .actions { margin-top: auto; display: flex; gap: 10px; align-items: center; justify-content: center; padding-top: 6px; }
.card-action-btn { width: 92px; white-space: nowrap; }
.donate-btn { display: inline-block; background: var(--accent-dim); color: var(--bg); border: 0.7px solid var(--accent-dim); padding: 10px 22px; text-decoration: none; font-weight: 500; }
.donate-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.field-err { color: var(--red); font-size: 13px; margin: -4px 0 12px; }
.model-link-card .actions .card-action-btn { flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px; }
/* Odkaz na konkrétny model / prompt: karta sa na chvíľu zvýrazní (V1.0.2) */
.model-link-card { transition: box-shadow 0.6s ease, border-color 0.6s ease; }
.model-link-card.card-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
/* V1.1.1: skrytie obsahu do vyriešenia (vidí len admin a autor) */
.hidden-badge { align-self: center; color: var(--amber); border: 0.7px solid var(--amber); background: rgba(232,183,111,0.12); font-size: 12px; line-height: 1.4; padding: 2px 8px; margin: 0 0 8px; text-align: center; }
.model-link-card img.is-hidden { opacity: 0.45; }
.mod-wrap { position: relative; flex: 1 1 0; min-width: 0; display: flex; }
.model-link-card .actions .mod-wrap .card-action-btn { width: 100%; }
.mod-btn svg { width: 16px; height: 16px; vertical-align: -3px; }
.mod-btn .mod-sep { color: var(--ink-faint); margin: 0 4px; }
.model-link-card .actions { position: relative; }
.mod-menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--bg-panel); border: 0.7px solid var(--accent-dim); box-shadow: 0 6px 18px rgba(0,0,0,0.45); z-index: 50; display: flex; flex-direction: column; }
.mod-menu button { border: none; border-bottom: 0.7px solid var(--line); text-align: left; padding: 9px 12px; width: 100%; font-size: 14px; background: var(--bg-panel); }
.mod-menu button:last-child { border-bottom: none; }
.mod-menu button.danger { color: var(--red); }
.mod-menu button.danger:hover { color: var(--red); background: rgba(224,138,127,0.10); }
.admin-hidden-tag { color: var(--amber); border: 0.7px solid var(--amber); font-size: 12px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; }

.notice { background: var(--bg-panel); border: 0.7px solid var(--line); border-radius: 7.5px; padding: 17.5px; font-size: 18px; color: var(--ink-dim); }

input[type="text"], input[type="url"], input[type="email"], input[type="file"], select, textarea {
  font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 0.7px solid var(--line); padding: 9px 11px; box-sizing: border-box;
}
textarea { resize: vertical; }
input[type="file"]::file-selector-button {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--ink);
  background: var(--bg-panel); border: 0.7px solid var(--line); padding: 7px 14px;
  margin-right: 12px; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent-dim); color: var(--accent); }
input[type="text"]:focus, input[type="url"]:focus, input[type="email"]:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-dim); }
input:disabled { color: var(--ink-faint); }
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; background: var(--bg); border: 0.7px solid var(--line);
  cursor: pointer; position: relative; vertical-align: middle; flex-shrink: 0;
}
input[type="checkbox"]:hover { border-color: var(--accent-dim); }
input[type="checkbox"]:checked { background: var(--accent-dim); border-color: var(--accent-dim); }
input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
button, .btn { font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--ink); background: var(--bg-panel);
  border: 0.7px solid var(--line); padding: 9px 16px; cursor: pointer; }
button:hover, .btn:hover { border-color: var(--accent-dim); color: var(--accent); }
button:disabled { color: var(--ink-faint); border-color: var(--line); background: var(--bg); cursor: not-allowed; opacity: 0.5; }
button:disabled:hover { color: var(--ink-faint); border-color: var(--line); }
button[type="submit"] { background: var(--accent-dim); color: var(--bg); border-color: var(--accent-dim); }
button[type="submit"]:hover { color: var(--bg); background: var(--accent); }

.edit-field { border-bottom: 1.5px dashed var(--accent-dim); cursor: text; }
.edit-field:focus { outline: none; border-bottom-color: var(--accent); background: rgba(95,208,240,0.08); }
.edit-mode-bar { display: flex; align-items: center; gap: 15px; background: var(--accent-dim); color: var(--bg);
  padding: 8px 20px; font-size: 14px; }
.edit-mode-bar button { background: var(--bg); color: var(--ink); border: none; padding: 5px 12px; }
.edit-pencil { cursor: pointer; margin-left: 12px; }

.section-stack { display: flex; flex-direction: column; margin-top: 20px; }
.section-card { border: 0.7px solid var(--line); background: var(--bg-panel); padding: 20px 22px; }
.section-stack .section-card + .section-card { border-top: none; }
.section-card h2 { margin: 0 0 10px; font-size: 21.2px; }
.section-card p { margin: 0; font-size: 18px; line-height: 1.6; }


footer.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 17.5px 30px;
  border-top: 0.7px solid var(--line);
  font-size: 16.2px;
  color: var(--ink-faint);
  flex-shrink: 0;
}
footer.site-footer .footer-right { justify-self: end; }
footer.site-footer .footer-right a + a { margin-left: 24px; }
footer.site-footer a { color: var(--accent-dim); }
footer.site-footer a:hover { color: var(--accent); }

a { color: var(--accent-dim); }
a:hover { color: var(--accent); }
h1, h2 { font-family: 'JetBrains Mono', monospace; }
h1 { color: var(--accent); }
h2 { color: var(--lavender); }

[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  background: var(--bg-panel);
  color: var(--ink);
  border: 0.7px solid var(--line);
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: var(--bg-panel); border: 0.7px solid var(--line); padding: 25px; max-width: 480px; width: 90%; }
/* V1.0.4: okno View prompt */
.prompt-modal { max-width: 720px; width: 92%; max-height: 85vh; display: flex; flex-direction: column; }
.prompt-modal h3 { margin: 0 0 4px; font-size: 18px; }
.prompt-modal .pm-meta { color: var(--ink-dim); font-size: 13px; margin: 0 0 12px; overflow-wrap: break-word; }
.prompt-modal .pm-text { flex: 1; overflow: auto; white-space: pre-line; overflow-wrap: break-word; word-break: break-word; line-height: 1.6; font-size: 15px; background: var(--bg); border: 0.7px solid var(--line); padding: 14px 16px; margin: 0 0 14px; }
.prompt-modal .pm-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.prompt-modal .pm-src { font-size: 13px; color: var(--ink-dim); margin: -6px 0 14px; overflow-wrap: break-word; }
.model-link-card .src-line { font-size: 13px; color: var(--ink-dim); text-align: center; margin: 0 0 6px; }
.prompt-modal .pm-ok { color: var(--green); font-size: 13px; margin-right: auto; }
@media (max-width: 600px) { .prompt-modal { width: 100%; max-height: 92vh; padding: 18px; } }

/* Videá na webe (V1.1.6, pravidlo pre všetky): MP4 16:9, 75 % šírky textu, na stred, popis na stred */
.site-video { margin: 5px auto 30px; width: 75%; }
.site-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--bg); }
.site-video figcaption { margin-top: 10px; font-size: 15px; color: var(--ink-faint); text-align: center; }
.addon-grid + .site-video { margin-top: 30px; }
/* V1.1.7: slučka z dvoch kópií videa — druhá čaká pod prvou a tesne pred koncom sa vymenia (bez trhnutia pri návrate na začiatok) */
.site-video .loop-pair { position: relative; aspect-ratio: 16 / 9; }
.site-video .loop-pair video { position: absolute; inset: 0; }
.site-video .loop-pair video.standby { visibility: hidden; }
@media (max-width: 800px) { .site-video { width: 100%; } }

/* V1.1.5: stránka Manual (karty, V1.1.8), sťahovanie, changelog; V1.2.0: štýly vloženého manuálu a stránok manual_<jazyk>.html odstránené */
.lang-btn { font-family: 'JetBrains Mono', monospace; font-size: 14px; padding: 5px 12px; border: 0.7px solid var(--line); color: var(--ink-dim); text-decoration: none; }
a.lang-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.lang-btn.on { border-color: var(--accent-dim); color: var(--accent); background: rgba(95,208,240,0.12); }
.lang-note { font-size: 13px; color: var(--ink-dim); margin: 0 0 20px; }
.manual-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.manual-card { border: 0.7px solid var(--line); padding: 16px 18px; }
.manual-card .code { font-size: 13px; color: var(--ink-dim); margin: 0; }
.manual-card .lang { font-size: 17px; margin: 4px 0 14px; }
.manual-card .lang-btn { display: inline-block; }
.manual-card .md { font-size: 13px; margin: 12px 0 0; }
.dl-box { border: 0.7px solid var(--line); padding: 18px 20px; margin: 0 0 15px; }
.dl-box .ver { font-size: 20px; margin: 0 0 4px; }
.dl-box .sub { font-size: 14px; color: var(--ink-dim); margin: 0 0 15px; }
.dl-box ul { margin: 0 0 18px; padding-left: 22px; font-size: 15px; line-height: 1.6; }
.cl-entry { border-left: 0.7px solid var(--accent-dim); padding: 2px 0 2px 15px; margin: 0 0 20px; }
.cl-entry .ver { font-size: 17px; margin: 0 0 4px; }
.cl-entry .date { font-size: 13px; color: var(--ink-dim); margin: 0 0 8px; }
.cl-entry ul { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.6; }

/* V1.1.6: mobil (do 700 px) — menu za tlačidlom ☰ (vysúva sa zľava), menšia hlavička, karty modelov pod sebou, okná na šírku displeja.
   Počítač sa nemení: tlačidlo ☰ a tmavá vrstva za menu sú tam skryté. */
#menu-toggle { display: none; }
#nav-scrim { display: none; }
@media (max-width: 700px) {
  header.site-header { padding: 10px 12px; gap: 10px; }
  header.site-header .brand { font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #auth-button { font-size: 12.5px; padding: 6px 10px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
  #menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 36px; padding: 0; font-size: 20px; flex-shrink: 0; background: transparent; color: var(--accent); border: 0.7px solid var(--accent-dim); border-radius: 7.5px; }
  nav#tree-nav { position: fixed; top: 0; left: 0; bottom: 0; width: 82vw; max-width: 320px; z-index: 950; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open nav#tree-nav { transform: none; box-shadow: 6px 0 24px rgba(0,0,0,.5); }
  body.nav-open #nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 940; }
  #nav-resize-handle { display: none; }
  .sheet-bar { padding: 8px 16px; font-size: 12px; gap: 12px; }
  .sheet-bar .sheet-ver { white-space: nowrap; }
  .content-inner { padding: 20px 16px; }
  #page-content h1 { font-size: 23px !important; }
  footer.site-footer { grid-template-columns: 1fr; gap: 4px; padding: 10px 16px; font-size: 12.5px; text-align: center; }
  footer.site-footer .footer-right { justify-self: center; }
  #scroll-top-btn { right: 16px; }
  .model-links-grid { grid-template-columns: 1fr; gap: 14px; }
  .model-link-card img { aspect-ratio: auto; height: 240px; }
  .modal-box { width: 94%; padding: 18px; max-height: 90vh; overflow-y: auto; }
  .manual-cards { grid-template-columns: 1fr; gap: 12px; }
  /* V1.1.7: na mobile sa posúva celá stránka (nie len obsah) — prehliadač potom vie obnoviť stránku potiahnutím nadol.
     Hlavička ostáva hore, pätka dole (sticky); šípka hore pevne v rohu obrazovky. Počítač bez zmeny. */
  html, body { height: auto; }
  body { overflow: visible; min-height: 100vh; min-height: 100dvh; }
  body.nav-open { overflow: hidden; }
  header.site-header { position: sticky; top: 0; z-index: 900; }
  .layout { flex: 1 0 auto; min-height: auto; }
  main.content { overflow-y: visible; scrollbar-gutter: auto; }
  footer.site-footer { position: sticky; bottom: 0; z-index: 900; background: var(--bg); }
  #scroll-top-btn { position: fixed; bottom: 120px; }
}
