* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1d2433;
  background: #f5f6f8;
}

/* login */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-form {
  background: #fff; padding: 2rem 2.5rem; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08); display: grid; gap: .8rem; width: 280px;
  /* minmax(0,…): FF má väčšiu min-content šírku inputu než Chrome a grid
     track sa pod ňu nezmenší — obsah by pretiekol cez okraj karty */
  grid-template-columns: minmax(0, 1fr);
}
.login-form h1 { margin: 0 0 .5rem; font-size: 1.4rem; }
/* explicitné štýly — natívne defaulty sa medzi prehliadačmi líšia (FF: sivé
   3D tlačidlo, výrazný focus ring na autofocusnutom inpute) */
.login-form input, .login-form button { padding: .55rem .7rem; font-size: 1rem; }
.login-form input {
  border: 1px solid #d6dae1; border-radius: 6px; background: #fff;
}
.login-form input:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.login-form button {
  background: #2563eb; color: #fff; border: 0; border-radius: 6px; cursor: pointer;
}
.login-form button:hover { background: #1d4ed8; }
.error { color: #c0392b; margin: 0; }

/* layout */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  background: #fff; padding: .5rem 1rem; border-bottom: 1px solid #e2e5ea;
  position: sticky; top: 0; z-index: 1100;
}
.topbar h1 { font-size: 1.1rem; margin: 0; }
#updated { color: #667085; font-size: .85rem; flex: 1; }
.grab { display: flex; align-items: center; gap: .5rem; }
#grab-btn {
  background: #2563eb; color: #fff; border: 0; border-radius: 6px;
  padding: .45rem 1rem; font-size: .95rem; cursor: pointer;
}
#grab-btn:disabled { background: #93b4f5; cursor: wait; }
#grab-status { font-size: .85rem; color: #667085; }

.filters {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .6rem 1rem; background: #fff; border-bottom: 1px solid #e2e5ea;
}
.filters input, .filters select { padding: .35rem .5rem; font-size: .9rem; }
#f-text { width: 220px; }
#f-rent { width: 120px; }
#f-tag { width: 110px; }
#f-count { margin-left: auto; color: #667085; font-size: .85rem; }

