:root {
  --akcent: #2563EB; --akcent-svetly: #DBEAFE;
  --text: #0F172A; --sedy: #64748B; --linka: #E2E8F0; --pozadi: #F1F5F9; --karta: #FFFFFF;
  --cerveny: #DC2626; --oranzovy: #EA580C; --zeleny: #16A34A; --mark: #FFEDD5; --mark-text: #C2410C;
  --r: 14px; --stin: 0 1px 2px rgba(15,23,42,.06), 0 1px 8px rgba(15,23,42,.04);
}
@media (prefers-color-scheme: dark) {
  :root { --text: #E2E8F0; --sedy: #94A3B8; --linka: #1E293B; --pozadi: #0B1220; --karta: #111A2E;
          --akcent-svetly: #1E3A8A; --mark: #431407; --mark-text: #FDBA74; --stin: none; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--pozadi); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--akcent); text-decoration: none; }

/* horni lista */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px;
  padding: calc(env(safe-area-inset-top) + 8px) 8px 8px; background: var(--karta); border-bottom: 1px solid var(--linka); }
.titul { flex: 1; font-weight: 600; font-size: 17px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ikona { border: 0; background: none; width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; cursor: pointer; }
.ikona:active { background: var(--pozadi); }
.ikona svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--akcent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.menu { position: fixed; z-index: 20; right: 8px; top: calc(env(safe-area-inset-top) + 56px); background: var(--karta); border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(0,0,0,.18); min-width: 240px; padding: 6px; border: 1px solid var(--linka); }
.menu-ja { padding: 10px 12px; color: var(--sedy); font-size: 13px; border-bottom: 1px solid var(--linka); }
.menu-ja b { color: var(--text); display: block; font-size: 15px; }
.menu-polozka { display: block; padding: 12px; border-radius: 10px; color: var(--text); }
.menu-polozka select { display: block; width: 100%; margin-top: 6px; padding: 8px; border-radius: 8px; border: 1px solid var(--linka); background: var(--pozadi); }

main { padding: 12px 12px calc(env(safe-area-inset-bottom) + 24px); max-width: 900px; margin: 0 auto; }

/* hledani */
.hledani { position: sticky; top: calc(env(safe-area-inset-top) + 57px); z-index: 5; background: var(--pozadi); padding: 4px 0 8px; margin: -4px 0 0; }
.pole { display: flex; align-items: center; background: var(--karta); border: 1.5px solid var(--linka); border-radius: 16px; padding: 0 6px 0 14px; box-shadow: var(--stin); }
.pole:focus-within { border-color: var(--akcent); }
.pole svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--sedy); stroke-width: 2.2; stroke-linecap: round; }
.pole input { flex: 1; border: 0; outline: 0; background: none; padding: 14px 10px; font-size: 17px; min-width: 0; }
.pole button { border: 0; background: var(--akcent); color: #fff; border-radius: 12px; padding: 9px 14px; font-weight: 600; cursor: pointer; }
.chipy { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chipy::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--linka); background: var(--karta); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--akcent-svetly); border-color: var(--akcent); color: var(--akcent); font-weight: 600; }
@media (prefers-color-scheme: dark) { .chip.on { color: #BFDBFE; } }

.info { color: var(--sedy); font-size: 13px; margin: 6px 4px 10px; }
.info.chyba { color: var(--cerveny); }
.sekce { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--sedy); text-transform: uppercase; margin: 18px 4px 8px; display: flex; justify-content: space-between; align-items: center; }
.sekce a, .sekce button { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 13px; border: 0; background: none; color: var(--akcent); cursor: pointer; }

/* karty */
.karta { background: var(--karta); border-radius: var(--r); box-shadow: var(--stin); padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--linka); }
.klik { cursor: pointer; }
.klik:active { transform: scale(.99); }
.partner { display: flex; gap: 12px; align-items: center; }
.partner.vybrany { border-color: var(--akcent); box-shadow: 0 0 0 1px var(--akcent); }
.inicialy { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; }
.partner .t { flex: 1; min-width: 0; }
.partner .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mala { color: var(--sedy); font-size: 13px; }
.sipka { color: var(--sedy); font-size: 20px; }

