/* Knižnica súčiastok – dopĺňa css/style.css */
body.kniznica { overflow: auto; display: block; min-height: 100%; }
.kniznica .lista { position: sticky; top: 0; z-index: 30; }
.kniznica a.tl { text-decoration: none; color: var(--text); }
.k-karty { display: flex; gap: 4px; }
.k-karty button {
  border: 1px solid transparent; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; color: var(--text2);
}
.k-karty button:hover { background: #f1f4f7; }
.k-karty button.aktivna { background: var(--akcent2); color: var(--akcent); font-weight: 600; border-color: #bfe3dd; }

.k-strana { display: grid; grid-template-columns: 250px 1fr; gap: 16px; padding: 16px; align-items: start; }
.k-strana[hidden] { display: none; }
.k-stlpce { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.k-strana[data-strana="zdroje"] { grid-template-columns: minmax(0, 860px); justify-content: center; }

/* filtre */
.k-filtre { position: sticky; top: 70px; background: #fff; border: 1px solid var(--ciara); border-radius: 12px; padding: 14px; }
.k-filtre input[type=search] { width: 100%; padding: 8px 10px; border: 1px solid var(--ciara); border-radius: 8px; }
.k-filtre h4 { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); }
.k-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.k-chips button {
  border: 1px solid var(--ciara); background: #fff; border-radius: 99px; padding: 3px 10px; font-size: 12.5px; cursor: pointer;
}
.k-chips button small { color: var(--text2); margin-left: 3px; }
.k-chips button.aktivna { background: var(--akcent); border-color: var(--akcent); color: #fff; }
.k-chips button.aktivna small { color: #d1fae5; }
.k-check { display: flex; gap: 7px; align-items: center; font-size: 13px; margin: 5px 0; cursor: pointer; }
.k-legenda { font-size: 12px; color: var(--text2); line-height: 1.8; margin-top: 14px; }

/* tabuľka */
.k-obsah { min-width: 0; }
.k-info { color: var(--text2); font-size: 13px; margin: 2px 2px 8px; }
.k-tabulka-obal { overflow: auto; background: #fff; border: 1px solid var(--ciara); border-radius: 12px; }
.k-tabulka { border-collapse: collapse; width: 100%; font-size: 13px; }
.k-tabulka th, .k-tabulka td { padding: 7px 10px; border-bottom: 1px solid #eef1f4; text-align: left; vertical-align: top; }
.k-tabulka th { position: sticky; top: 0; background: #f7f9fb; color: var(--text2); font-weight: 600; white-space: nowrap; cursor: pointer; user-select: none; }
.k-tabulka th.zoradene::after { content: " ▲"; font-size: 10px; }
.k-tabulka th.zoradene.dole::after { content: " ▼"; }
.k-tabulka tbody tr { cursor: pointer; }
.k-tabulka tbody tr:hover { background: #f5fbfa; }
.k-tabulka tbody tr.vybrany { background: var(--akcent2); }
.k-tabulka td .pod { display: block; font-size: 11.5px; color: var(--text2); }
.k-tabulka td.mono, .k-tabulka td code { font-family: var(--mono); font-size: 12px; }
.k-tabulka .num { text-align: right; font-variant-numeric: tabular-nums; }
.k-badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; white-space: nowrap; }
.k-badge.ok { background: #dcfce7; color: #166534; }
.k-badge.plan { background: #eef1f4; color: #64748b; }
.k-badge.wokwi { background: #ede9fe; color: #5b21b6; }
.k-pozor-ikona { color: #b45309; }

/* detail */
.k-detail {
  position: fixed; top: 64px; right: 12px; bottom: 12px; width: min(420px, calc(100vw - 24px)); z-index: 40; overflow: auto;
  background: #fff; border: 1px solid var(--ciara); border-radius: 14px; box-shadow: 0 18px 40px rgba(15, 23, 42, .2); padding: 18px 20px;
}
.k-detail h2 { margin: 0 30px 2px 0; font-size: 19px; }
.k-detail .pod { color: var(--text2); font-size: 13px; }
.k-detail .zatvorit { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 22px; cursor: pointer; color: #94a3b8; }
.k-detail dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 13.5px; margin: 14px 0; }
.k-detail dt { color: var(--text2); }
.k-detail dd { margin: 0; }
.k-detail .k-varovanie { background: #fffbeb; color: #92400e; border-radius: 8px; padding: 9px 11px; font-size: 13px; margin: 12px 0; }
.k-detail .piny { display: flex; flex-wrap: wrap; gap: 4px; }
.k-detail .piny span { font-family: var(--mono); font-size: 12px; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }

/* karty s kalkulačkami */
.k-karta { background: #fff; border: 1px solid var(--ciara); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.k-karta h2 { margin: 0 0 10px; font-size: 17px; }
.k-karta h3 { margin: 18px 0 8px; font-size: 14px; }
.k-siroka { grid-column: 1 / -1; }
.k-text li { line-height: 1.6; margin: 4px 0; }
.k-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.k-form label, .k-riadok label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text2); }
.k-form input, .k-form select, .k-riadok input, .k-riadok select, .r-pasy select {
  padding: 6px 8px; border: 1px solid var(--ciara); border-radius: 7px; background: #fff; color: var(--text); font-size: 14px;
}
.k-riadok { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.k-pozn { color: var(--text2); font-size: 12.5px; }
.r-vysledok { margin-top: 12px; padding: 10px 12px; background: #f0fdfa; border-radius: 8px; font-size: 15px; line-height: 1.6; }
.r-vysledok b { font-size: 17px; }
.r-vysledok .zle { color: var(--cervena); font-weight: 600; }
.r-obrazok { width: 100%; max-width: 420px; display: block; margin: 8px auto; }
.r-pasy { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.r-pasy label { font-size: 11.5px; color: var(--text2); display: flex; flex-direction: column; gap: 3px; }
.e-tab td.e12 { font-weight: 700; }

@media (max-width: 900px) {
  .k-strana { grid-template-columns: 1fr; }
  .k-filtre { position: static; }
  .k-karty button { padding: 6px 8px; }
}
.k-tlacidla { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.k-detail a.tl.hlavne { color: #fff; }
