:root {
  --bg: #f7f7f4;
  --fg: #1d1f23;
  --muted: #5b6068;
  --line: #d5d6da;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --good: #16a34a;
  --warn: #d97706;
  --bad:  #dc2626;
  --card-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
  --radius: 12px;
  --maxw: 920px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
               Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.5;
}

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

.topbar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 24px 24px;
  text-align: center;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.subtitle {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px;
}

.picker {
  text-align: center;
  padding: 24px 0 40px;
}

.picker-label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.combo {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

#orp-input {
  display: block;
  width: 100%;
  padding: 16px 76px 16px 20px;
  font-size: 22px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: white;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

#orp-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Skrýt nativní křížek u <input type="search">, máme vlastní tlačítko */
#orp-input::-webkit-search-cancel-button,
#orp-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.clear-btn {
  position: absolute;
  top: 0px;
  right: 0px;
  bottom: 0px;
  width: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 28px;
  line-height: 1;
  font-family: inherit;
  color: var(--muted);
  background: #eef0f3;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}

.clear-btn:hover {
  background: #fee2e2;
  color: var(--bad);
  border-color: #fecaca;
  cursor: pointer;
}

.clear-btn:active { background: #fecaca; }

.clear-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
}

.suggest li {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 17px;
  line-height: 1.3;
}

.suggest li:hover,
.suggest li.active {
  background: var(--accent-soft);
  color: var(--fg);
}

.suggest .no-match {
  padding: 12px 20px;
  color: var(--muted);
  cursor: default;
  font-size: 15px;
}
.suggest .no-match:hover { background: transparent; }

.hint {
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
}

#result-title {
  margin-top: 0;
  font-size: 28px;
  letter-spacing: -0.01em;
}

#result-sub {
  margin-top: -8px;
}

.muted { color: var(--muted); font-size: 14px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.card h3 {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
  background: #fafafa;
}

th.value,
td.value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

td.value-strong { font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.low    { background: #dcfce7; color: #166534; }
.badge.medium { background: #fef3c7; color: #92400e; }
.badge.high   { background: #fee2e2; color: #991b1b; }

.empty {
  padding: 16px;
  background: #fafafa;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

details {
  margin-top: 16px;
}
details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
  user-select: none;
}
details summary:hover { color: var(--fg); }
details ul {
  margin: 8px 0 8px;
  padding-left: 20px;
  font-size: 13px;
  color: var(--fg);
}
details li { margin-bottom: 4px; }
details li b { color: var(--fg); font-weight: 600; }
.source {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

footer {
  max-width: var(--maxw);
  margin: 48px auto 24px;
  padding: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}

@media (max-width: 540px) {
  .topbar { padding: 24px 16px 16px; }
  main { padding: 16px; }
  .card { padding: 16px; }
  th, td { padding: 8px 10px; font-size: 13px; }
  #orp-input { font-size: 18px; padding: 12px 16px; }
}
