:root {
    --accent: #0f766e;
    --accent-hover: #115e59;
    --accent-soft: #e6f4f1;
    --ms: #b45309;
    --ms-soft: #fef3c7;
    --zs: #1d4ed8;
    --zs-soft: #dbeafe;
    --ss: #7e22ce;
    --ss-soft: #f3e8ff;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color-rgb: 17, 94, 89;
}

body {
    background: #fbfcfc;
}

.text-accent { color: var(--accent) !important; }

.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-color: #fff;
}

.btn-outline-accent {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
}

.site-nav { background: #fff; }
.site-nav .nav-link.active { color: var(--accent); font-weight: 600; }

.site-footer { background: #f4f7f6; }
.site-footer a { text-decoration: none; }

.hero {
    background: linear-gradient(135deg, var(--accent-soft) 0%, #fff 70%);
    border-bottom: 1px solid #e3ece9;
}

.hero-search { max-width: 640px; }

.type-card { border-color: #e3ece9; transition: box-shadow .15s, transform .15s; }
.type-card:hover { box-shadow: 0 .5rem 1rem rgba(15, 118, 110, .12); transform: translateY(-1px); }

.type-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.type-icon.type-ms, .type-pill.type-ms { background: var(--ms-soft); color: var(--ms); }
.type-icon.type-zs, .type-pill.type-zs { background: var(--zs-soft); color: var(--zs); }
.type-icon.type-ss, .type-pill.type-ss { background: var(--ss-soft); color: var(--ss); }

.type-pill {
    display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px;
}

.district-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
    padding: .3rem .75rem; border: 1px solid #dbe5e2; border-radius: 999px; background: #fff;
    font-size: .875rem; color: var(--bs-body-color); text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.soon-card { background: var(--accent-soft); border: 0; }

.school-card { border-color: #e3ece9; transition: box-shadow .15s; }
.school-card:hover { box-shadow: 0 .4rem .9rem rgba(0, 0, 0, .07); }
.school-card h3 { line-height: 1.35; }

.badge-private { background: #fdf2f8; color: #9d174d; border: 1px solid #fbcfe8; }
.badge-forest { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge.text-bg-light { color: #374151 !important; font-weight: 500; }

.stat {
    text-align: center; background: #fff; border: 1px solid #e3ece9; border-radius: 10px; padding: .4rem .8rem;
    min-width: 92px;
}
.stat-value { font-size: 1.35rem; font-weight: 700; }
.stat-label { font-size: .72rem; color: #6b7280; }

.map { height: 380px; border-radius: 12px; border: 1px solid #e3ece9; z-index: 0; }
@media (max-width: 575px) { .map { height: 280px; } }

.map-dot {
    width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.map-dot.type-ms { background: var(--ms); }
.map-dot.type-zs { background: var(--zs); }
.map-dot.type-ss { background: var(--ss); }
.map-dot.main { width: 20px; height: 20px; box-shadow: 0 0 0 3px rgba(15, 118, 110, .45); }

.filter-card { border-color: #e3ece9; background: #fff; }
.district-table td { white-space: nowrap; }
/* headers and names wrap, so a phone fits the name, the time to the centre and the sorted column */
.district-table th, .district-table td:first-child { white-space: normal; vertical-align: bottom; }
.district-table td:first-child { vertical-align: middle; }
.facts dt { font-weight: 500; color: #6b7280; }
.facts dd { margin-bottom: .5rem; }
.auth-container { max-width: 480px; }
.prose { max-width: 760px; }
.breadcrumb-item.text-truncate { max-width: 40ch; }
.nav-tabs .nav-link { color: #4b5563; }
.nav-tabs .nav-link.active { color: var(--accent); font-weight: 600; }

/* reviews */
.bg-accent { background-color: var(--accent) !important; }
.stars { color: #f59e0b; white-space: nowrap; }
.topic-label { min-width: 230px; }
.topic-value { width: 2.2rem; text-align: right; font-weight: 600; }
@media (max-width: 575px) { .topic-label { min-width: 100%; } }
.review-card { border-color: #e3ece9; }
.review-text { white-space: pre-line; }
.review-form-container { max-width: 760px; }

/* star rating input: radios in reverse order so ~ selects the stars to the left */
.star-input { display: inline-flex; flex-direction: row-reverse; font-size: 1.4rem; line-height: 1; }
.star-input-lg { font-size: 2rem; }
.star-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-input label { color: #d1d5db; cursor: pointer; padding: 0 .1rem; }
.star-input input:checked ~ label,
.star-input label:hover, .star-input label:hover ~ label { color: #f59e0b; }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.star-input.is-invalid { outline: 1px solid var(--bs-danger); border-radius: 6px; }

/* catchments */
.catchment-card { border-color: #cfe5df; }
.catchment-school + .catchment-school { border-top: 1px solid #e3ece9; margin-top: .75rem; padding-top: .75rem; }
.catchment-ms li { padding: .35rem 0; }
.catchment-ms li + li { border-top: 1px solid #e3ece9; }
.catchment-map { height: 300px; }
.catchment-rules { columns: 2; column-gap: 2rem; }
@media (max-width: 575px) { .catchment-rules { columns: 1; } }
.address-suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 1000; max-height: 320px; overflow-y: auto; }
.address-suggestions .list-group-item { cursor: pointer; }
.address-suggestions .list-group-item.active { background: var(--accent); border-color: var(--accent); }
.noise-control { background: #fff; padding: 6px 8px; font-size: .75rem; }
.noise-control .noise-title { font-weight: 600; margin-bottom: 4px; }
.noise-control .btn { font-size: .75rem; padding: 1px 8px; }
.noise-scale { display: flex; margin-top: 6px; }
.noise-scale span { flex: 1; height: 8px; }
.noise-range { color: #6c757d; margin-top: 2px; }
.noise-zoom { color: #b45309; margin-top: 2px; }
.map-dot.type-home { background: #dc2626; width: 20px; height: 20px; border-radius: 4px; }

/* district data: age chart (district vs Prague) and metro line badges */
.age-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; }
.age-label { width: 3.2rem; flex-shrink: 0; color: var(--bs-secondary-color); }
.age-value { width: 2.8rem; flex-shrink: 0; text-align: right; }
.age-bars { flex-grow: 1; }
.age-bar { height: 6px; border-radius: 3px; max-width: 100%; }
.age-bar + .age-bar { margin-top: 2px; }
.age-bar-district { background: #2f8f7a; }
.age-bar-prague { background: #c9d6d2; }
.age-legend { display: flex; gap: 1rem; }
.age-swatch { display: inline-block; width: .8rem; height: .5rem; border-radius: 2px; vertical-align: middle; }
.metro-line { display: inline-block; min-width: 1.25rem; padding: 0 .25rem; border-radius: .25rem; color: #fff;
    font-weight: 700; font-size: .75rem; text-align: center; margin-right: .2rem; }
.metro-A { background: #1a9c48; }
.metro-B { background: #f5b800; color: #222; }
.metro-C { background: #d8232a; }
.metro-D { background: #1d71b8; }
.transit-stop { font-weight: 500; }

/* section chips on district and čtvrť pages: stay on top while scrolling, scroll sideways on phones */
.section-nav {
    position: sticky; top: 0; z-index: 1020; background: #fbfcfc; border-bottom: 1px solid #e3ece9;
    margin: 0 calc(-.5 * var(--bs-gutter-x, 1.5rem)); padding: .5rem calc(.5 * var(--bs-gutter-x, 1.5rem));
    display: flex; gap: .4rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav .chip { flex: 0 0 auto; }
section[id] { scroll-margin-top: 4rem; }

/* "Podrobnosti" and "Jak počítáme" toggles: summary first, details on demand */
details.more > summary {
    cursor: pointer; list-style: none; color: var(--accent); font-size: .875rem; font-weight: 500;
    padding: .35rem 0; user-select: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ""; display: inline-block; margin-left: .35rem; border: solid currentColor;
    border-width: 0 2px 2px 0; padding: 2.5px; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
details.more[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
details.more.method > summary { color: #6b7280; font-weight: 400; font-size: .8rem; }
.section-nav .chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* "Vhodné pro…" grades */
.profile-pill {
    display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px;
    font-size: .8rem; border: 1px solid #e3ece9; background: #fff; color: var(--bs-body-color);
}
.profile-grade { font-weight: 600; }
.profile-pill .bi { font-size: .95rem; line-height: 1; }
.profile-pill.trend-up { border-color: #bbe5cc; background: #effaf3; }
.profile-pill.trend-up .bi { color: #15803d; }
.profile-pill.trend-flat { border-color: #f5dfa8; background: #fffaeb; }
.profile-pill.trend-flat .bi { color: #b45309; }
.profile-pill.trend-down { border-color: #f3c9c9; background: #fdf3f3; }
.profile-pill.trend-down .bi { color: #b91c1c; }
.grade-excellent { border-color: #99d5c9; background: #e6f4f1; }
.grade-excellent .profile-grade { color: #0f766e; }
.grade-good .profile-grade { color: #15803d; }
.grade-average .profile-grade { color: #6b7280; }
.grade-weak { opacity: .8; }
.grade-weak .profile-grade { color: #9ca3af; }
.bg-grade-excellent { background-color: #0f766e !important; }
.bg-grade-good { background-color: #22a06b !important; }
.bg-grade-average { background-color: #9ca3af !important; }
.bg-grade-weak { background-color: #d1d5db !important; }
.rank-number { width: 2rem; flex: 0 0 2rem; font-weight: 700; color: #6b7280; }
.wish-check + .btn { border-radius: 999px; }
.btn-check:checked + .btn-outline-accent { background: var(--accent); border-color: var(--accent); color: #fff; }

/* comparison of čtvrti: the label column narrow on phones, the best value marked */
.compare-table .compare-label { width: 34%; color: #4b5563; }
.compare-table td, .compare-table th { padding-left: .35rem; padding-right: .35rem; }
.compare-table td.compare-best { color: var(--accent); --bs-table-color: var(--accent); font-weight: 600; }
.text-grade-excellent { color: #0f766e; }
.text-grade-good { color: #15803d; }
.text-grade-average, .text-grade-weak { color: #6b7280; }
@media (max-width: 575px) {
    .compare-table { font-size: .82rem; }
    .compare-table .compare-label { width: 30%; }
}

/* the map of čtvrti */
.map-tall { height: 70vh; min-height: 420px; }
.map-metrics .chip { cursor: pointer; }
.map-legend { display: flex; align-items: center; gap: .5rem; }
.map-legend-bar {
    display: inline-block; width: 140px; height: 10px; border-radius: 5px;
    background: linear-gradient(90deg, #0f766e, #2a9d8f, #8ecae6, #f4d58d, #e76f51);
}

/* the "Bydlíte tady?" poll */
.poll-card { background: var(--accent-soft); border: 0; }
.poll-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #e5e7eb; margin: .2rem 0; }
.poll-bar-part { display: block; height: 100%; }
.poll-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin: 0 .2rem 0 .4rem; }
.poll-part-0 { background: #0f766e; }
.poll-part-1 { background: #5eb5a8; }
.poll-part-2 { background: #f4b183; }
.poll-part-3 { background: #e76f51; }
.poll-part-4 { background: #9ca3af; }
.poll-part-5 { background: #6b7280; }

/* brand mark next to the name */
.brand-mark { border-radius: 6px; vertical-align: -6px; }
.site-footer .brand-mark { width: 20px; height: 20px; vertical-align: -4px; }

/* home: best čtvrti per figure */
.best-list { padding-left: 1.25rem; margin: 0; }
.best-list li { padding: .15rem 0; }
.best-list li::marker { color: var(--bs-secondary-color); }
.best-list .text-secondary { float: right; margin-left: .5rem; white-space: nowrap; font-size: .875rem; }
/* on phones the cards are a swipeable row instead of a long column */
@media (max-width: 767.98px) {
    .best-row { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
    .best-row > * { flex: 0 0 82%; max-width: 82%; scroll-snap-align: start; }
}
/* the address page's map stays in view next to the long column on wide screens */
@media (min-width: 992px) { .map-sticky { position: sticky; top: 1rem; height: 520px; } }

/* care for seniors on the map */
.map-dot.type-care-home { background: #7c3aed; }
.map-dot.type-care-special { background: #be185d; }
.map-dot.type-care-day { background: #0369a1; }
.map-legend .map-dot { width: 12px; height: 12px; }

/* "Jak si čtvrť stojí": rank among all čtvrti per figure, the median marked */
.standing-row { display: grid; grid-template-columns: minmax(6.5rem, 9rem) 5.5rem 1fr; gap: .5rem; align-items: center;
    font-size: .875rem; padding: .2rem 0; }
.standing-value { font-weight: 600; text-align: right; white-space: nowrap; }
.standing-bar { position: relative; height: 10px; background: #eef2f1; border-radius: 5px; }
.standing-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #9ca3af; }
.standing-fill { display: block; height: 100%; border-radius: 5px; }
@media (max-width: 575px) { .standing-row { grid-template-columns: 6.5rem 4.8rem 1fr; } }
.standing-card { max-width: 760px; }
.trend-up-color { color: #15803d; } .trend-flat-color { color: #b45309; } .trend-down-color { color: #b91c1c; }

/* universities */
.map-dot.type-uni { background: #1e40af; }
.bg-accent { background-color: var(--accent) !important; }
.chance-bar::after { display: none; }

/* small bar under a number in a table cell, scaled to the column's largest value */
.cell-bar { display: block; height: 4px; margin-top: 3px; margin-left: auto; width: 4.5rem; background: #eef2f1; border-radius: 2px; }
.cell-bar > span { display: block; height: 100%; margin-left: auto; background: #94a3b8; border-radius: 2px; }
.cell-bar-rent > span { background: var(--accent); }

/* a čtvrť's photo above its name; any shape is cropped to the frame, the credit in small print below */
.place-photo { margin: 0 0 .75rem; }
.place-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 6; object-fit: cover; border-radius: 12px;
    background: #eef2f1; }
.place-photo figcaption { font-size: .7rem; color: #6b7280; margin-top: .25rem; text-align: right; }
.place-photo figcaption a { color: inherit; }
@media (max-width: 575px) { .place-photo img { aspect-ratio: 16 / 9; } }
@media (min-width: 992px) { .place-photo img { aspect-ratio: auto; height: 260px; } }
