/* Components: buttons, chips, pills, badges, inputs/suggestions, tables, KPI cards, firm panel, T-code marks. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { border-color: var(--label); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-ink:hover { background: #1E293B; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.chip {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  background: var(--card);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  background: var(--card);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}
.pill:hover { border-color: var(--label); }

.badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-chip);
  background: var(--line-soft);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-hot { background: var(--hot-bg); color: var(--hot-ink); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-quiet { background: var(--line-soft); color: var(--note); font-weight: 500; }

/* search */
.search-form { display: flex; gap: 8px; margin-top: 14px; }
.combo { position: relative; flex: 1; min-width: 0; }
.input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--line-soft);
  font-size: var(--fs-body);
}
.input:focus { background: #fff; }
.suggest {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.opt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.opt.is-active, .opt:hover { background: var(--hl); }
.opt-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-code, .opt-score { color: var(--note); font-size: var(--fs-note); font-variant-numeric: tabular-nums; }
.search-msg:empty { display: none; }
.search-msg { margin-top: 6px; }

.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.firm-slot { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.empty { padding: 6px 0; }
.firm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.firm-name { font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.firm-meta { color: var(--note); font-size: var(--fs-note); }
.firm-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 12px; }
.firm-kpi { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.reason { margin-top: 12px; padding: 10px 12px; background: var(--line-soft); border-radius: 8px; }
.firm-history { margin-top: 6px; }
.block-label { margin: 16px 0 8px; }

/* KPI cards */
.kpi .kpi-line { margin: 8px 0 8px; }
.kpi-unit { color: var(--text); font-size: 13.5px; }
.mini-bars { display: grid; gap: 4px; margin-bottom: 8px; }
.mini-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 46px; gap: 8px; align-items: center; font-size: var(--fs-note); color: var(--text); }
.mini-track { height: 8px; }
.mini-bar { display: block; height: 100%; background: var(--navy); border-radius: 0 4px 4px 0; }
.small-card .small-label { margin-bottom: 6px; }
.small-card .body { font-size: 13px; }
.small-card .body + .body { margin-top: 6px; }
.more { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.more:hover { text-decoration: underline; }

/* tables */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dense { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dense th {
  padding: 6px 8px;
  text-align: left;
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--label);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dense th.num { text-align: right; }
.dense td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink); }
.dense tbody tr:last-child td { border-bottom: 0; }
.dense a { text-decoration: none; }
.dense a:hover { text-decoration: underline; }
.sort {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.sort-arrow { margin-left: 3px; color: var(--ink); }
.clickable { cursor: pointer; }
.clickable:hover td, .clickable.is-selected td { background: var(--hl); }
.clickable:focus-visible { outline-offset: -2px; }
.cell-name { font-weight: 600; }
.cell-code { color: var(--label); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.top-table td { white-space: nowrap; }

/* T-code marks */
.tc-T01 { --c: var(--t01); --fg: #fff; }
.tc-T02 { --c: var(--t02); --fg: #fff; }
.tc-T03 { --c: var(--t03); --fg: #fff; }
.tc-T05 { --c: var(--t05); --fg: #fff; }
.tc-T06 { --c: var(--t06); --fg: #fff; }
.tc-T99 { --c: var(--t99); --fg: var(--ink); }
.tchip {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--c);
  color: var(--fg);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.tseq { display: inline-flex; gap: 3px; }
.tc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: var(--fs-note); color: var(--text); }
