/* Nápověda NomadPit (/navody/): úvod s hledáním a kategoriemi, článek s obsahem vlevo a „Na této stránce“ vpravo.
   Obsah článků je v obsah.html, vykresluje ho navody.js. Světlý i tmavý režim jako zbytek webu. */
:root {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ede6; --text: #1d2521; --muted: #5d6862;
  --accent: #1f7a5c; --accent-soft: #e2f0ea; --border: #e2ded4; --warn-bg: #fff4d6; --warn: #7a5600;
  --mark: #ffe28a; --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .06);
  --sat: max(env(safe-area-inset-top, 0px), var(--np-safe-top, 0px)); /* stavový řádek telefonu / aplikace */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121614; --surface: #1b211e; --surface-2: #222a26; --text: #eef2ef; --muted: #9aa69f;
    --accent: #4cc39a; --accent-soft: #1f3a30; --border: #2b332f; --warn-bg: #3a3218; --warn: #e3c16f;
    --mark: #6b5a17; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --bg: #121614; --surface: #1b211e; --surface-2: #222a26; --text: #eef2ef; --muted: #9aa69f;
  --accent: #4cc39a; --accent-soft: #1f3a30; --border: #2b332f; --warn-bg: #3a3218; --warn: #e3c16f;
  --mark: #6b5a17; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); }
[hidden] { display: none !important; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Hlavička s hledáním ---------- */
.top { position: sticky; top: 0; z-index: 20; padding-top: var(--sat); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; flex: none; }
.logo svg { width: 28px; height: 28px; }
.logo small { font-weight: 600; color: var(--muted); }
.top nav { display: flex; gap: 14px; flex: none; margin-left: auto; }
.top nav a { color: var(--accent); font-weight: 600; text-decoration: none; }
.menu-toggle { display: none; flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px;
  min-height: 40px; padding: 0 12px; font: inherit; font-weight: 600; cursor: pointer; }

/* Hledací pole (v hlavičce i velké na úvodu) a našeptávač */
.search { position: relative; flex: 1; min-width: 0; max-width: 520px; }
.search input { width: 100%; font: inherit; font-size: 1rem; padding: 9px 36px 9px 38px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 18px;
  color: var(--text); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted);
  font-size: 1.1rem; width: 28px; height: 28px; cursor: pointer; border-radius: 50%; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: inherit; font-size: .75rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; pointer-events: none; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; max-height: min(70vh, 520px); overflow: auto; z-index: 30; text-align: left; }
.suggest li a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.suggest li a b { display: block; font-size: .95rem; }
.suggest li a small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.suggest li a .cat { color: var(--accent); font-weight: 600; }
.suggest li.on a, .suggest li a:hover { background: var(--accent-soft); }
.suggest .all { text-align: center; font-weight: 600; color: var(--accent); }
.suggest .none { padding: 10px; color: var(--muted); font-size: .92rem; }

/* ---------- Úvod ---------- */
.hero { max-width: 1320px; margin: 0 auto; padding: 36px 16px 8px; text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 6px; line-height: 1.2; }
.hero p { color: var(--muted); margin: 0 0 18px; }
.hero .search { max-width: 640px; margin: 0 auto; }
.hero .search input { font-size: 1.1rem; padding: 14px 40px 14px 46px; border-radius: 16px; background-position: 15px center; background-size: 20px; box-shadow: var(--shadow); }
.popular { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px auto 0; max-width: 720px; }
.popular span { color: var(--muted); font-size: .9rem; align-self: center; }
.popular a { font-size: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; text-decoration: none; color: var(--text); }
.popular a:hover { border-color: var(--accent); color: var(--accent); }
.cats { max-width: 1120px; margin: 28px auto 0; padding: 0 16px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.cat-card h2 { margin: 0 0 2px; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.cat-card h2 .ico { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex: none; }
.cat-card p { margin: 4px 0 8px; color: var(--muted); font-size: .9rem; }
.cat-card ul { list-style: none; margin: 0; padding: 0; }
.cat-card li a { display: block; padding: 5px 0; text-decoration: none; border-top: 1px solid var(--border); font-size: .95rem; }
.cat-card li a:hover { text-decoration: underline; }
.help-foot { max-width: 1120px; margin: 0 auto; padding: 8px 16px 56px; text-align: center; color: var(--muted); font-size: .92rem; }

/* ---------- Článek: 3 sloupce (obsah nápovědy | text | na této stránce) ---------- */
.layout { max-width: 1320px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 36px; align-items: start; }
.side { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; padding: 18px 4px 32px 0; font-size: .92rem; }
.side h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 4px; }
.side h3:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 4px 10px; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.35; }
.side li a:hover { background: var(--surface-2); }
.side li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.side .home { display: block; font-weight: 700; margin-bottom: 8px; text-decoration: none; }
.toc { position: sticky; top: 72px; padding: 22px 0 32px; font-size: .88rem; }
.toc h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc li a { display: block; padding: 3px 0 3px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li a:hover { color: var(--text); }
.toc li a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-inline { display: none; }

main.doc { padding: 18px 0 64px; min-width: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }
.doc h1 { font-size: clamp(1.5rem, 3.2vw, 2rem); line-height: 1.25; margin: 0 0 6px; }
.meta { color: var(--muted); font-size: .85rem; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.hits-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 6px 12px; font-size: .88rem; margin: 0 0 14px; }
.hits-bar button { border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
article { font-size: 1.02rem; }
article .perex { font-size: 1.1rem; color: var(--muted); margin: 0 0 18px; }
article h2 { font-size: 1.3rem; margin: 34px 0 10px; line-height: 1.3; position: relative; }
article h3 { font-size: 1.08rem; margin: 22px 0 6px; }
article h2 .anchor, article h3 .anchor { margin-left: 8px; font-weight: 400; color: var(--muted); text-decoration: none; opacity: 0; font-size: .9em; }
article h2:hover .anchor, article h3:hover .anchor, .anchor:focus { opacity: 1; }
article p, article ul, article ol { margin: 8px 0; }
article li { margin: 4px 0; }
article code { font-size: .9em; background: var(--surface-2); border-radius: 5px; padding: 1px 5px; }
/* Ovládací prvek aplikace v textu: <b class="ui">📅 Kalendář</b> */
.ui { font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 0 6px; white-space: nowrap; }
kbd { font: inherit; font-size: .85em; font-weight: 700; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--surface); }

/* Očíslované kroky */
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 12px 0; }
ol.steps > li { counter-increment: step; position: relative; padding: 3px 0 12px 44px; margin: 0; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .92rem; }
ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px; width: 2px; background: var(--border); }
ol.steps > li > figure { margin-top: 10px; }

