:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #5f6368;
  --border: #dedede;
  --accent: #1f5fbf;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #c62828;
  --info: #5f6368;
  --ok-bg: #e9f6ec;
  --warn-bg: #fff6dd;
  --bad-bg: #fdecec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --card: #1e1e1e;
    --text: #ececec;
    --muted: #a0a0a0;
    --border: #333333;
    --accent: #6ea8ff;
    --ok: #4cc26a;
    --warn: #e0b341;
    --bad: #ff6b6b;
    --info: #a0a0a0;
    --ok-bg: #16291b;
    --warn-bg: #2d2610;
    --bad-bg: #331a1a;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { margin: 0 0 8px; font-size: 1.8rem; }
.lead { margin: 0 0 24px; color: var(--muted); }

label { display: block; font-weight: 600; margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
button {
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: wait; }
input:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#out { margin: 24px 0; }
.progress, .note { color: var(--muted); margin: 0 0 12px; }
.progress::after { content: ""; display: inline-block; width: .8em; height: .8em; margin-left: 8px;
  border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .progress::after { animation: none; } }

.item {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.item h2 { display: flex; gap: 10px; align-items: baseline; margin: 0; font-size: 1rem; }
.item p, .item > ul { margin: 6px 0 0 30px; color: var(--muted); }
.icon { flex: none; width: 20px; text-align: center; font-weight: 700; }
.ok { border-left-color: var(--ok); } .ok .icon { color: var(--ok); }
.warn { border-left-color: var(--warn); } .warn .icon { color: var(--warn); }
.bad { border-left-color: var(--bad); } .bad .icon { color: var(--bad); }
.info .icon { color: var(--info); }
.verdict { padding: 16px; }
.verdict h2 { font-size: 1.2rem; }
.verdict.ok { background: var(--ok-bg); } .verdict.warn { background: var(--warn-bg); } .verdict.bad { background: var(--bad-bg); }

.item p.hint { font-size: .85rem; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree { margin: 8px 0 0 30px; }
.tree ul { margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--border); }
.tree > li + li { border-top: 1px solid var(--border); }
.tree .node { position: relative; display: grid; grid-template-columns: 90px 1fr; column-gap: 12px; padding: 6px 0; }
.tree ul > li > .node::before { content: ""; position: absolute; left: -16px; top: 1.05em; width: 12px; border-top: 1px solid var(--border); }
.tree .weak > .node { border-left: 3px solid var(--bad); padding-left: 8px; margin-left: -11px; }
.tree .missing { padding: 6px 0; color: var(--warn); font-size: .9rem; }
.tree .role { grid-row: span 4; color: var(--muted); font-size: .85rem; }
.tree strong { overflow-wrap: anywhere; }
.tree .key { color: var(--muted); font-size: .9rem; }
.tree .flag { color: var(--bad); font-weight: 600; font-size: .9rem; }
.tree .cert { grid-column: 2; margin-top: 2px; font-size: .85rem; color: var(--text); }
.tree .cert summary { cursor: pointer; color: var(--accent); font-weight: 400; }
.tree .cert dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0 0; }
.tree .cert dt { color: var(--muted); }
.tree .cert dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

main > details { margin-top: 32px; color: var(--muted); }
summary { cursor: pointer; font-weight: 600; color: var(--text); }
details li { margin: 8px 0; }

@media (max-width: 480px) {
  .row { flex-direction: column; }
  .tree .node { grid-template-columns: 1fr; }
  .tree .role { grid-row: auto; }
  .tree .cert { grid-column: 1; }
  .tree .cert dl { grid-template-columns: 1fr; }
  .tree ul { margin-left: 4px; padding-left: 12px; }
  .item p, .item > ul, .tree { margin-left: 0; }
}
.paths h3 { margin: 14px 0 0 30px; font-size: .9rem; font-weight: 600; }
@media (max-width: 480px) { .paths h3 { margin-left: 0; } }

/* Both languages are in the page; html[lang] (set by app.js before the body renders) picks one. */
html[lang="en"] [data-lang="cs"], html:not([lang="en"]) [data-lang="en"] { display: none !important; }
main { position: relative; }
.lang { position: absolute; top: 32px; right: 16px; }
.lang button { padding: 4px 10px; font-size: .85rem; font-weight: 500; color: var(--accent); background: none; border: 1px solid var(--border); }
@media (max-width: 480px) { .lang { top: 12px; } }
