/* Revel portál – barvy vychází z původní aplikace Revel (styles/style.css):
   tmavě modrá hlavička #001620–#183d4d, ledové pozadí #e0f4f9, záložky #a0e4ff,
   hlavička tabulek #173948 s textem #56bdd1. Tmavý režim je z nich odvozený. */

:root {
  --navy-900: #001620;
  --navy-800: #0b2530;
  --navy-700: #173948;
  --navy-600: #183d4d;
  --navy-500: #13475f;
  --cyan-500: #56bdd1;
  --cyan-300: #a0e4ff;
  --cyan-200: #c5eff9;
  --ice-100: #e0f4f9;
  --ice-50: #f6fcfe;
  --link-legacy: #006699;

  --bg: #eaf7fb;
  --surface: #ffffff;
  --surface-2: var(--ice-50);
  --surface-3: var(--ice-100);
  --border: #b9e8f4;
  --border-strong: #8ccfe2;
  --text: #0e2a35;
  --text-muted: #4a6a77;
  --link: #00668f;
  --primary: #13475f;
  --primary-hover: #0b3447;
  --primary-text: #ffffff;
  --accent: var(--cyan-500);
  --focus: #ff9900;
  --header-bg: linear-gradient(180deg, #183d4d 0%, #0b2530 55%, #001620 100%);
  --header-text: #e3f6fb;
  --header-accent: var(--cyan-300);
  --th-bg: var(--navy-700);
  --th-text: var(--cyan-500);
  --open: #c2410c;
  --open-bg: #ffedd5;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --danger: #b91c1c;
  --shadow: 0 1px 2px rgb(10 40 55 / .06), 0 4px 16px rgb(10 40 55 / .06);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07161d;
    --surface: #0d222b;
    --surface-2: #112b36;
    --surface-3: #163542;
    --border: #1f4554;
    --border-strong: #2c5d70;
    --text: #e3f2f7;
    --text-muted: #94b4c0;
    --link: #7fd4f4;
    --primary: #56bdd1;
    --primary-hover: #7fd4f4;
    --primary-text: #001620;
    --header-bg: linear-gradient(180deg, #0f2c38 0%, #061a22 60%, #000d13 100%);
    --th-bg: #0a1d25;
    --open: #fdba74;
    --open-bg: #3b2312;
    --ok: #86efac;
    --ok-bg: #11301f;
    --danger: #fca5a5;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 16px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07161d;
  --surface: #0d222b;
  --surface-2: #112b36;
  --surface-3: #163542;
  --border: #1f4554;
  --border-strong: #2c5d70;
  --text: #e3f2f7;
  --text-muted: #94b4c0;
  --link: #7fd4f4;
  --primary: #56bdd1;
  --primary-hover: #7fd4f4;
  --primary-text: #001620;
  --header-bg: linear-gradient(180deg, #0f2c38 0%, #061a22 60%, #000d13 100%);
  --th-bg: #0a1d25;
  --open: #fdba74;
  --open-bg: #3b2312;
  --ok: #86efac;
  --ok-bg: #11301f;
  --danger: #fca5a5;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 16px rgb(0 0 0 / .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }

/* ---------- topbar (navy jako v původním Revelu) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  padding: .55rem 1.25rem; background: var(--header-bg); color: var(--header-text);
  border-bottom: 4px solid var(--header-accent);
}
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  background: var(--cyan-300); color: var(--navy-900); font-weight: 800; font-size: 1.1rem;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .15);
}
.brand-mark.lg { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 12px; }
.brand-text { font-weight: 700; font-size: 1.1rem; display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-weight: 500; font-size: .72rem; color: var(--cyan-500); letter-spacing: .02em; }
.mainnav { display: flex; gap: .25rem; margin-left: 1rem; }
.mainnav a {
  color: var(--header-text); text-decoration: none; padding: .45rem .8rem; border-radius: 8px 8px 0 0;
  font-weight: 600; font-size: .92rem; opacity: .9;
}
.mainnav a:hover { background: rgb(160 228 255 / .15); opacity: 1; }
.mainnav a[aria-current="page"] { background: var(--cyan-300); color: var(--navy-500); opacity: 1; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  background: transparent; border: 1px solid rgb(160 228 255 / .35); color: var(--header-text);
  border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 1.05rem;
}
.icon-btn:hover { background: rgb(160 228 255 / .15); }
.nav-toggle { display: none; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: inline; }
}
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .2rem .4rem; border-radius: 8px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: rgb(160 228 255 / .15); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--cyan-500); color: var(--navy-900); font-weight: 700; }
.uname { font-size: .9rem; }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .4rem; display: grid;
}
.usermenu-pop a, .usermenu-pop button { display: block; text-align: left; padding: .5rem .7rem; border-radius: 6px; color: var(--text); text-decoration: none; width: 100%; font: inherit; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--surface-3); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); flex: 1; }
.sidebar {
  position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto;
  padding: 1.25rem 1rem 2rem; border-right: 1px solid var(--border); background: var(--surface-2);
}
.nav-group { margin-bottom: 1.25rem; }
.nav-group-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 .4rem .5rem; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .38rem .55rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: .9rem;
}
.nav-group a:hover { background: var(--surface-3); }
.nav-group a[aria-current="page"] { background: var(--primary); color: var(--primary-text); font-weight: 600; }
.main { padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 3rem; min-width: 0; }
.main:focus { outline: none; }
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .8rem 1.25rem;
  background: var(--header-bg); color: var(--cyan-500); font-size: .82rem; border-top: 1px solid #7fd4f4;
}
.footer a { color: var(--cyan-300); }

/* ---------- komponenty ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card.flush { padding: 0; }
.card.narrow { max-width: 640px; }
.card.empty { text-align: center; padding: 2.5rem 1rem; }
.stack { display: grid; gap: .9rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.head-actions { display: flex; gap: .5rem; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--link); margin: 0 0 .3rem; }
.subhead { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin: 1.4rem 0 .6rem; }
.crumbs { font-size: .88rem; margin-bottom: .7rem; color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; }
.btn-small { padding: .3rem .65rem; font-size: .82rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linklike.danger { color: var(--danger); }
form.inline { display: inline; }

.field { display: grid; gap: .3rem; font-size: .88rem; font-weight: 600; min-width: 0; }
.field > span { color: var(--text-muted); }
.field.grow { flex: 1 1 260px; }
input, select, textarea {
  font: inherit; font-weight: 400; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .65rem; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form-row { display: flex; flex-wrap: wrap; gap: .9rem; align-items: end; }
.form-row > .field:not(.grow) { flex: 0 1 200px; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.flash { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: currentColor; }
.flash-error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.flash-info { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
:root[data-theme="dark"] .flash-error { background: #3a1414; color: #fecaca; border-color: #7f1d1d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flash-error { background: #3a1414; color: #fecaca; border-color: #7f1d1d; } }

.pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--surface-3); color: var(--text-muted); white-space: nowrap; }
.pill-open { background: var(--open-bg); color: var(--open); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.kbd { border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 .3rem; background: var(--surface-2); }

.kind { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .45rem; border-radius: 4px; }
.kind-note { background: var(--surface-3); color: var(--link); }
.kind-fix { background: #fee2e2; color: #991b1b; }
.kind-addition { background: #e0e7ff; color: #3730a3; }
.kind-question { background: #fef9c3; color: #854d0e; }
:root[data-theme="dark"] .kind-fix { background: #3a1414; color: #fecaca; }
:root[data-theme="dark"] .kind-addition { background: #1e1b4b; color: #c7d2fe; }
:root[data-theme="dark"] .kind-question { background: #3a2e0a; color: #fde68a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kind-fix { background: #3a1414; color: #fecaca; }
  :root:not([data-theme="light"]) .kind-addition { background: #1e1b4b; color: #c7d2fe; }
  :root:not([data-theme="light"]) .kind-question { background: #3a2e0a; color: #fde68a; }
}

.status { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; border: 1px solid; }
.status-review { color: var(--link); border-color: var(--border-strong); background: var(--surface-2); }
.status-confirmed { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.status-needs_work { color: var(--open); background: var(--open-bg); border-color: transparent; }
.status-rejected { color: var(--text-muted); background: var(--surface-3); border-color: transparent; text-decoration: line-through; }
.status-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .7rem .9rem; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 1.2rem; border: 1px dashed var(--border-strong); }
.status-bar .muted { margin-right: .4rem; }
.status-btn.is-on { outline: 2px solid currentColor; outline-offset: 1px; }

/* ---------- přehled ---------- */
.hero {
  background: var(--header-bg); color: var(--header-text); border-radius: 14px; padding: 2rem clamp(1.25rem, 4vw, 2.5rem);
  margin-bottom: 1.25rem; border-bottom: 6px solid var(--cyan-300); position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgb(86 189 209 / .35), transparent 70%); }
.hero .eyebrow { color: var(--cyan-500); }
.hero h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); max-width: 30ch; }
.hero .lead { max-width: 75ch; color: #cbe9f2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; position: relative; z-index: 1; }
.hero .btn { background: rgb(255 255 255 / .08); color: #fff; border-color: rgb(160 228 255 / .4); }
.hero .btn:hover { background: rgb(255 255 255 / .16); }
.hero .btn-primary { background: var(--cyan-300); color: var(--navy-900); border-color: var(--cyan-300); }
.hero .btn-primary:hover { background: #c5eff9; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; display: grid; gap: .2rem; box-shadow: var(--shadow); }
.stat-num { font-size: 1.9rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-accent .stat-num { color: var(--open); }
.stat-label { color: var(--text-muted); font-size: .85rem; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: .3rem; }
.meter span { display: block; height: 100%; background: var(--ok); }
.doclist { list-style: none; padding: 0; margin: 0; }
.doclist li { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.doclist li:last-child { border-bottom: 0; }
.howto { padding-left: 1.2rem; margin: 0; display: grid; gap: .45rem; }
.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.activity p { margin: .2rem 0; }

/* ---------- dokument ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 1.25rem; align-items: start; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.doc-meta .btn { margin-left: auto; }
.toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: .85rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.toc h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.toc .lvl-3 { padding-left: .8rem; font-size: .8rem; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover, .toc a.is-active { color: var(--link); text-decoration: underline; }

.prose { max-width: 90ch; overflow-wrap: anywhere; }
.prose h1 { font-size: 1.8rem; padding-bottom: .4rem; border-bottom: 3px solid var(--cyan-300); }
.prose h2 { margin-top: 2rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.prose h3 { margin-top: 1.5rem; }
.prose p, .prose li { max-width: 80ch; }
.prose blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose code { background: var(--surface-3); padding: .1rem .3rem; border-radius: 4px; }
.prose pre { background: var(--navy-900); color: #d6f1f8; padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose img { max-width: 100%; }
.anchored { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.anchor-link { opacity: 0; color: var(--text-muted); text-decoration: none; font-weight: 400; }
.anchored:hover .anchor-link, .anchor-link:focus { opacity: 1; }
.comment-here {
  margin-left: auto; font-size: .8rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  border-radius: 999px; padding: .1rem .55rem; cursor: pointer; opacity: .55; transition: opacity .15s; font-weight: 600;
}
.anchored:hover .comment-here, .comment-here:focus-visible, .comment-here.has-count { opacity: 1; }
.comment-here.has-count { background: var(--open-bg); color: var(--open); border-color: transparent; }
.comment-here .count:not(:empty) { margin-left: .25rem; }
.mermaid { background: var(--surface); padding: 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); overflow-x: auto; text-align: center; }

.table-wrap { overflow-x: auto; margin: 1rem 0; border-radius: var(--radius-sm); }
.prose table, .table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.prose th, .table th { background: var(--th-bg); color: var(--th-text); text-align: left; padding: .55rem .7rem; font-weight: 700; border-bottom: 3px solid #388fb6; white-space: nowrap; }
.prose td, .table td { padding: .5rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tbody tr:nth-child(even), .table tbody tr:nth-child(even) { background: var(--surface-2); }
.prose tbody tr:hover, .table tbody tr:hover { background: var(--surface-3); }
.table input, .table select { padding: .3rem .45rem; font-size: .85rem; margin-bottom: .2rem; }
.table tr.inactive { opacity: .55; }
.switch { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; }
.switch input { width: auto; }

/* ---------- komentáře ---------- */
.comments { margin-top: 1.5rem; }
.comments-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem; }
.comment-form { border-left: 4px solid var(--accent); }
.comment-form.flash-target { animation: pulse 1.2s ease 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(86 189 209 / .7); } 100% { box-shadow: 0 0 0 14px rgb(86 189 209 / 0); } }
.thread { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.comment.status-resolved { opacity: .75; background: var(--surface-2); }
.comment:target, .reply:target { outline: 3px solid var(--accent); }
.comment header, .reply header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .88rem; }
.comment-body { margin: .5rem 0; overflow-wrap: anywhere; }
.anchor-ref { font-size: .8rem; }
.reply { margin: .6rem 0 0 1rem; padding: .6rem .9rem; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; font-size: .86rem; margin-top: .5rem; }
.reply-box { flex: 1 1 100%; order: 2; }
.reply-box summary { list-style: none; display: inline; }
.reply-box summary::-webkit-details-marker { display: none; }
.reply-box[open] form { margin-top: .6rem; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg-btn { background: var(--surface); border: 0; padding: .35rem .8rem; font: inherit; font-size: .85rem; color: var(--text); cursor: pointer; text-decoration: none; }
.seg-btn + .seg-btn { border-left: 1px solid var(--border-strong); }
.seg-btn.is-on { background: var(--primary); color: var(--primary-text); }

/* ---------- use cases ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.filters .field:not(.grow) { flex: 0 1 190px; }
.uc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.uc-card {
  display: grid; gap: .3rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow); border-left: 4px solid var(--cyan-500); transition: transform .12s, border-color .12s;
}
.uc-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.uc-code { font-family: var(--mono); font-size: .78rem; color: var(--link); font-weight: 700; }
.uc-title { font-weight: 700; }
.uc-actor { font-size: .84rem; }
.uc-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.uc-fields { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: .2rem 1.2rem; margin: 0; }
.uc-fields dt { font-weight: 700; color: var(--text-muted); padding: .55rem 0; border-top: 1px solid var(--border); }
.uc-fields dd { margin: 0; padding: .55rem 0; border-top: 1px solid var(--border); }
.uc-fields.compact dt, .uc-fields.compact dd { padding: .3rem 0; font-size: .85rem; }
.uc-fields ol, .uc-fields ul { margin: 0; padding-left: 1.3rem; }
.steps li { padding: .15rem 0; }
.revisions { margin-top: 1rem; font-size: .9rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; }
.credentials { border: 2px solid var(--accent); }
.secret { font-size: 1.1rem; padding: .2rem .5rem; background: var(--surface-3); border-radius: 4px; user-select: all; }

/* ---------- přihlášení ---------- */
body.bare { background: var(--header-bg); background-attachment: fixed; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(420px, 100%); background: var(--surface); border-radius: 14px; padding: 2rem; box-shadow: 0 20px 60px rgb(0 0 0 / .35); border-top: 6px solid var(--cyan-300); }
.login-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.login-head h1 { margin: 0; }
.login-head p { margin: 0; color: var(--text-muted); font-size: .9rem; }

/* ---------- responzivita ---------- */
@media (max-width: 1100px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .mainnav { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(320px, 86vw); z-index: 40;
    transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 35; }
  .sidebar::before { content: "Menu"; display: block; font-weight: 800; margin-bottom: 1rem; }
  .uname { display: none; }
  .uc-fields { grid-template-columns: minmax(0, 1fr); }
  .uc-fields dd { border-top: 0; padding-top: 0; }
  .card { padding: 1rem; }
  .mobile-nav { display: grid !important; }
}
.mobile-nav { display: none; gap: .2rem; margin-bottom: 1.2rem; }
.mobile-nav a { padding: .5rem .55rem; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 600; }
.mobile-nav a:hover { background: var(--surface-3); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media print {
  .topbar, .sidebar, .footer, .toc, .comments, .comment-here, .anchor-link, .status-bar { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; color: #000; }
}
