*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface2: #f0ede9;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.18);
  --text: #1a1916;
  --text-muted: #7a7670;
  --text-light: #a8a49e;
  --accent: #335b40;
  --accent-light: #e8f0ea;
  --green: #3b6d11;
  --green-bg: #eaf3de;
  --purple: #4a3b9c;
  --purple-bg: #eeedfe;
  --red: #8b2020;
  --red-bg: #fceaea;
  --teal: #0d5c45;
  --teal-bg: #e1f5ee;
  --star: #d4880a;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  box-sizing: border-box;
}

.header-inner {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 56px;
}

.logo {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  flex-shrink: 0;
}

.logo span { color: #335b40; }

.search-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}

#search:focus {
  outline: none;
  border-color: var(--border-hover);
  background: var(--surface);
}

.search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}

.search-suggestions.open { display: block; }

.search-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}

.search-suggestion:hover { background: var(--surface2); }
.search-suggestion .sug-type { color: var(--text-light); font-size: 11px; margin-left: 6px; }

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
  margin-left: 4px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #639922;
  animation: pulse 2.5s ease-in-out infinite;
}

.dot.err { background: var(--accent); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Filters ── */
.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.filter-inner {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-inner::-webkit-scrollbar { display: none; }
.filter-inner #f-kraj { margin-left: auto; }

select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7670' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

select:focus { outline: none; border-color: var(--border-hover); }
select.active { border-color: var(--accent); color: var(--accent); }

/* ── Stats bar ── */
.stats-bar {
  max-width: 860px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.stat strong {
  display: block;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

/* ── Setup screen ── */
#setup-screen {
  max-width: 560px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: left;
}

.setup-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.setup-card ol {
  padding-left: 1.2rem;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 2;
  margin-bottom: 1.25rem;
}

.setup-card ol li b { color: var(--text); font-weight: 500; }

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
}

.input-row input:focus { outline: none; border-color: var(--border-hover); background: var(--surface); }

.btn {
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.88; }

.setup-status {
  font-size: 12px;
  margin-top: 8px;
  min-height: 18px;
  color: var(--text-muted);
}

.setup-status.ok { color: var(--green); }
.setup-status.err { color: var(--red); }

/* ── Card list ── */
#main {
  display: none;
}

.list {
  max-width: 860px;
  margin: 1rem auto 3rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  scroll-margin-top: 70px;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card.lgbt-card {
  background: linear-gradient(135deg,
    rgba(162,89,247,0.07) 0%,
    rgba(75,156,245,0.07) 20%,
    rgba(61,184,122,0.07) 40%,
    rgba(246,208,77,0.07) 60%,
    rgba(244,145,58,0.07) 80%,
    rgba(232,68,90,0.07) 100%);
}

.card.lgbt-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--surface2);
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.avatar.f { background: #fbe7ee; color: #c06888; }
.avatar.m { background: #e1ebdd; color: #4a7a4f; }

.card-info { flex: 1; min-width: 0; }

.card-name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}

.card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.stars {
  font-size: 14px;
  margin-top: 4px;
  letter-spacing: 1px;
  color: var(--star);
}

.stars .empty-star { color: var(--border-hover); }

.chevron {
  color: var(--text-light);
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s;
  margin-top: 2px;
}

.chevron.open { transform: rotate(180deg); }

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 500;
}

.b-kraj { background: var(--teal-bg); color: var(--teal); }
.b-lgbt { background: var(--purple-bg); color: var(--purple); }
.b-nofees { background: var(--green-bg); color: var(--green); }
.b-fees { background: var(--red-bg); color: var(--red); }

/* ── Detail panel ── */
.detail {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.detail.open { display: block; }

.detail a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
}

.detail a:hover { text-decoration: underline; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.detail-grid > div { min-width: 0; }

.di-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.di-val {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.detail-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.section-group-title {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.detail-section .di-label { margin-bottom: 4px; }

.detail-section .di-val {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
}

.detail-section .di-val.dark { color: var(--text); }

/* ── Empty / loading ── */
.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-size: 14px;
}

.empty svg { display: block; margin: 0 auto 12px; color: var(--text-light); }

/* ── Carousel ── */
.car-track-wrap { overflow: hidden; transition: height .25s ease; }
.car-track { display: flex; align-items: flex-start; transition: transform .3s ease; }
.car-slide { min-width: 100%; padding: 4px 0; }
.car-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.car-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.car-btn:hover:not(:disabled) { border-color: var(--border-hover); }
.car-btn:disabled { opacity: 0.3; cursor: default; }
.car-dots-row { display: flex; justify-content: center; gap: 5px; margin-top: 10px; margin-bottom: 1em; }
.car-dots { display: flex; gap: 5px; }
.car-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-hover); transition: background .2s; }
.car-dot.active { background: var(--accent); }
.car-counter { font-size: 12px; color: var(--text-muted); min-width: 32px; text-align: center; }
.cta-btn { padding: 6px 14px; background: #335b40; color: #fff; border-radius: 20px; font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.cta-btn:hover { opacity: 0.88; }

/* ── Layout ── */
.layout { max-width: 1060px; margin: 1rem auto 3rem; padding: 0 1.5rem; display: flex; gap: 16px; align-items: flex-start; }
.sidebar { width: 175px; flex-shrink: 0; position: sticky; top: 110px; }
.filters-toggle-btn { display: none; }
.main-content { flex: 1; min-width: 0; }
.stats-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 0.75rem; flex-wrap: wrap; }
.stats-row .stats-bar { margin: 0; padding: 0; flex: 1; }
.main-content .stats-bar { margin: 0; padding: 0; }
.main-content .list { margin: 0; padding: 0; }

/* ── Sidebar groups ── */
.sb-group { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 6px; background: var(--surface); }
.reset-filters-btn { width: 100%; display: flex; align-items: center; gap: 6px; padding: 9px 12px; margin-bottom: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; font-family: inherit; color: var(--text-muted); cursor: pointer; text-align: left; transition: border-color .15s, color .15s, background .15s; }
.reset-filters-btn:hover { border-color: var(--border-hover); color: var(--accent); background: var(--accent-light); }
.reset-filters-btn svg { flex-shrink: 0; }
.sb-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: none; border: none; cursor: pointer; font-size: 13px; font-family: inherit; font-weight: 500; color: var(--text); text-align: left; }
.sb-toggle:hover { background: var(--surface2); }
.sb-toggle svg { transition: transform .2s; flex-shrink: 0; }
.sb-toggle.open svg { transform: rotate(180deg); }
.sb-options { display: none; padding: 4px 8px 10px; flex-direction: column; gap: 4px; }
.sb-options.open { display: flex; }

