* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f6f8;
  color: #1a1a1a;
  padding: 1rem;
  font-size: 14px;
  line-height: 1.4;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}
h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ts { color: #888; font-size: 0.8rem; }
.ts strong { color: #555; font-weight: 600; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 1rem;
  background: #fff;
  padding: 0.6rem 0.4rem;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.stat {
  padding: 0.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  min-width: 70px;
  border-right: 1px solid #eee;
}
.stat:last-child { border-right: none; }
.separator {
  width: 1px;
  background: #ccc;
  margin: 0 0.3rem;
}
.stats .label {
  font-size: 0.65rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.stats .value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  margin-top: 0.1rem;
}

.filter {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.filter a {
  padding: 0.35rem 0.75rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #444;
  font-size: 0.8rem;
  font-weight: 500;
}
.filter a:hover { border-color: #999; }
.filter a.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

table {
  width: 100%;
  background: #fff;
  border-collapse: collapse;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.82rem;
}
th {
  background: #f0f1f4;
  padding: 0.55rem 0.6rem;
  text-align: left;
  font-weight: 600;
  color: #555;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  padding: 0.55rem 0.6rem;
  border-top: 1px solid #eee;
  vertical-align: top;
}
.id { color: #888; font-family: ui-monospace, SF Mono, Menlo, monospace; font-size: 0.78rem; }
.title { font-weight: 500; color: #222; line-height: 1.3; }
.parent { color: #888; font-size: 0.72rem; margin-top: 0.2rem; }
.seq {
  background: #f0f1f4;
  padding: 0 0.3rem;
  border-radius: 3px;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 0.7rem;
  color: #555;
  margin-right: 0.3rem;
}
.meta { color: #555; font-size: 0.78rem; }
.dim { color: #999; font-size: 0.75rem; }
.updated { color: #777; font-size: 0.75rem; font-family: ui-monospace, SF Mono, Menlo, monospace; white-space: nowrap; }

.chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}
.chip-gray    { background: #e5e7eb; color: #374151; }
.chip-blue    { background: #dbeafe; color: #1e40af; }
.chip-green   { background: #d1fae5; color: #065f46; }
.chip-yellow  { background: #fef3c7; color: #92400e; }
.chip-orange  { background: #ffedd5; color: #9a3412; }
.chip-red     { background: #fee2e2; color: #991b1b; }
.chip-purple  { background: #ede9fe; color: #5b21b6; }

.links { white-space: nowrap; }
.links a {
  text-decoration: none;
  margin-right: 0.4rem;
  font-size: 1rem;
  opacity: 0.85;
}
.links a:hover { opacity: 1; }
.repo-tag {
  display: inline-block;
  background: #1f2937;
  color: #fff;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
}
.repo-tag:hover { background: #2563eb; }

.empty {
  text-align: center;
  color: #999;
  padding: 2rem;
  font-style: italic;
}

footer {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.75rem;
}
footer code {
  background: #fff;
  padding: 0 0.3rem;
  border-radius: 3px;
  border: 1px solid #ddd;
}
footer a { color: #2563eb; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Drawer (slide-in z pravé strany při kliku na řádek) ─────────── */
tr.row:hover { background: #fafbfd; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 640px;
  max-width: 95vw;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer header {
  padding: 1rem 1.25rem 0.8rem;
  border-bottom: 1px solid #eee;
  background: #fafbfd;
  position: relative;
}
.drawer header .close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #888;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.drawer header .close:hover { background: #eee; color: #222; }
.drawer-title {
  font-size: 1rem;
  font-weight: 600;
  margin-right: 2.5rem;
  line-height: 1.4;
}
.drawer-title .dim { font-weight: 400; }
.drawer header .dim { font-size: 0.78rem; margin-top: 0.3rem; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 2rem;
}
.drawer-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  margin: 0.2rem 0 0.6rem;
}
.drawer-section-title + .flow { margin-top: 0; }
.drawer-section-title:not(:first-child) { margin-top: 1.5rem; }

/* ASCII flow diagram */
.flow {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  background: #1e1e22;
  color: #d4d4d8;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  white-space: pre;
  overflow-x: auto;
}
.flow .step-done    { color: #34d399; }              /* green */
.flow .step-current { color: #fbbf24; font-weight: 700; }  /* amber, bold */
.flow .step-future  { color: #6b7280; }              /* gray */
.flow .line-done    { color: #34d399; opacity: 0.7; }
.flow .line-current { color: #fbbf24; opacity: 0.7; }
.flow .line-future  { color: #4b5563; }

/* Per-node info sections */
.nodes { display: flex; flex-direction: column; gap: 0.6rem; }
.node {
  padding: 0.75rem 0.85rem;
  border-radius: 6px;
  background: #f7f8fa;
  border-left: 3px solid #cbd5e1;
}
.node-done    { border-left-color: #10b981; background: #f0fdf4; }
.node-current { border-left-color: #f59e0b; background: #fffbeb; }
.node-future  { border-left-color: #cbd5e1; background: #f9fafb; opacity: 0.7; }
.node h3 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 0.5rem;
}
.node-current h3 { color: #92400e; }
.node-done h3 { color: #065f46; }
.kv { display: flex; flex-direction: column; gap: 0.3rem; }
.kv-row {
  display: flex;
  gap: 0.75rem;
  font-size: 0.82rem;
  align-items: flex-start;
}
.kv-row .k {
  flex: 0 0 90px;
  color: #777;
  font-size: 0.75rem;
}
.kv-row .v { flex: 1; color: #222; word-break: break-word; }
.kv-row .v code {
  background: #fff;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  border: 1px solid #ddd;
  font-size: 0.78rem;
}
.kv-row .v a {
  color: #2563eb;
  text-decoration: none;
}
.kv-row .v a:hover { text-decoration: underline; }
.approach {
  font-size: 0.8rem;
  white-space: pre-wrap;
  line-height: 1.5;
  color: #333;
  max-height: 200px;
  overflow-y: auto;
}
.warn { color: #b45309; font-weight: 500; }

.coverage { margin-top: 0.3rem; font-size: 0.7rem; color: #777; }
.coverage-pct { font-weight: 600; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.coverage-high { color: #047857; }
.coverage-med  { color: #b45309; }
.coverage-low  { color: #b91c1c; }

.assessment {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.assessment .pct-bar {
  background: #e5e7eb;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.2rem 0 0.4rem;
}
.assessment .pct-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.3s ease;
}
.assessment .pct-fill.med { background: #f59e0b; }
.assessment .pct-fill.low { background: #ef4444; }
.assessment ul { margin: 0.2rem 0 0.4rem 1rem; }
.assessment li { margin-bottom: 0.2rem; line-height: 1.4; }
.assessment .misint {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  margin-top: 0.4rem;
  font-style: italic;
  color: #78350f;
}
