:root {
  --bg: #f3f6f1;
  --panel: #fbfdfb;
  --panel-soft: #eef6f1;
  --panel-softer: #f7fbf8;
  --text: #1f2933;
  --muted: #64717c;
  --line: #cfded5;
  --line-strong: #93b8a6;
  --accent: #2f5d50;
  --accent-strong: #234c42;
  --accent-soft: #e5f0ea;
  --accent-pale: #f2f8f4;
  --warn: #9a5a00;
  --bad: #8a2d2d;
  --good: #2f6b3f;
  --shadow: 0 5px 16px rgba(31, 64, 54, .105);
  --shadow-soft: 0 2px 8px rgba(31, 64, 54, .075);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, #f7f8f5 0, var(--bg) 360px, #f5f7f3 100%);
  color: var(--text);
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1280px; margin: 0 auto; padding: 22px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
}
.site-header .container { padding-top: 28px; padding-bottom: 24px; }
.eyebrow {
  margin: 0 0 8px;
  color: #557066;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: #14243a;
}
.lead { margin: 0; max-width: 850px; color: #3f5360; font-size: 17px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.note { margin: 18px 0; padding: 15px 17px; color: #3f4b55; }
.intro-note {
  margin-top: 18px;
  padding: 22px;
  background: linear-gradient(180deg, #edf7f1 0%, #f5faf6 100%);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.note h2 { margin: 0 0 12px; font-size: 18px; }
.intro-note h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--accent-strong);
  font-size: 20px;
  letter-spacing: -0.01em;
}
.intro-note h2::before {
  content: "";
  width: 5px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  flex: 0 0 auto;
}
.note h3 { margin: 0 0 5px; font-size: 14px; color: #263540; }
.note p { margin: 0; max-width: 1120px; }

.explain-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.explain-block {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f4faf6 100%);
  border: 1px solid #adcfc0;
  border-left: 4px solid #7fa892;
  border-radius: 12px;
  padding: 14px 15px 14px 16px;
  box-shadow: 0 3px 10px rgba(31, 64, 54, .075);
}
.explain-block.wide { grid-column: 1 / -1; }
.explain-block h3 {
  color: #173c34;
  font-size: 14px;
  margin-bottom: 7px;
  letter-spacing: .005em;
}
.explain-block p { color: #354b55; font-size: 14px; line-height: 1.58; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin: 18px 0 8px;
}
.stat {
  background: linear-gradient(180deg, #ffffff 0%, #f1f8f4 100%);
  border: 1px solid #b8d2c5;
  border-left: 4px solid #7fa892;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}
.stat strong { display: block; font-size: 26px; line-height: 1; margin-bottom: 5px; color: #14243a; }
.stat span { color: var(--muted); font-size: 13px; }

.controls {
  margin-top: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(160px,.7fr));
  gap: 10px;
  align-items: end;
  background: #f3faf6;
  border-color: #b8d2c5;
}
.field label { display: block; font-size: 12px; color: #597066; margin-bottom: 5px; }
input, select, button { font: inherit; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #ffffff;
  color: var(--text);
}
input:focus, select:focus {
  outline: 2px solid rgba(47, 93, 80, .18);
  border-color: #94b9a7;
}
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}
button:hover { background: var(--accent-soft); border-color: #b7d0c2; }

.table-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 2px 8px;
  color: var(--muted);
  font-size: 13px;
}
.table-wrap { overflow: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 1040px; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 10px; vertical-align: middle; }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #dfeee6;
  font-size: 12px;
  color: #385347;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}
th.sortable { cursor: pointer; }
th.sortable::after { content: " ⇅"; color: #7f978d; font-weight: 400; }
tbody tr:nth-child(even) { background: #fbfdfb; }
tbody tr:hover { background: #eef6f1; }

.obcina-cell { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.crest { width: 34px; height: 42px; object-fit: contain; flex: 0 0 auto; }
.obcina-name { font-weight: 700; }
.sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.height-cell { font-weight: 700; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.peak { min-width: 180px; }
.peak strong { font-weight: 700; }
.coord-link { font-variant-numeric: tabular-nums; }
.links { white-space: nowrap; }
.links a { display: inline-block; margin-right: 8px; font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.25;
}
.badge.ok { color: var(--good); background: #eef8ef; border-color: #cfe5d1; }
.badge.near { color: #557128; background: #f4f7e8; border-color: #dfe8bd; }
.badge.check { color: var(--warn); background: #fff6e6; border-color: #efd9ae; }
.badge.no { color: var(--bad); background: #fff0f0; border-color: #eccaca; }
.badge.none { color: #6c747c; background: #f2f3f4; border-color: #dde1e3; }

.footer { color: var(--muted); font-size: 12px; padding: 18px 0 36px; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .explain-grid { grid-template-columns: 1fr; }
  .explain-block.wide { grid-column: auto; }
  .container { padding: 16px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { grid-template-columns: 1fr; }
  .table-info { display:block; }
}
