/* Kompas — vizuální rodina RelAc: navy #14284F, modrá #1668D8, zelená #10935F */
* { box-sizing: border-box; }
/* Atribut hidden musí vyhrát i nad explicitním display: flex/grid níže —
   bez tohoto pravidla zůstane přihlašovací okno viditelné i po přihlášení
   a nefungovalo by přepínání záložek (main#tab-mapa má display: grid). */
[hidden] { display: none !important; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: #1b2437; background: #f4f6fa; }
h1, h2, h3 { margin: .2em 0 .5em; color: #14284F; }
h2 { font-size: 1.05rem; } h3 { font-size: .92rem; margin-top: 1.1em; }
.muted { color: #6b7280; font-size: .82rem; font-weight: 400; }
.error { background: #fde8e8; color: #b42318; padding: .5em .8em; border-radius: 6px; margin-bottom: .8em; font-size: .9rem; }

.btn { border: 1px solid #cbd5e1; background: #fff; color: #14284F; border-radius: 6px; padding: .45em .9em; cursor: pointer; font-size: .88rem; }
.btn:hover { background: #eef2f8; }
.btn.primary { background: #1668D8; border-color: #1668D8; color: #fff; }
.btn.primary:hover { background: #14284F; }
.btn.small { padding: .25em .6em; font-size: .8rem; }
.btn.danger { color: #b42318; }
.btn.wide { width: 100%; margin-top: .6em; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: .5em; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #14284F 0%, #1668D8 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 2em 2.2em; width: 340px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-logo { text-align: center; margin-bottom: 1em; }
.login-logo h1 { margin: .3em 0 0; }
.login-box label { display: block; font-size: .85rem; color: #374151; margin-top: .8em; }
.login-box input { width: 100%; padding: .5em .6em; margin-top: .25em; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .95rem; }

/* header */
header { display: flex; align-items: center; gap: 1.2em; background: #fff; border-bottom: 1px solid #e5e7eb; padding: .45em 1em; position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: .5em; font-size: 1.05rem; color: #14284F; }
.ver { font-size: .7rem; background: #eef2f8; border-radius: 4px; padding: .1em .4em; color: #1668D8; }
nav { display: flex; gap: .3em; }
.tab { border: 0; background: none; padding: .5em .9em; cursor: pointer; font-size: .92rem; color: #6b7280; border-radius: 6px; }
.tab.active { color: #14284F; background: #eef2f8; font-weight: 600; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: .8em; }
.bell { position: relative; border: 0; background: none; font-size: 1.1rem; cursor: pointer; }
.badge { position: absolute; top: -6px; right: -8px; background: #dc2626; color: #fff; font-size: .65rem; border-radius: 8px; padding: 0 .35em; }
.notif-panel { position: fixed; top: 52px; right: 12px; width: 380px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.18); z-index: 50; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: .6em .9em; border-bottom: 1px solid #eef0f4; }
.notif-item { padding: .55em .9em; border-bottom: 1px solid #f1f3f7; font-size: .85rem; }
.notif-item.unread { background: #f0f6ff; }
.notif-item .muted { display: block; }

/* layout mapy */
main#tab-mapa { display: grid; grid-template-columns: 300px 1fr 320px; height: calc(100vh - 49px); }
aside { background: #fff; overflow-y: auto; padding: .9em 1em; }
#criteria { border-right: 1px solid #e5e7eb; }
#results { border-left: 1px solid #e5e7eb; }
#map { min-height: 300px; }

/* kritéria */
.crit { margin: .7em 0; padding: .55em .7em; border: 1px solid #eef0f4; border-radius: 8px; background: #fbfcfe; }
.crit.off { opacity: .55; }
.crit-head { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; gap: .4em; }
.crit-head b { color: #1668D8; min-width: 3.2em; text-align: right; }
.crit input[type=range] { width: 100%; margin: .35em 0 0; accent-color: #1668D8; }
.crit .sub { display: flex; gap: .5em; align-items: center; margin-top: .4em; font-size: .8rem; color: #374151; }
.crit .sub input[type=number] { width: 5.2em; padding: .2em .3em; border: 1px solid #cbd5e1; border-radius: 4px; }
.crit .hint { font-size: .72rem; color: #8b93a3; margin-top: .3em; }
.chips { display: flex; flex-wrap: wrap; gap: .3em; }
.chip { border: 1px solid #cbd5e1; background: #fff; border-radius: 14px; padding: .2em .65em; font-size: .76rem; cursor: pointer; }
.chip.on { background: #1668D8; border-color: #1668D8; color: #fff; }
.row { display: flex; gap: .5em; align-items: center; margin: .6em 0; flex-wrap: wrap; }
.inline { font-size: .85rem; }
select { padding: .35em .5em; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .85rem; background: #fff; max-width: 100%; }
.src { margin-top: 1.2em; line-height: 1.5; }

/* výsledky */
#topList { margin: .3em 0 1em; padding-left: 1.4em; }
#topList li { margin: .3em 0; cursor: pointer; font-size: .9rem; }
#topList li:hover { color: #1668D8; }
#topList .score { float: right; color: #10935F; font-weight: 600; }
#topList small { color: #6b7280; }
#detail { border-top: 2px solid #eef0f4; padding-top: .7em; }
#detail table { width: 100%; border-collapse: collapse; font-size: .84rem; }
#detail td { padding: .28em 0; border-bottom: 1px solid #f1f3f7; }
#detail td:last-child { text-align: right; font-weight: 600; }
#detail td .vs { color: #8b93a3; font-weight: 400; font-size: .76rem; }
#detail .links { margin: .6em 0; display: flex; gap: .6em; flex-wrap: wrap; }
#detail .links a { color: #1668D8; font-size: .84rem; }
.radar-mini { margin-top: .6em; }
.radar-mini .item { font-size: .8rem; padding: .3em 0; border-bottom: 1px solid #f1f3f7; }

/* radar tab */
main#tab-radar { padding: 1em 1.4em; max-width: 1000px; margin: 0 auto; }
.radar-head { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: .8em 1em; margin-bottom: 1em; }
#radarList .item { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: .6em .9em; margin: .45em 0; font-size: .88rem; }
#radarList .item a { color: #14284F; text-decoration: none; font-weight: 600; }
#radarList .item a:hover { color: #1668D8; }
.cat { display: inline-block; font-size: .7rem; border-radius: 4px; padding: .12em .45em; margin-right: .5em; vertical-align: 1px; }
.cat.vzdelavani { background: #e1effe; color: #1668D8; }
.cat.kultura { background: #fdf2d9; color: #92600a; }
.cat.pozemky { background: #def7ec; color: #10935F; }
.cat.dotace { background: #ede9fe; color: #6d28d9; }
.cat.ostatni { background: #f1f3f7; color: #6b7280; }

.maplibregl-popup-content { font-family: inherit; font-size: .85rem; padding: .5em .8em; }

@media (max-width: 1100px) {
  main#tab-mapa { grid-template-columns: 260px 1fr; }
  #results { display: none; }
}

/* označení ukázkového (anonymního) režimu */
.guest-tag { background: #fdf2d9; color: #92600a; border-radius: 10px; padding: .15em .6em; font-size: .74rem; font-weight: 600; }

/* seznam škol (detail obce i záložka Školy) */
.skoly { margin: .4em 0 .8em; }
.skola { border-bottom: 1px solid #f1f3f7; padding: .45em 0; font-size: .85rem; }
.zar { display: inline-block; background: #eef2f8; color: #47536b; border-radius: 5px; padding: .1em .45em; font-size: .74rem; margin: .15em .15em 0 0; }
#skolyList .item { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: .6em .9em; margin: .45em 0; font-size: .88rem; }
#skolyList .k-obci { color: #1668D8; font-size: .8rem; margin-left: .5em; text-decoration: none; }
main#tab-skoly { padding: 1em 1.4em 3em; max-width: 1000px; margin: 0 auto; }
#detail h3 { margin: 1em 0 .3em; font-size: .88rem; }