.dok .r1 { display: flex; align-items: center; gap: 8px; }
.dok .cislo { font-weight: 600; }
.dok .datum { margin-left: auto; color: var(--sedy); font-size: 13px; white-space: nowrap; }
.dok .firma { font-weight: 500; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dok .text { color: var(--sedy); font-size: 13px; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dok .shoda { font-size: 13px; margin-top: 6px; color: var(--sedy); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.dok .r3 { display: flex; gap: 10px; align-items: baseline; margin-top: 6px; font-size: 13px; flex-wrap: wrap; }
.dok .castka { font-weight: 600; margin-left: auto; white-space: nowrap; }
.dok.storno { opacity: .55; }
.dok.storno .cislo { text-decoration: line-through; }
mark { background: var(--mark); color: var(--mark-text); font-weight: 600; border-radius: 3px; padding: 0 1px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.zbyva { color: var(--oranzovy); font-weight: 600; }
.zbyva.po { color: var(--cerveny); }
.pozn { color: var(--oranzovy); font-size: 12px; margin-top: 4px; }
.vice { display: block; width: 100%; padding: 12px; border: 1px dashed var(--linka); background: none; border-radius: var(--r); color: var(--akcent); font-weight: 600; cursor: pointer; }

/* karta partnera */
.hlava h1 { font-size: 22px; margin: 4px 4px 2px; line-height: 1.2; }
.hlava .mala { margin: 0 4px; }
.kontakty { display: flex; gap: 8px; margin: 12px 0 4px; overflow-x: auto; scrollbar-width: none; }
.kontakty a { flex: none; display: flex; align-items: center; gap: 6px; background: var(--karta); border: 1px solid var(--linka); border-radius: 12px; padding: 9px 12px; font-weight: 600; font-size: 14px; }
.kontakty svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dlazdice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
@media (min-width: 700px) { .dlazdice { grid-template-columns: repeat(4, 1fr); } }
.dl { background: var(--karta); border: 1px solid var(--linka); border-radius: var(--r); padding: 12px; position: relative; overflow: hidden; }
.dl .a { font-size: 12px; color: var(--sedy); }
.dl .b { font-size: 20px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; }
.dl .c { font-size: 12px; color: var(--sedy); margin-top: 2px; }
.dl.cerveny::before, .dl.oranzovy::before, .dl.zeleny::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; }
.dl.cerveny::before { background: var(--cerveny); } .dl.cerveny .b { color: var(--cerveny); }
.dl.oranzovy::before { background: var(--oranzovy); } .dl.oranzovy .b { color: var(--oranzovy); }
.dl.zeleny::before { background: var(--zeleny); } .dl.zeleny .b { color: var(--zeleny); }
.roky .rok { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--linka); font-size: 14px; }
.roky .rok:last-child { border-bottom: 0; }
.bar { height: 10px; background: var(--akcent-svetly); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--akcent); border-radius: 5px; }
.roky .kc { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.roky .kc small { color: var(--sedy); display: block; font-size: 11px; }
.taby { display: flex; gap: 4px; background: var(--karta); border: 1px solid var(--linka); border-radius: 12px; padding: 4px; margin: 16px 0 10px; overflow-x: auto; scrollbar-width: none; }
.taby button { flex: 1 0 auto; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--sedy); cursor: pointer; white-space: nowrap; }
.taby button.on { background: var(--akcent); color: #fff; }
.pol { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linka); font-size: 14px; }
.pol:last-child { border-bottom: 0; }
.pol .t { flex: 1; min-width: 0; }
.pol .k { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* detail */
.udaje { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; word-break: break-word; }
.udaje dt { color: var(--sedy); }
.udaje dd { margin: 0; }
details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.poznamka { white-space: pre-wrap; font-size: 14px; }

/* stavy */
.nacitani { text-align: center; color: var(--sedy); padding: 48px 12px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--akcent-svetly); border-top-color: var(--akcent); border-radius: 50%; animation: toc .8s linear infinite; margin: 0 auto 14px; }
@keyframes toc { to { transform: rotate(360deg); } }
.prazdno { text-align: center; color: var(--sedy); padding: 40px 16px; }
.prazdno h2 { color: var(--text); font-size: 18px; margin: 0 0 6px; }
.prihlaseni { text-align: center; padding: 64px 20px; }
.prihlaseni .logo { width: 72px; height: 72px; margin: 0 auto 16px; }
.prihlaseni h1 { font-size: 24px; margin: 0 0 6px; }
.btn-ms { display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; background: var(--karta); border: 1px solid var(--linka); padding: 12px 20px; border-radius: 12px; font-weight: 600; color: var(--text); box-shadow: var(--stin); }
.btn-ms svg { width: 20px; height: 20px; }
.nedavne .chip { display: inline-block; margin: 0 6px 8px 0; }