/* Rámečky: tip, pozor, poznámka */
.tip, .warn, .info { border-radius: 12px; padding: 10px 14px 10px 44px; margin: 14px 0; position: relative; font-size: .97rem; }
.tip::before, .warn::before, .info::before { position: absolute; left: 14px; top: 9px; font-size: 1.05rem; }
.tip { background: var(--accent-soft); }
.tip::before { content: "💡"; }
.warn { background: var(--warn-bg); color: var(--warn); }
.warn::before { content: "⚠️"; }
.info { background: var(--surface-2); }
.info::before { content: "ℹ️"; }
.tip p, .warn p, .info p { margin: 4px 0; }

/* Zařízení: záložky Android / iPhone / Počítač (<div class="tabs"><section data-tab="Android">…) */
.tabs { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin: 14px 0; overflow: hidden; }
.tabs .tab-bar { display: flex; gap: 4px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs .tab-bar button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tabs .tab-bar button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.tabs > section { padding: 4px 16px 10px; }

/* Snímky obrazovky: .shot (počítač), .shot.phone (telefon v rámečku), .shots = víc vedle sebe */
figure.shot { margin: 16px 0; }
figure.shot img, figure.shot .noimg { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); cursor: zoom-in; }
figure.shot.phone img, figure.shot.phone .noimg { width: 280px; max-width: 100%; border-radius: 26px; border: 6px solid #1c1f1e; }
figure.shot.center { text-align: center; }
figure.shot.center img, figure.shot.center .noimg { margin: 0 auto; }
figure.shot figcaption { color: var(--muted); font-size: .87rem; margin-top: 8px; line-height: 1.45; }
figure.shot .noimg { cursor: default; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 160px; padding: 16px;
  color: var(--muted); font-size: .9rem; border-style: dashed; box-shadow: none; }
figure.shot.phone .noimg { min-height: 420px; }
.shots { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-start; }
.shots figure.shot { margin: 8px 0; }

/* Související a předchozí/další */
.related { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.05rem; margin: 0 0 10px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.related-grid a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; text-decoration: none; color: var(--text); }
.related-grid a:hover { border-color: var(--accent); }
.related-grid a small { display: block; color: var(--muted); font-size: .82rem; }
.pager { display: flex; gap: 12px; margin-top: 26px; }
.pager a { flex: 1; display: block; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; text-decoration: none; color: var(--text); background: var(--surface); }
.pager a:hover { border-color: var(--accent); }
.pager a small { display: block; color: var(--muted); font-size: .8rem; }
.pager a.next { text-align: right; }
.pager a b { color: var(--accent); }
.feedback { margin-top: 28px; color: var(--muted); font-size: .9rem; }

/* Výsledky hledání (?q=) */
.results-page h1 { font-size: 1.4rem; margin: 0 0 4px; }
.results-page .count { color: var(--muted); margin: 0 0 16px; }
.result { display: block; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; margin: 0 0 10px; text-decoration: none; color: var(--text); }
.result:hover { border-color: var(--accent); }
.result b { font-size: 1.05rem; color: var(--accent); }
.result .where { display: block; font-size: .82rem; color: var(--muted); }
.result p { margin: 4px 0 0; font-size: .93rem; color: var(--muted); }

/* Zvětšený snímek */
dialog.zoom { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.zoom::backdrop { background: rgba(0, 0, 0, .8); }
dialog.zoom img { display: block; max-width: 96vw; max-height: 90vh; border-radius: 10px; }
dialog.zoom p { color: #fff; text-align: center; margin: 8px 0 0; font-size: .9rem; }
/* Zavírací křížek nad snímkem: bílý ✕ na tmavém podkladu (jako lightbox v mapě), vpravo nahoře 14 px od okraje */
dialog.zoom button { position: fixed; top: calc(14px + var(--sat)); right: 14px; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 12px; border: 0 !important; background: rgba(0, 0, 0, .55) !important; box-shadow: none !important; color: #fff !important; font-size: 1.05rem; font-weight: 600; line-height: 1; cursor: pointer; }
dialog.zoom button:hover { background: rgba(0, 0, 0, .75) !important; }

.to-top { position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); box-shadow: var(--shadow); font-size: 1.2rem; cursor: pointer; z-index: 15; }

/* ---------- Menší obrazovky ---------- */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
  .toc-inline { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin: 0 0 18px; font-size: .92rem; }
  .toc-inline summary { font-weight: 700; cursor: pointer; }
  .toc-inline ul { margin: 6px 0 0; padding-left: 18px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .side { display: none; position: fixed; inset: 0; top: 0; max-height: none; z-index: 40; background: var(--bg); padding: calc(14px + var(--sat)) 14px 40px; overflow: auto; }
  .side.open { display: block; }
  .side .close { display: flex; }
  .top nav a.hide-sm, .logo small, .search kbd { display: none; }
}
@media (min-width: 861px) { .side .close { display: none; } }
/* Křížek drží vpravo nahoře i po posunutí obsahu (panel se otevírá posunutý k aktuálnímu návodu) */
.side .close { justify-content: flex-end; margin-bottom: 8px; position: sticky; top: 0; z-index: 1; pointer-events: none; } /* top 0 = u vnitřního okraje panelu (14 px + stavový řádek) */
.side .close button { pointer-events: auto; }
/* Zavírací křížek: čtverec 40×40, sklo, černý ✕ (jako v oknech nad mapou), bez zeleného obrysu */
.side .close button { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 12px; border: 0; color: var(--btn-ink, #111); font-size: 1.05rem; line-height: 1; cursor: pointer; font-weight: 600;
  background: linear-gradient(145deg, var(--gh, rgba(255, 255, 255, .78)), transparent 55%), var(--gl, rgba(255, 255, 255, .5)); box-shadow: 0 4px 12px var(--sh, rgba(20, 40, 30, .16)), inset 0 1px 0 var(--hi, rgba(255, 255, 255, .85)); }
@media (max-width: 560px) {
  .top-in { gap: 8px; padding: 8px 12px; }
  .logo span { display: none; }
  .pager { flex-direction: column; }
  figure.shot.phone img, figure.shot.phone .noimg { width: 240px; }
}
@media print {
  .top, .side, .toc, .toc-inline, .pager, .related, .to-top, .feedback, .hits-bar { display: none !important; }
  .layout { display: block; }
  body { background: #fff; color: #000; }
  figure.shot img { box-shadow: none; }
}

/* Animovaný návod (figure.anim): přehrávač i jeho styly jsou ve sdíleném /animace.js */
/* Hledací pole ve skle (okraje a pozadí řeší sklo.css, tady jen odsazení kvůli ikoně lupy a křížku).
   sklo.css se načítá až po tomto souboru a pole sjednocuje na padding 9px 12px, proto vyšší váha přes :root. */
html:root body .search input { padding: 9px 36px 9px 38px; }
html:root body .hero .search input { padding: 14px 40px 14px 46px; }
/* sklo.css drží stránku vždy světlou (černý text), ale vlastní proměnné nápovědy by se v tmavém režimu telefonu přepnuly
   na tmavé: prvky aplikace (.ui), záložky zařízení, zvýraznění hledání a rámečky by byly černé na černé. Proto i ony vždy světlé. */
html:root, html:root:not([data-theme="light"]), html:root[data-theme="dark"] {
  --surface-2: rgba(255, 255, 255, .55); --warn-bg: #fff4d6; --warn: #7a5600; --mark: #ffe28a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .06);
}
