/* Керування: фільтри, поля, кнопки, сегменти. */

/* ---------------------------------------------------------------- фільтри */
.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px;
}
.filter-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; }

/* Діапазон читається як один елемент керування, а не як два окремі поля */
.range {
  display: inline-flex; align-items: center; gap: 0;
  border: 0; border-radius: var(--pill); background: var(--raised);
  padding: 0 8px; height: 38px;
}
.range input {
  border: 0; background: none; height: 36px; padding: 0 8px;
  font-family: var(--mono); font-size: 12.5px;
}
.range input:focus { outline: 2px solid var(--brand); border-radius: var(--pill); }
.range i {
  font-style: normal; color: var(--faint); font-size: 12px; padding: 0 2px;
}
.filters select { max-width: 210px; min-width: 0; }
.search { width: 150px; }
.search.narrow { width: 120px; }
/* Довгі назви команд і запити мають залишатися читабельними. */
.filters .filter-form select[name="team"] { width: 380px; max-width: 100%; }
.filters .filter-form input[name="q"] { width: 220px; max-width: 100%; }
.filters .export { margin-left: auto; }
input, select, button {
  font: inherit; color: var(--text);
  background: var(--raised); border: 1px solid transparent;
  border-radius: var(--pill); padding: 7px 16px; height: 38px;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--text); }
input[type="checkbox"], input[type="radio"] {
  width: 15px; height: 15px; padding: 0; flex: 0 0 auto;
  margin: 3px 0 0; accent-color: var(--accent);
}
button, .btn {
  cursor: pointer; font-weight: 600; font-size: 13px;
  background: var(--primary); color: var(--on-primary); border-color: transparent;
  padding: 7px 18px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--pill); text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--raised); filter: none; }
.btn-sm { height: 32px; padding: 4px 14px; font-size: 12.5px; }

/* Сегмент — сіра доріжка з лаймовою пігулкою активного пункту */
.seg { display: flex; gap: 2px; padding: 4px; background: var(--raised); border-radius: var(--pill); }
.seg a {
  padding: 6px 14px; color: var(--muted); font-weight: 550; font-size: 13px;
  border-radius: var(--pill); white-space: nowrap;
}
.seg a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.seg a.active { background: var(--brand); color: var(--brand-ink); }

/* Підказка «i»: пояснення з'являється при наведенні чи фокусі, а не стоїть
   дрібним текстом поруч. CSS-підказка — без затримки, яку має title. */
.tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex: none; vertical-align: middle;
  border-radius: 50%; border: 1px solid var(--line); background: var(--raised);
  color: var(--muted); cursor: help;
  font: italic 700 10px/1 var(--ui); letter-spacing: 0; text-transform: none;
}
.tip:hover, .tip:focus-visible { color: var(--text); border-color: var(--muted); outline: none; }
.tip::after {
  content: attr(data-tip);
  position: absolute; z-index: 40; left: 50%; top: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content; max-width: min(300px, 80vw);
  padding: 9px 12px; border-radius: 10px;
  background: var(--bar); color: #F5F5F2;
  font: 500 12px/1.45 var(--ui); font-style: normal; letter-spacing: 0; text-transform: none;
  text-align: left; white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  /* Саме display:none, а не прозорість: невидима підказка однаково
     розширювала сторінку на телефоні */
  display: none; pointer-events: none;
}
.tip:hover::after, .tip:focus-visible::after { display: block; }
/* Біля правого краю екрана підказка відкривається ліворуч */
.tip.tip-left::after { left: auto; right: -6px; transform: none; }
