.search { display: flex; gap: 8px; }

.input {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  min-width: 220px;
  outline: none;
}
.input:focus { border-color: var(--accent-dim); }

.button {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.button:hover { background: var(--border); }
.button-primary { background: var(--accent-dim); border-color: var(--accent-dim); color: #eafff0; }
.button-primary:hover { background: var(--accent); color: #06210d; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }

.tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface-alt); color: var(--text); border-color: var(--accent-dim); }

.custom-range { display: flex; align-items: flex-end; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.field input {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 6px 8px;
  font-size: 13px;
  color-scheme: dark;
}

.avatar { width: 40px; height: 40px; border-radius: var(--radius); object-fit: cover; }
.profile { display: flex; align-items: center; gap: 12px; }
.profile-name { font-weight: 600; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.kpi-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.chart { position: relative; height: 260px; }
.chart-medium { height: 360px; }
.chart-tall { height: 520px; }
.chart-heatmap { height: auto; overflow-x: auto; }

.list { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row-rank { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.row-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-value { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-muted); padding-right: 15px;}
.list-wide .row { grid-template-columns: 1fr auto; }

.alert {
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  padding: 10px 14px;
  font-size: 14px;
  background: var(--surface);
}

.alert.alert-info { border-color: var(--border); color: var(--text-muted); }

.empty { color: var(--text-muted); font-size: 13px; padding: 12px 0; }

.loader { position: fixed; inset: 0 0 auto 0; height: 2px; background: var(--surface-alt); z-index: 40; }
.loader-bar { width: 35%; height: 100%; background: var(--accent); animation: slide 1.1s infinite ease-in-out; }
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.heatmap-cell { shape-rendering: crispEdges; }
.heatmap-label { fill: var(--text-muted); font-size: 10px; }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  z-index: 50;
  white-space: nowrap;
}

.node-label { fill: var(--text-muted); font-size: 10px; pointer-events: none; }

.panel-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.slider-field { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.slider-field output { font-variant-numeric: tabular-nums; color: var(--text); min-width: 22px; text-align: right; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.select {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--accent-dim); }

.button-block { width: 100%; margin-top: 10px; }
.input-grow { flex: 1 1 240px; min-width: 0; }

/* Capped height keeps the three top panels aligned; expanding lifts the cap. */
.list-scroll { max-height: 420px; overflow-y: auto; }
.list-scroll.is-expanded { max-height: 720px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.card-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-score { font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; }

.browser-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.table { display: flex; flex-direction: column; }
.table-head, .table-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr) 72px 150px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.table-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.table-row { font-size: 13px; }
.table-row:last-child { border-bottom: none; }
.table-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-cell.numeric { font-variant-numeric: tabular-nums; color: var(--text-muted); }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }

@media (max-width: 720px) {
  .table-head, .table-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 110px; }
  .table-cell.hide-narrow { display: none; }
}

.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-label {
  font-size: 13px;
  min-width: 210px;
  text-align: center;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.calendar-nav .button { padding: 6px 12px; line-height: 1; }

.tabs-group { display: flex; align-items: center; gap: 6px; }
.tabs-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.segment {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.segment + .segment { border-left: 1px solid var(--border); }
.segment:hover { color: var(--text); }
.segment[aria-selected="true"] { background: var(--surface-alt); color: var(--text); }