/* multi-select Kategória — details dropdown s checkboxami */
.cat-filter { position: relative; }
.cat-filter summary {
  list-style: none; cursor: pointer; user-select: none; white-space: nowrap;
  border: 1px solid #d6dae1; border-radius: 6px; background: #fff;
  padding: .35rem .5rem; font-size: .9rem;
}
.cat-filter summary::-webkit-details-marker { display: none; }
.cat-filter summary::after { content: ' ▾'; color: #667085; }
.cat-filter[open] summary { border-color: #2563eb; }
.cat-menu {
  position: absolute; z-index: 1200; top: 2.2rem; left: 0; min-width: 220px;
  background: #fff; border: 1px solid #d6dae1; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: .5rem .7rem;
  display: grid; gap: .25rem;
}
.cat-menu label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .9rem; white-space: nowrap; cursor: pointer;
}
.cat-menu button {
  margin-top: .3rem; border: 1px solid #d6dae1; background: #fff; border-radius: 6px;
  padding: .25rem .5rem; cursor: pointer; font-size: .8rem; color: #667085;
}
.cat-menu button:hover { background: #f4f7ff; }

.content { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0; height: calc(100vh - 96px); }
#map { height: 100%; }
.table-wrap { overflow: auto; background: #fff; }

/* ikonka školy na mape — vlastná trieda divIconu bez defaultného bieleho boxu */
.school-icon { font-size: 24px; line-height: 28px; text-align: center; }

/* skrytá mapa — tabuľka na celú šírku */
.content.map-hidden { grid-template-columns: 1fr; }
.content.map-hidden #map { display: none; }
#map-toggle {
  background: #fff; border: 1px solid #d6dae1; border-radius: 6px;
  padding: .35rem .7rem; font-size: .9rem; cursor: pointer;
}

/* zvýraznenie riadkov prepojené s mapou */
tbody tr.hl { background: #fff3bf; }
tbody tr.hl:hover { background: #ffec99; }

/* názov ubytovania = link na originálnu stránku */
.dept-link { color: #2563eb; text-decoration: none; }
.dept-link:hover { text-decoration: underline; }

/* tabuľka */
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { padding: .4rem .5rem; text-align: left; white-space: nowrap; }
thead th {
  position: sticky; top: 0; background: #f0f2f5; cursor: pointer;
  border-bottom: 2px solid #d6dae1; user-select: none;
}
tbody tr { border-bottom: 1px solid #eef0f3; cursor: pointer; }
tbody tr:hover { background: #f4f7ff; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* detail */
tr.detail { background: #fafbfd; cursor: default; }
tr.detail td { white-space: normal; }
/* fit-content: obrázkový stĺpec len taký široký ako obsah (max 420px),
   nech text nezačína až v polovici obrazovky */
.detail-grid { display: grid; grid-template-columns: fit-content(420px) 1fr; gap: 1rem; padding: .5rem 0; }
.detail-imgs { display: flex; flex-wrap: wrap; gap: .5rem; align-content: flex-start; }
.detail-imgs img { height: 120px; border-radius: 6px; object-fit: cover; }
.detail-imgs img.plan { border: 1px solid #d6dae1; background: #fff; object-fit: contain; }
.plan-pdf {
  align-self: flex-start; display: inline-block; border: 1px solid #d6dae1;
  border-radius: 6px; padding: .3rem .6rem; background: #fff;
  color: #2563eb; text-decoration: none; white-space: nowrap;
}
.detail-info p { margin: .25rem 0; }
.detail-head { font-size: 1rem; }

/* tagy */
.chip {
  display: inline-block; background: #e3ebff; color: #1e40af;
  border-radius: 10px; padding: .05rem .5rem; font-size: .78rem; margin: 0 .15rem .15rem 0;
}
.chip-x { border: 0; background: none; cursor: pointer; color: #1e40af; padding: 0 0 0 .2rem; }
.tag-editor { margin-top: .5rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tag-editor input { padding: .3rem .5rem; }

@media (max-width: 900px) {
  .content { grid-template-columns: 1fr; grid-template-rows: 300px 1fr; }
}

/* ---------- hodnotiace profily ---------- */
.profiles-bar {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  padding: .5rem 1rem; background: #fff; border-bottom: 1px solid #e2e5ea;
}
.pchip {
  border: 1px solid #d6dae1; background: #fff; color: #1d2433;
  border-radius: 999px; padding: .25rem .8rem; cursor: pointer; font-size: .85rem;
}
.pchip.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.custom-panel { display: flex; flex-wrap: wrap; gap: .4rem .9rem; width: 100%; padding-top: .3rem; }
.custom-panel[hidden] { display: none; } /* display:flex by inak prebilo UA pravidlo pre [hidden] */
.custom-panel label { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: #667085; }
.custom-panel span { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
td.score { font-weight: 600; }
.score-hi { color: #2e7d32; }
.score-mid { color: #ef6c00; }
.score-lo { color: #98a2b3; }
.breakdown { border-collapse: collapse; margin: .4rem 0; width: auto; } /* nededí table{width:100%} */
.breakdown th, .breakdown td { padding: .15rem .6rem; border-bottom: 1px solid #e2e5ea; font-size: .85rem; }
.breakdown td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- ⓘ nápoveda k tagom ---------- */
.tag-help { position: relative; }
.tag-help summary {
  list-style: none; cursor: pointer; color: #2563eb; font-size: 1rem;
  width: 1.5rem; height: 1.5rem; text-align: center; line-height: 1.5rem;
  border-radius: 50%; user-select: none;
}
.tag-help summary::-webkit-details-marker { display: none; }
.tag-help[open] summary { background: #e3ebff; }
.tag-help-pop {
  position: absolute; z-index: 1200; top: 1.9rem; left: 0; width: 320px;
  background: #fff; border: 1px solid #d6dae1; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: .8rem 1rem; font-size: .85rem;
}
.tag-help-pop p { margin: .35rem 0; }
.tag-help-pop code { background: #eef2f7; border-radius: 4px; padding: 0 .3rem; }

#compare-link { color: #2563eb; text-decoration: none; font-size: .9rem; white-space: nowrap; }

/* ---------- porovnávacia stránka: rebríček ---------- */
.back-link { margin-left: auto; color: #2563eb; text-decoration: none; font-size: .9rem; }
.compare-main { padding: 1rem; max-width: 1100px; margin: 0 auto; }
.topbar label { display: flex; align-items: center; gap: .35rem; font-size: .9rem; color: #667085; }
.topbar select { padding: .3rem .5rem; font-size: .9rem; }
#c-count { color: #667085; font-size: .85rem; }
/* hidden guard — .custom-panel[hidden] precedens: explicitný display by prebil UA pravidlo */
#final-wrap[hidden] { display: none; }

.rank-card {
  display: flex; gap: .8rem; align-items: center; background: #fff;
  border: 1px solid #e2e5ea; border-radius: 8px; padding: .5rem .8rem; margin-bottom: .5rem;
}
.rank-card.out { opacity: .55; background: #fafafa; }
.rank-card > img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.noimg { width: 64px; height: 48px; background: #eef0f3; border-radius: 6px; flex-shrink: 0; }
.rank-num { font-size: 1.2rem; font-weight: 800; color: #2e7d32; width: 1.6rem; text-align: center; flex-shrink: 0; }
.rank-card.out .rank-num { color: #b04444; }
.rank-main { flex: 1; min-width: 0; }
.rank-side { text-align: right; flex-shrink: 0; }
.rank-score { font-size: 1.1rem; font-weight: 700; display: block; }
.scorebar { background: #eef0f5; border-radius: 6px; height: 9px; overflow: hidden; margin-top: .25rem; }
.scorebar i { display: block; height: 100%; background: linear-gradient(90deg, #4c9aff, #2e7d32); }
.xbtn { border: 1px solid #e0b4b4; color: #b04444; background: #fff; border-radius: 6px; padding: .15rem .5rem; cursor: pointer; font-size: .8rem; }
.rank-card.out .xbtn { border-color: #b8d4b8; color: #2e7d32; }
.muted { color: #7a8294; font-size: .8rem; }
.note-view {
  color: #6b5d1f; background: #fffbe8; border: 1px solid #ece2b0;
  border-radius: 5px; padding: 0 .4rem; font-size: .78rem; cursor: pointer;
}
.note-view.empty { color: #98a2b3; background: none; border-style: dashed; border-color: #d6dae1; }
.note-edit { width: 100%; min-height: 3em; font: inherit; }
.hint { color: #667085; }

/* ---------- porovnávacia stránka: finále ---------- */
.final-scroll { overflow-x: auto; background: #fff; border: 1px solid #e2e5ea; border-radius: 8px; }
#final { font-size: .85rem; }
#final th, #final td {
  padding: .45rem .6rem; text-align: center; white-space: normal;
  border-bottom: 1px solid #eef0f3; min-width: 170px; vertical-align: top;
}
#final th.attr, #final td.attr {
  text-align: left; background: #f6f6fa; font-weight: 600;
  min-width: 90px; position: sticky; left: 0; z-index: 1; /* nad .best/.worst pozadiami pri scrolle */
}
#final td.best { background: #d9f2dc; font-weight: 700; }
#final td.worst { background: #fde8e8; }
#final th img { width: 100%; max-width: 220px; height: 110px; object-fit: cover; border-radius: 6px; }
#final img.plan { height: 90px; width: auto; max-width: 100%; object-fit: contain; background: #fff; border: 1px solid #d6dae1; }
#final td.txt { text-align: left; }
#final tr.bd td { font-size: .8rem; color: #475067; }
.fin-name { font-weight: 700; margin-top: .2rem; }
.noimg.big { width: 100%; height: 110px; }
.bd-toggle { font-size: .8rem; font-weight: 400; color: #667085; margin-left: .8rem; }
#cmap { height: 320px; margin-top: 1rem; border-radius: 8px; }
.fin-pin {
  background: #2563eb; color: #fff; border-radius: 50%; text-align: center;
  line-height: 22px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
