:root {
  --bg: #eef1f4;
  --card: #ffffff;
  --text: #161c24;
  --muted: #5b6b7a;
  --border: #d3dae1;
  --accent: #1f7a8c;
  --accent-dark: #145a68;
  --accent-tint: #dcf0f3;
  --ok: #2f9e44;
  --ok-tint: #e3f6e6;
  --warn: #b5790e;
  --warn-tint: #fbf0d9;
  --gap: #c1503a;
  --shadow: 0 1px 2px rgba(22,28,36,.04), 0 6px 20px -8px rgba(22,28,36,.12);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

header.top {
  background: var(--accent-dark);
  color: #fff;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

header.top a {
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
  font-weight: 500;
}

header.top a:hover { opacity: 1; text-decoration: underline; }

header.top .brand {
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  opacity: 1;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  max-width: 100%;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
}

h1 {
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 800;
  font-size: 2.1rem;
  letter-spacing: 0.01em;
  margin: 0 0 0.3rem;
}
h2 { font-size: 1.15rem; margin-top: 0; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin: 0 0 0.4rem;
  display: block;
}
.lede { color: var(--muted); font-size: 0.98rem; max-width: 62ch; margin: 0 0 0.6rem; }
.proc-hero { margin-bottom: 1.2rem; }

.muted { color: var(--muted); font-size: 0.9rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #e7f0fb;
  color: var(--accent-dark);
  font-size: 0.8rem;
  margin-right: 0.3rem;
}

.pill.ok { background: #e5f5ec; color: var(--ok); }
.pill.warn { background: #fdf1de; color: var(--warn); }
.pill.gap { background: #fbe9e7; color: var(--gap); }

.search-box input[type="search"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.result {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.result:last-child { border-bottom: none; }
.result h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.result .snippet { color: var(--text); }
.result .meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

form.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
/* max-width drzi filtr uvnitr stranky na telefonu: <select> se jinak roztahne
   podle nejdelsi polozky (nazvy systemu maji i 60 znaku) a vystrci celou
   stranku do vodorovneho rolovani. */
form.filters select, form.filters input {
  padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 6px;
  max-width: 100%;
}

a.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.htmx-indicator { display: none; }

.changelog-list { list-style: none; margin: 0; padding: 0; }
.changelog-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.changelog-item:last-child { border-bottom: none; }
.changelog-item p { margin: 0.35rem 0 0; }
.changelog-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.changelog-head strong { font-size: 1.02rem; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-request.htmx-indicator { display: inline; }

ol.steps { padding-left: 1.2rem; }
ol.steps li { margin-bottom: 0.4rem; }

.flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.flow-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  background: var(--bg);
}
.flow-item p { margin: 0.25rem 0 0; }
.flow-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.flow-trigger { border-color: var(--accent); background: #eaf3fb; }
.flow-trigger .flow-label { color: var(--accent-dark); }
.flow-decision { border-color: var(--warn); background: #fdf1de; }
.flow-decision .flow-label { color: var(--warn); }
.flow-output { border-color: var(--ok); background: #e5f5ec; }
.flow-output .flow-label { color: var(--ok); }
.flow-arrow { text-align: center; color: var(--muted); font-size: 1.1rem; line-height: 1.4; }

ul.comments { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.comments li.comment {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.6rem;
}
ul.comments li.comment.resolved { opacity: 0.7; }
ul.comments li.comment p { margin: 0.2rem 0; }

form.comment-form, form.inline-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
form.inline-form { flex-direction: row; align-items: center; }
form.comment-form input, form.inline-form input, form.comment-form textarea, form.comment-form select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
form.comment-form textarea { min-height: 4rem; resize: vertical; }
form.comment-form button, form.inline-form button {
  align-self: flex-start;
  border: none;
  cursor: pointer;
  font: inherit;
}
form.comment-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
form.comment-form label input,
form.comment-form label select { color: var(--text); }

.link-btn {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.85;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.link-btn:hover { opacity: 1; }

.quote-highlight {
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  padding: 0.4rem 0.6rem;
  margin: 0 0 0.4rem;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--accent-dark);
}
.select-comment-popup {
  position: absolute;
  z-index: 50;
  background: var(--text);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.diagram-card { padding-bottom: 1.4rem; }
.proc-diagram { overflow-x: auto; margin-top: 0.5rem; }
.proc-diagram svg { display: block; min-width: 520px; max-width: 100%; margin: 0 auto; }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
.shot-thumb {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.shot-thumb img { display: block; width: 100%; height: 100px; object-fit: cover; }
.shot-page {
  position: absolute; bottom: 0; right: 0;
  background: rgba(22,28,36,.72); color: #fff;
  font-size: 0.68rem; padding: 0.1rem 0.4rem; border-top-left-radius: 6px;
}

#graph-canvas {
  width: 100%;
  height: 480px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.graph-controls { margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.6rem; }

/* ===================================================================
   Barevna disciplina: cervena (--gap) je vyhrazena JEN pro zastaraly
   obsah a chybu. Mezera proti POS NG je oranzova (--warn), neaktivni
   ucet sedy. Kdyz je cervene vsechno, neni cervene nic.
   =================================================================== */

/* --- paticka ------------------------------------------------------- */
.site-footer {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.5rem; padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #fff; font-size: 0.85rem; color: var(--muted);
}
.site-footer a { color: var(--accent-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* --- degradace: prazdno se cte jako chyba -------------------------- */
.degraded-bar {
  background: #fdf1de; border-bottom: 2px solid var(--warn);
  padding: 0.6rem 1.5rem; font-size: 0.9rem; color: #6b4a08;
}
.degraded-bar a { color: var(--accent-dark); font-weight: 600; margin-left: 0.5rem; }

/* --- plovouci bublina pripominek ----------------------------------- */
.feedback-bubble {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.22); text-decoration: none;
}
.feedback-bubble:hover { background: var(--accent-dark); }
.bubble-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px;
  border-radius: 10px; background: var(--warn); color: #fff;
  font-size: 0.72rem; font-weight: 700; display: flex;
  align-items: center; justify-content: center; padding: 0 5px;
}

/* --- globalni hledani Ctrl+K --------------------------------------- */
.qs-open {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px; padding: 0.3rem 0.6rem; font-size: 0.82rem;
  font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 0.3rem;
}
.qs-open:hover { background: rgba(255,255,255,.25); }
.qs-open kbd {
  background: rgba(0,0,0,.25); border-radius: 3px; padding: 0 4px;
  font-size: 0.72rem; font-family: inherit;
}
.qs-backdrop {
  position: fixed; inset: 0; background: rgba(18,26,34,.45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
/* `display:flex` prebiji HTML atribut hidden - bez tohohle je panel videt porad */
.qs-backdrop[hidden] { display: none; }
.qs-panel {
  width: min(680px, 92vw); background: #fff; border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3); overflow: hidden;
}
.qs-panel input[type="search"] {
  width: 100%; border: none; border-bottom: 1px solid var(--border);
  padding: 1rem 1.2rem; font-size: 1.05rem; font-family: inherit; outline: none;
}
.qs-results { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.qs-results li {
  display: flex; align-items: baseline; gap: 0.7rem;
  padding: 0.6rem 1.2rem; cursor: pointer; border-bottom: 1px solid #f1f3f5;
}
.qs-results li.sel { background: #e7f1f4; }
.qs-kind {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent-dark);
  background: #e7f1f4; border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
}
.qs-title { font-weight: 600; }
.qs-detail { color: var(--muted); font-size: 0.82rem; margin-left: auto; }
.qs-empty { color: var(--muted); cursor: default; }
.qs-hint { padding: 0.5rem 1.2rem; font-size: 0.78rem; color: var(--muted); background: #fafbfc; }

/* --- governance pruh u procesu ------------------------------------- */
.governance {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; align-items: center;
  margin-top: 1rem; padding: 0.7rem 0.9rem;
  background: #fafbfc; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.84rem; color: var(--muted);
}
.governance a { color: var(--accent-dark); }
.governance .stale { color: var(--gap); font-weight: 600; }
.precedence {
  margin: 0.6rem 0 0; font-size: 0.82rem; color: var(--muted);
  border-left: 3px solid var(--accent); padding-left: 0.7rem; line-height: 1.5;
}

/* --- ovladani diagramu --------------------------------------------- */
.diagram-tools {
  display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.6rem;
  font-size: 0.82rem; color: var(--muted);
}
.diagram-tools button {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 0.2rem 0.6rem; font-family: inherit; font-size: 0.82rem; cursor: pointer;
}
.diagram-tools button:hover { border-color: var(--accent); color: var(--accent-dark); }
#zoom-pct { min-width: 46px; text-align: center; }
.proc-diagram { overflow: auto; max-width: 100%; max-height: 78vh; }

/* --- kroky podrobne ------------------------------------------------ */
.step-list { list-style: none; margin: 0; padding: 0; }
.step-item {
  padding: 0.8rem 0 0.8rem 0.9rem; border-left: 3px solid var(--border);
  border-bottom: 1px solid #f1f3f5;
}
.step-item:last-child { border-bottom: none; }
.step-item.step-trigger { border-left-color: var(--accent); }
.step-item.step-decision { border-left-color: var(--warn); }
.step-item.step-output { border-left-color: var(--ok); }
.step-item p { margin: 0.25rem 0 0; line-height: 1.55; }
.step-item strong { display: block; margin-top: 0.15rem; }
.step-head { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.step-kind {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
}
.step-kind.trigger { color: var(--accent-dark); }
.step-kind.decision { color: var(--warn); }
.step-kind.output { color: var(--ok); }
.branch-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.branch {
  font-size: 0.86rem; padding: 0.25rem 0.6rem; margin-bottom: 0.25rem;
  border-radius: 6px; border-left: 3px solid var(--border); background: #fafbfc;
}
.branch.ok { border-left-color: var(--ok); }
.branch.warn { border-left-color: var(--warn); }
.branch.stop { border-left-color: #6b7280; }

/* --- rozsah IN/OUT -------------------------------------------------- */
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.scope-grid ul { margin: 0.4rem 0 0; padding-left: 1.1rem; line-height: 1.6; }
.scope-head { font-size: 0.9rem; margin: 0; padding-bottom: 0.3rem; border-bottom: 2px solid; }
.scope-head.in { color: var(--ok); border-color: var(--ok); }
.scope-head.out { color: var(--muted); border-color: var(--border); }

/* --- reference ------------------------------------------------------ */
.ref-item { border-bottom: 1px solid #f1f3f5; padding: 0.55rem 0; }
.ref-item:last-child { border-bottom: none; }
.ref-item summary { cursor: pointer; }
.ref-body { padding: 0.5rem 0 0.2rem 1rem; line-height: 1.6; white-space: pre-line; }

/* --- rozcestnik ----------------------------------------------------- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.8rem; }
.link-tile {
  display: block; padding: 0.8rem 0.9rem; border: 1px solid var(--border);
  border-radius: 8px; text-decoration: none; color: inherit; background: #fff;
}
.link-tile:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.link-tile strong { display: block; color: var(--accent-dark); margin-bottom: 0.2rem; }
.link-tile span { font-size: 0.84rem; color: var(--muted); line-height: 1.45; }

/* --- inventura a monitoring ----------------------------------------- */
.tile-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.tile {
  display: flex; flex-direction: column; align-items: center; min-width: 96px;
  padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--muted); background: #fff; font-size: 0.8rem;
}
.tile.active { border-color: var(--accent); background: #e7f1f4; color: var(--accent-dark); }
.tile-num { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.stat-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 0.8rem; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.7rem; font-weight: 700; color: var(--accent-dark); line-height: 1.1; }
.stat span:last-child { font-size: 0.82rem; color: var(--muted); }
.plain-list { list-style: none; margin: 0; padding: 0; columns: 2; }
.plain-list li { padding: 0.2rem 0; break-inside: avoid; }

/* --- pripominky v2 --------------------------------------------------- */
.comment-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.4rem; }
.reply-list { list-style: none; margin: 0.5rem 0 0 0.8rem; padding: 0 0 0 0.8rem; border-left: 2px solid var(--border); }
.reply-list li { padding: 0.25rem 0; font-size: 0.88rem; }

/* --- navigace: aktivni polozka --------------------------------------- */
.top a.here { border-bottom: 2px solid #fff; }

/* --- mobil: tabulky se preklopi do karet ------------------------------ */
@media (max-width: 720px) {
  .top { gap: 0.4rem; padding: 0.6rem 0.8rem; flex-wrap: wrap; }
  .top .brand { width: 100%; }
  .qs-open kbd { display: none; }
  .scope-grid { grid-template-columns: 1fr; }
  .plain-list { columns: 1; }
  table thead { display: none; }
  table, table tbody, table tr, table td { display: block; width: 100%; }
  table tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.6rem; padding: 0.3rem 0.5rem; }
  table td { border: none; padding: 0.25rem 0; }
  .proc-diagram { max-height: 60vh; }
  /* na telefonu roluje diagram uvnitr karty, ne celou strankou */
  .proc-diagram svg { min-width: 440px; }
  main { padding: 1rem 0.8rem; max-width: 100vw; }
  .lede, .proc-hero p { max-width: 100%; }
  .site-footer { padding: 0.8rem; }
}

.release-comments { border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.9rem; }
.release-comments legend { font-size: 0.85rem; font-weight: 600; color: var(--muted); padding: 0 0.4rem; }
.check-row { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.25rem 0;
             font-size: 0.88rem; color: var(--text); }
.check-row input { margin-top: 0.25rem; }

/* --- bohate sekce procesu -------------------------------------------- */
.section-card h2 { display: flex; align-items: center; gap: 0.5rem; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative; padding: 0.3rem 0 0.3rem 1.7rem; line-height: 1.5;
  border-bottom: 1px solid #f1f3f5;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "☐"; position: absolute; left: 0.2rem; top: 0.25rem;
  color: var(--accent); font-size: 1.05rem;
}
table.facts { width: auto; min-width: 60%; }
table.facts th {
  text-align: left; font-weight: 600; color: var(--muted);
  white-space: nowrap; padding-right: 1.2rem; vertical-align: top;
}
table.facts td { font-weight: 500; }
.warn-list { list-style: none; margin: 0; padding: 0; }
.warn-list li {
  position: relative; padding: 0.35rem 0 0.35rem 1.8rem; line-height: 1.5;
}
.warn-list li::before {
  content: "!"; position: absolute; left: 0.35rem; top: 0.35rem;
  width: 16px; height: 16px; border-radius: 50%; background: var(--warn);
  color: #fff; font-size: 0.7rem; font-weight: 700; text-align: center; line-height: 16px;
}
.section-warning { border-left: 3px solid var(--warn); }
.section-checklist { border-left: 3px solid var(--accent); }
.section-facts { border-left: 3px solid var(--ok); }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { padding: 0.35rem 0; border-bottom: 1px solid #f1f3f5; }
.related-list li:last-child { border-bottom: none; }

/* --- rozdily CZ vs SK ------------------------------------------------- */
.section-diff { border-left: 3px solid var(--warn); }
.diff-table th { font-size: 0.82rem; }
.diff-table td { vertical-align: top; font-size: 0.9rem; }
.diff-table td:nth-child(4) { color: var(--accent-dark); }
.diff-table tr.legislativa td:nth-child(4) { color: var(--muted); }
.country-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }
.country-tabs .pill.on { background: var(--accent); color: #fff; }

/* --- interaktivni diagram -------------------------------------------- */
.diagram-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.diagram-head h2 { margin: 0; }
.diagram-hint { margin: 0.2rem 0 0.6rem; font-size: 0.85rem; }
.link-accent {
  background: none; border: none; color: var(--accent-dark); font: inherit;
  font-size: 0.82rem; cursor: pointer; text-decoration: underline; padding: 0.2rem 0.4rem;
}
.proc-diagram .node { cursor: default; }
.proc-diagram .node.clickable { cursor: pointer; }
.proc-diagram .node.clickable:hover rect,
.proc-diagram .node.clickable:hover polygon { filter: brightness(0.97); stroke-width: 2.4; }
.proc-diagram .node.clickable:focus { outline: none; }
.proc-diagram .node.clickable:focus rect,
.proc-diagram .node.clickable:focus polygon { stroke-width: 3; }
.proc-diagram .node.open rect,
.proc-diagram .node.open polygon { stroke-width: 3; }

/* Diagram vlevo, detail kroku vpravo. Panel je sticky, takze po kliknuti na uzel
   je detail hned videt - drive byl az pod celym (rolovatelnym) diagramem a
   kliknuti vypadalo, ze se nestalo nic. */
.diagram-split {
  display: grid; grid-template-columns: minmax(0, 1fr) 21rem;
  gap: 1rem; align-items: start;
}
#step-details { position: sticky; top: 1rem; }
#step-details.stacked { position: static; }
.step-placeholder {
  border: 1px dashed var(--border); border-radius: 8px; color: var(--muted);
  background: #fafbfc; padding: 0.9rem 1rem; margin: 0; font-size: 0.88rem;
}
@media (max-width: 900px) {
  .diagram-split { grid-template-columns: 1fr; }
  #step-details { position: static; }
}

.step-detail {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; background: #fafbfc; padding: 0.8rem 1rem; margin-top: 0.7rem;
}
#step-details > .step-detail:first-of-type { margin-top: 0; }
.step-detail-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.step-detail-head strong { font-size: 1rem; }
.close-detail {
  margin-left: auto; background: none; border: none; font-size: 1.3rem;
  line-height: 1; color: var(--muted); cursor: pointer; padding: 0 0.3rem;
}
.close-detail:hover { color: var(--text); }
.step-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 0.2rem; }
.meta-item {
  font-size: 0.82rem; background: #fff; border: 1px solid var(--border);
  border-radius: 6px; padding: 0.2rem 0.55rem;
}
.meta-item.sys { border-color: var(--accent); color: var(--accent-dark); }
.meta-key {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-right: 0.3rem;
}
.step-text { margin: 0.5rem 0 0; line-height: 1.6; }
.step-shots { margin-top: 0.7rem; }
.step-shots .shot-thumb img { height: 120px; }

/* --- tisk karty procesu -------------------------------------------------
   Prodejna chce postup na papire u pokladny. Misto generovani PDF na serveru
   (dalsi zavislost a druhy layout, ktery by se rozchazel) tiskneme TUTEZ
   stranku - prohlizec z ni udela PDF pres "Ulozit jako PDF". */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  header.top, .site-footer, .feedback-bubble, .qs-open, .qs-backdrop,
  .diagram-tools, .close-detail, .degraded-bar,
  form, .navrh-form, .comment-form, .raci-edit, .step-placeholder,
  .select-comment-popup, .zmeny-card { display: none !important; }

  body { background: #fff; color: #000; font-size: 10.5pt; }
  main { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  /* Odkaz na papire nic neznamena - cil se vypise, aby sel dohledat. */
  .governance a[href^="/source"]:after,
  .governance a[href^="http"]:after { content: " (" attr(href) ")"; font-size: 8pt; }

  .card {
    box-shadow: none; border: 1px solid #bbb; break-inside: avoid;
    page-break-inside: avoid; margin-bottom: 0.6rem;
  }
  h1 { font-size: 18pt; }
  h2 { font-size: 12pt; }
  .lede { max-width: none; color: #000; }

  /* Diagram ma na obrazovce vlastni rolovani - na papire musi byt cely. */
  .proc-diagram { overflow: visible !important; max-height: none !important; }
  .proc-diagram svg { min-width: 0 !important; width: 100% !important; height: auto; }
  .diagram-split { display: block !important; }
  #step-details { position: static !important; }

  /* Vsechny kroky rozbalene - papir se neproklika. */
  .step-detail[hidden] { display: block !important; }
  .step-detail { break-inside: avoid; page-break-inside: avoid; background: #fff; }
  .step-shots { display: none; }            /* screenshoty tisk jen zdrzi */

  table, .diff-table { break-inside: auto; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  .tisk-hlavicka { display: block !important; }
}
.tisk-hlavicka { display: none; }
.tisk-btn { background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 0.25rem 0.7rem; font: inherit; font-size: 0.82rem; cursor: pointer; }
.tisk-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

/* --- domovska stranka: mapa provozu ---------------------------------- */
.home-hero { margin-bottom: 1.6rem; }
.home-hero h1 { margin-bottom: 0.4rem; }
.home-hero kbd {
  background: #e7f1f4; border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-size: 0.78rem; font-family: inherit;
}
.home-search { display: flex; gap: 0.5rem; margin-top: 0.9rem; max-width: 760px; }
.home-search input {
  flex: 1; padding: 0.7rem 0.9rem; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: 8px;
}
.home-search input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.home-search button { border: none; cursor: pointer; padding: 0.7rem 1.2rem; font-size: 0.95rem; }

.section-title { font-size: 1.15rem; margin: 1.8rem 0 0.2rem; }
.phase-map {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.7rem; margin-top: 0.9rem;
}
.phase-card {
  display: flex; gap: 0.7rem; padding: 0.8rem 0.9rem; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; text-decoration: none;
  color: inherit; box-shadow: var(--shadow);
}
.phase-card:hover { border-color: var(--accent); }
.phase-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
/* min-width: 0 je tu nutne, ne kosmeticke. Flexova polozka se vychozi
   min-width: auto nesmrskne pod sirku sveho obsahu, takze `white-space: nowrap`
   u nazvu postupu roztahl .phase-body sirs nez karta a text pretekal ven -
   `text-overflow: ellipsis` se nikdy neuplatnil, protoze nebylo co orezavat. */
.phase-body { min-width: 0; flex: 1; }
.phase-body strong {
  display: block; color: var(--accent-dark); margin-bottom: 0.3rem;
  overflow-wrap: anywhere;
}
.phase-meta { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.phase-top { list-style: none; margin: 0; padding: 0; }
.phase-top li {
  font-size: 0.82rem; color: var(--muted); padding: 0.12rem 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.phase-top li::before { content: "› "; color: var(--accent); }

.home-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem; margin-top: 0.9rem;
}
.home-tile {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 0.9rem 1rem; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.home-tile:hover { border-color: var(--accent); }
.tile-big {
  display: block; font-family: "Big Shoulders Display", sans-serif;
  font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--accent-dark);
}
.home-tile strong { display: block; margin: 0.25rem 0 0.2rem; }
.home-tile span:last-child { font-size: 0.83rem; color: var(--muted); line-height: 1.45; }

.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.6rem; }
.plain-list.narrow { columns: 1; }
.plain-list.narrow li { padding: 0.3rem 0; border-bottom: 1px solid #f1f3f5; line-height: 1.5; }
.plain-list.narrow li:last-child { border-bottom: none; }

@media (max-width: 720px) {
  .home-cols { grid-template-columns: 1fr; }
  .home-search { flex-direction: column; }
}

/* --- seznam postupu --------------------------------------------------- */
.phase-group h2 { display: flex; align-items: center; gap: 0.5rem; }
.proc-list { list-style: none; margin: 0; padding: 0; }
.proc-list li {
  display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap;
  padding: 0.45rem 0; border-bottom: 1px solid #f1f3f5;
}
.proc-list li:last-child { border-bottom: none; }
.proc-name { font-weight: 500; }
.proc-tags { margin-left: auto; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tag, .tag-country {
  font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 4px;
  background: #f1f3f5; color: var(--muted); white-space: nowrap;
}
.tag-country { background: #e7f1f4; color: var(--accent-dark); font-weight: 600; }
.tag.stale { background: #fbe9e7; color: var(--gap); }

/* --- mapa architektury ------------------------------------------------ */
.arch-map { overflow: auto; max-height: 82vh; border: 1px solid var(--border); border-radius: 8px; }
.arch-map svg { display: block; min-width: 900px; }
.arch-node rect { transition: stroke-width .12s; }
a.arch-node { cursor: pointer; }
a.arch-node:hover rect { stroke-width: 3; }
.arch-node.off rect { opacity: 0.75; }
.arch-legend { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.7rem; }
.legend-item {
  font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 4px;
  background: #f1f3f5; color: var(--muted); border-left: 3px solid var(--border);
}
.legend-stores { border-left-color: #1f7a8c; }
.legend-erp { border-left-color: #2f9e44; }
.legend-middleware { border-left-color: #b5790e; }
.legend-e-commerce-b2c, .legend-e-commerce-b2b { border-left-color: #7048e8; }
.legend-shared-services { border-left-color: #0c8599; }
.legend-warehouse { border-left-color: #c1503a; }
.legend-vendor { border-left-style: dashed; }

/* --- systemy v rozcestniku -------------------------------------------- */
.sys-cat { font-size: 0.95rem; margin: 1.1rem 0 0.3rem; color: var(--muted); }
.sys-list { list-style: none; margin: 0; padding: 0; }
.sys-list li { padding: 0.5rem 0; border-bottom: 1px solid #f1f3f5; }
.sys-list li:last-child { border-bottom: none; }
.sys-head { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.sys-name { font-weight: 600; }
.sys-perex { margin: 0.2rem 0; font-size: 0.86rem; color: var(--muted); line-height: 1.45; }
.sys-procs { margin: 0.2rem 0 0; font-size: 0.84rem; line-height: 1.6; }

/* --- kvalita obsahu, role, navrhy zmen, odpoved hledani ------------------ */
table.kvalita { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.kvalita th { text-align: left; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); padding: 0.4rem 0.5rem; }
table.kvalita td { padding: 0.45rem 0.5rem; border-top: 1px solid var(--border); }
table.kvalita td.cislo { text-align: right; white-space: nowrap; }
table.kvalita tr.sekce-hlavicka td { background: #f7f9fa; }
.bar { display: inline-block; width: 140px; height: 8px; border-radius: 4px;
  background: #e9ecef; overflow: hidden; vertical-align: middle; }
.bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bar-fill.ok { background: #2f9e44; }
.bar-fill.warn { background: #b5790e; }
.bar-fill.stop { background: #c1503a; }
.pct { font-size: 0.8rem; color: var(--muted); margin-left: 0.4rem; }
.trend-up { color: #2f9e44; font-weight: 600; }
.trend-down { color: #c1503a; font-weight: 600; }

.raci { display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: 0.78rem;
  font-weight: 700; color: #fff; margin-right: 0.4rem; }
.raci-A { background: #c1503a; }
.raci-R { background: #1f7a8c; }
.raci-C { background: #b5790e; }
.raci-I { background: #868e96; }
.raci-list { list-style: none; margin: 0; padding: 0; }
.raci-list li { padding: 0.35rem 0; display: flex; align-items: center; gap: 0.4rem;
  flex-wrap: wrap; }
.raci-edit { margin-top: 0.8rem; }
.raci-edit summary { cursor: pointer; color: var(--accent-dark); font-size: 0.88rem; }
table.raci-table { border-collapse: collapse; margin: 0.6rem 0; font-size: 0.88rem; }
table.raci-table th, table.raci-table td { padding: 0.25rem 0.6rem; text-align: center; }
table.raci-table td:first-child, table.raci-table th:first-child { text-align: left; }

.zmeny-card { border-left: 3px solid var(--accent); }
.zmeny-list { list-style: none; margin: 0; padding: 0; }
.zmeny-list li { padding: 0.3rem 0; border-top: 1px solid var(--border); }
.zmeny-list li:first-child { border-top: none; }
.zmena-typ { display: inline-block; min-width: 5.5rem; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.zmena.pribylo .zmena-typ { color: #2f9e44; }
.zmena.ubylo .zmena-typ { color: #c1503a; }

.navrh-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.navrh-duvod { font-style: italic; color: var(--muted); margin: 0.5rem 0; }
.navrh-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 0.6rem 0; }
.navrh-pred, .navrh-po { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; }
.navrh-pred { background: #fdf3f2; border-color: #e9c4bd; }
.navrh-po { background: #f1f8f3; border-color: #bfdcc7; }
.navrh-pred p, .navrh-po p { margin: 0.3rem 0 0; }
.navrh-akce { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.navrh-akce input[type=text] { flex: 1 1 14rem; }
.navrh-form label { display: block; margin: 0.5rem 0; }
.navrh-form textarea, .navrh-form input[type=text] { width: 100%; }
.navrh-cil { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.navrh-cil label { margin: 0; }

.odpoved { border: 1px solid var(--accent); border-left: 4px solid var(--accent);
  border-radius: 8px; background: #f2f8fa; padding: 0.9rem 1.1rem; margin-bottom: 1rem; }
.odpoved-stitek { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-dark); font-weight: 700; }
.odpoved-text { margin: 0.4rem 0 0.6rem; line-height: 1.65; }
.odpoved-zdroj { margin: 0; font-size: 0.86rem; }

@media (max-width: 700px) {
  .navrh-diff { grid-template-columns: 1fr; }
  .bar { width: 90px; }
}

/* --- ucet a dvoufazove overovani --------------------------------------- */
.qr-box { display: flex; gap: 1.4rem; align-items: flex-start; flex-wrap: wrap; }
.qr-box #qr { padding: 0.6rem; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; line-height: 0; }
.qr-vedle { flex: 1 1 18rem; }
.totp-secret code { font-size: 1.05rem; letter-spacing: .12em; word-break: break-all;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.35rem 0.6rem; display: inline-block; }
.zalozni { border-left: 3px solid var(--warn); }
ul.kody { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem; margin: 0.9rem 0; padding: 0; }
ul.kody code { display: block; text-align: center; font-size: 1.05rem; letter-spacing: .06em;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.45rem; }
.zalozni-akce { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.zalozni-akce button { border: 1px solid var(--border); background: #fff; border-radius: 6px;
  padding: 0.35rem 0.8rem; font: inherit; cursor: pointer; }
.flash { background: var(--ok-tint); border: 1px solid var(--ok); color: #1b5e2b;
  border-radius: 8px; padding: 0.6rem 0.9rem; }
.flash.error { background: #fbe9e7; border-color: var(--gap); color: #8a2f1e; }
header.top .pill.warn { font-size: 0.68rem; padding: 0.05rem 0.4rem; }
@media print { .zalozni-akce, header.top, .site-footer, .feedback-bubble { display: none; } }

/* --- logo a firemni barvy ---------------------------------------------- */
header.top a.brand { opacity: 1; text-decoration: none; display: inline-flex; align-items: center; }
header.top a.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; max-width: 220px; display: block; }
.vzhled-nahled {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  margin-top: 0.8rem;
}
.vzhled-nahled .pruh {
  padding: 0.7rem 1rem; color: #fff; display: flex; align-items: center; gap: 1rem;
  font-family: "Big Shoulders Display", sans-serif; font-weight: 700; font-size: 1.2rem;
}
.vzhled-nahled .telo { padding: 0.9rem 1rem; background: var(--card); }
.barva-pole { display: flex; align-items: center; gap: 0.5rem; }
.barva-pole input[type=color] { width: 2.6rem; height: 2.1rem; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: none; cursor: pointer; }
.barva-pole input[type=text] { width: 7.5rem; font-family: ui-monospace, monospace; }
.logo-nahled { background: var(--accent-dark); padding: 0.7rem 1rem; border-radius: 8px;
  display: inline-block; }
.logo-nahled img { height: 34px; width: auto; display: block; }

/* --- pripominka jako jediny vstup (modal z bubliny) --------------------- */
.pripominka-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(22,28,36,.45);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem;
  overflow-y: auto;
}
.pripominka-backdrop[hidden] { display: none; }
.pripominka-panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 40rem; padding: 1.1rem 1.3rem;
}
.pripominka-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.pripominka-head strong { font-size: 1.05rem; }
.navrh-blok { border: 1px dashed var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; }
.navrh-blok summary { cursor: pointer; color: var(--accent-dark); font-size: 0.9rem; }
.navrh-blok .navrh-cil { margin-top: 0.5rem; }
mark.ma-pripominku {
  background: var(--warn-tint); border-bottom: 2px solid var(--warn);
  padding: 0 .1em; border-radius: 2px;
}
.comment-decision { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  margin-top: 0.5rem; }

/* --- onboardingove cesty ------------------------------------------------ */
.cesty { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.9rem; }
.cesta-karta {
  display: block; text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}
.cesta-karta:hover { border-color: var(--accent); }
.cesta-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.cesta-head strong { font-size: 1.02rem; }
.cesta-karta .bar { width: 100%; margin-top: 0.5rem; }
.cesta-stav { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.3rem; }
.cesta-progress { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }

ol.cesta-kroky { list-style: none; counter-reset: krok; margin: 0; padding: 0; }
.cesta-krok {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 0.6rem;
}
.cesta-krok.hotovo { border-left-color: var(--ok); background: #fbfdfb; }
.cesta-krok-hlava { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.cesta-krok-hlava form { margin: 0; }
.odskrtnout {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; font-size: 1rem; line-height: 1; cursor: pointer; color: var(--muted);
}
.cesta-krok.hotovo .odskrtnout { background: var(--ok); border-color: var(--ok); color: #fff; }
.odskrtnout.staticky { display: inline-flex; align-items: center; justify-content: center;
  cursor: default; font-size: 0.85rem; }
.cesta-perex { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.9rem; }

/* --- rozcestnik systemy vs. operativa ---------------------------------- */
.rozcestnik { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.8rem; }
.rozc-karta {
  display: block; text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem;
}
.rozc-karta:hover { border-color: var(--accent); box-shadow: 0 2px 4px rgba(22,28,36,.08), 0 10px 26px -10px rgba(22,28,36,.2); }
.rozc-operativa { border-left-color: var(--ok); }
.rozc-ikona { font-size: 1.6rem; display: block; line-height: 1; margin-bottom: 0.4rem; }
.rozc-karta strong { font-family: "Big Shoulders Display", sans-serif; font-size: 1.45rem;
  display: block; margin-bottom: 0.3rem; }
.rozc-karta p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.92rem; }
.rozc-cisla { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.rozc-cisla strong { font-family: inherit; font-size: 1.05rem; display: inline; color: var(--text); }

.sys-souhrn { display: flex; gap: 1.3rem; flex-wrap: wrap; font-size: 0.88rem;
  color: var(--muted); margin-bottom: 0.8rem; }
.sys-souhrn strong { color: var(--text); font-size: 1.1rem; }
.sys-souhrn a { color: inherit; }

.tech-list { list-style: none; margin: 0; padding: 0; }
.tech-list li { padding: 0.6rem 0; border-top: 1px solid var(--border); }
.tech-list li:first-child { border-top: none; }
.tech-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.proc-systemy { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted); }

/* --- matice odpovednosti ------------------------------------------------ */
.matice-obal { overflow-x: auto; }
table.matice { border-collapse: collapse; font-size: 0.86rem; }
table.matice th, table.matice td { border-bottom: 1px solid var(--border); padding: 0.35rem 0.5rem; }
.matice-proces { min-width: 20rem; text-align: left; }
.matice-role { writing-mode: vertical-rl; transform: rotate(180deg); height: 8rem;
  white-space: nowrap; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.matice-bunka { white-space: nowrap; text-align: center; }
.matice-bunka form { margin: 0; }
tr.bez-a .matice-proces { border-left: 3px solid var(--warn); }
.raci-prep {
  width: 1.35rem; height: 1.35rem; margin: 0 1px; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
  font-size: 0.7rem; color: #c8cfd6; font-weight: 700; line-height: 1;
}
.raci-prep:hover { border-color: var(--accent); color: var(--accent-dark); }
.raci-prep.je { color: #fff; border-color: transparent; }
.raci-prep.je.raci-A { background: #c1503a; }
.raci-prep.je.raci-R { background: #1f7a8c; }
.raci-prep.je.raci-C { background: #b5790e; }
.raci-prep.je.raci-I { background: #868e96; }

@media (max-width: 800px) {
  .rozcestnik { grid-template-columns: 1fr; }
  .matice-proces { min-width: 12rem; }
}
.strankovani { display: flex; gap: 1rem; align-items: center; margin-top: 0.8rem;
  font-size: 0.88rem; }
.raci-prep:disabled { opacity: 0.4; cursor: wait; }
.raci-prep.chyba { border-color: var(--gap); color: var(--gap); }

/* --- diagnostika -------------------------------------------------------- */
.diag-mrizka { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.diag-mrizka .card { margin-bottom: 0; }
.diag-problemy { border-left: 3px solid var(--gap); }
.diag-problemy li { padding: 0.25rem 0; }
.diag-cesta { font-family: ui-monospace, monospace; font-size: 0.75rem; word-break: break-all; }
.diag-dny { list-style: none; margin: 0; padding: 0; }
.diag-dny li { display: flex; align-items: center; gap: 0.7rem; padding: 0.15rem 0; }
.diag-den { min-width: 6.5rem; font-size: 0.85rem; color: var(--muted); }
.diag-dny .cislo { min-width: 2.5rem; text-align: right; font-size: 0.85rem; }
td.cislo, th.cislo { text-align: right; white-space: nowrap; }
.udrzba { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; }
.udrzba form { gap: 0.5rem; }
.mcp-args { font-family: ui-monospace, monospace; font-size: 0.78rem;
  max-width: 34rem; word-break: break-word; }

/* --- souhlas s pristupem aplikace (OAuth) ------------------------------- */
.souhlas { max-width: 42rem; border-left: 3px solid var(--accent); }
.souhlas-akce { display: flex; gap: 0.7rem; align-items: center; margin-top: 1rem; }
.souhlas-akce button { border: 1px solid var(--border); background: #fff;
  border-radius: 6px; padding: 0.45rem 1rem; font: inherit; cursor: pointer; }
.souhlas-akce button.btn { border-color: transparent; }
.bar-fill.warn { background: var(--warn); }
.stat-row { flex-wrap: wrap; }
.kroky-pripojeni { padding-left: 1.2rem; }
.kroky-pripojeni li { margin-bottom: 0.7rem; }
.rucni-token summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.rucni-token[open] summary { margin-bottom: 0.6rem; }

/* "Na šířku": diagram přes celou kartu, detail kroku se schová pod něj. */
.diagram-split.na-sirku { grid-template-columns: 1fr; }
.diagram-split.na-sirku #step-details { position: static; }
.diagram-split.na-sirku .step-placeholder { display: none; }
.diagram-split.na-sirku .proc-diagram svg { min-width: 0; }
.diagram-tools button.aktivni { border-color: var(--accent); color: var(--accent-dark);
  background: var(--accent-tint); }

/* Bublina je tlacitko, ne odkaz - otevira formular pripominky. */
button.feedback-bubble { border: none; font: inherit; cursor: pointer; }
/* Rezim "oznac misto": kurzor nitkovym krizem a zvyrazneni pod mysi. */
body.vybiram-misto, body.vybiram-misto * { cursor: crosshair !important; }
body.vybiram-misto main *:hover { outline: 2px solid var(--accent); outline-offset: 2px; }
main img { cursor: context-menu; }

/* --- rozcestnik administrace ---------------------------------------- */
/* Dlazdice nesou odznacek s cislem, proto uz nadpis neni jen text. */
.link-tile strong .pill { margin-left: 0.35rem; vertical-align: 0.05rem; }
.link-tile span em { color: var(--warn); font-style: normal; }
.link-tile-hlavni { grid-column: 1 / -1; }

.admin-ceka { border-left: 4px solid var(--warn); }
.admin-ceka-ok { border-left-color: var(--ok); }
.admin-ukoly { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.6rem; }
.admin-ukol {
  display: flex; flex-direction: column; min-width: 150px; padding: 0.6rem 0.9rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  text-decoration: none; color: inherit;
}
.admin-ukol:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.admin-ukol strong { font-size: 1.5rem; color: var(--accent-dark); line-height: 1.1; }
.admin-ukol span { font-size: 0.82rem; color: var(--muted); }
.admin-pata { margin-top: 1.6rem; }

.drobecky { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.2rem; }
.drobecky a { color: var(--muted); }

/* --- seznam uctu ----------------------------------------------------- */
.uzivatele td { vertical-align: top; }
.uzivatele .mail { display: block; font-size: 0.8rem; }
.uzivatele .akce { white-space: nowrap; }
.uzivatele .akce form { display: inline-block; margin-right: 0.3rem; }
.uzivatel-form .prepinac { flex-direction: row; align-items: center; gap: 0.4rem; }

/* --- katalog systemu po okruzich ------------------------------------- */
.sys-okruh { border-top: 1px solid var(--border); padding: 0.5rem 0; }
.sys-okruh summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); }
.sys-okruh summary .pill { font-weight: 400; }
.sys-okruh[open] summary { margin-bottom: 0.5rem; }