/* ── Chips ── */
.chip { padding: 4px 10px; border: 1px solid var(--border); border-radius: 20px; font-size: 12px; font-family: inherit; background: var(--surface2); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, color .15s; text-align: left; }
.chip:hover { border-color: var(--border-hover); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.review-header { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }
.review-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.review-num { font-size: 12px; color: var(--text-muted); margin-left: 4px; }

.ig-link { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); text-decoration: none; flex-shrink: 0; }
.ig-link:hover { color: var(--text); }

.about-btn { background: none; border: 1px solid var(--border); border-radius: 20px; padding: 5px 13px; font-size: 13px; font-family: inherit; color: var(--text-muted); cursor: pointer; flex-shrink: 0; transition: border-color 0.15s, color 0.15s; }
.about-btn:hover { border-color: var(--border-hover); color: var(--text); }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 500; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 2rem; max-width: 480px; width: 100%; position: relative; display: flex; flex-direction: column; gap: 1rem; box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
.modal-box h2 { font-size: 17px; font-weight: 600; }
.modal-box p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.modal-box p strong { color: var(--text); }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 22px; color: var(--text-light); cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-img { width: 100%; border-radius: var(--radius-sm); display: block; }
.modal-ig { display: inline-block; font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 500; }
.modal-ig:hover { text-decoration: underline; }

.project-intro { background: var(--accent-light); border-bottom: 1px solid var(--border); padding: 10px 1.5rem; }
.project-intro-inner { max-width: 1000px; margin: 0 auto; font-size: 13px; color: var(--text); line-height: 1.5; }
.project-intro-inner p { margin-bottom: 8px; }
.project-intro-inner p:last-child { margin-bottom: 0; }
.project-intro-extra { display: none; }
.project-intro-extra.open { display: block; }
.project-intro-toggle { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 13px; font-family: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
  body { overflow-x: hidden; font-size: 16px; }
  header { padding: 8px 1rem; }
  .header-inner { gap: 6px; height: auto; flex-wrap: wrap; justify-content: space-between; }
  .search-wrap { flex-basis: 100%; order: 1; }
  .ig-link span { display: none; }
  .live-badge { display: none; }
  .filter-bar { padding: 0 1rem; }
  .filter-inner { gap: 6px; flex-wrap: wrap; }
  .filter-inner #f-kraj { margin-left: 0; }
  select { font-size: 12px; padding: 5px 8px; padding-right: 20px; }
  .cta-btn { font-size: 12px; padding: 5px 10px; }
  .layout { flex-direction: column; padding: 0 1rem; gap: 10px; align-items: stretch; }
  .filters-toggle-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; font-weight: 500; color: var(--text); cursor: pointer; }
  .filters-toggle-btn svg { transition: transform .2s; }
  .filters-toggle-btn.open svg { transform: rotate(180deg); }
  .sidebar { width: 100%; position: static; display: none; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
  .sidebar.open { display: flex; }
  .main-content { width: 100%; }
  .sb-group { flex: 1; min-width: 130px; margin-bottom: 0; }
  .reset-filters-btn { flex-basis: 100%; margin-bottom: 0; }
  .sb-options { flex-direction: row; flex-wrap: wrap; }
  .main-content .list { padding: 0; }
  .main-content .stats-bar { padding: 0; gap: 6px; }
  .stats-row { flex-wrap: wrap; }
  .stat { padding: 5px 10px; font-size: 12px; }
  .stat strong { font-size: 16px; }
  .card { padding: 12px 14px; scroll-margin-top: 100px; }
  .detail-grid { grid-template-columns: 1fr; }
  .card-name { font-size: 14px; }
  .avatar { width: 36px; height: 36px; font-size: 12px; }
  .sb-toggle { font-size: 12px; padding: 8px 10px; }
  .chip { font-size: 11px; padding: 3px 8px; }
  .review-header { gap: 8px; flex-wrap: wrap; }
  .review-label { font-size: 13px; }
  .review-num { font-size: 13px; }
  .car-btn { width: 40px; height: 40px; font-size: 24px; }
  .car-counter { font-size: 13px; }
  .car-dot { width: 8px; height: 8px; }
}
