:root {
  color-scheme: dark;
  --bg: #101214;
  --surface: #181b1f;
  --surface-2: #20242a;
  --line: #303640;
  --text: #edf1f5;
  --muted: #94a0ad;
  --accent: #23b58f;
  --accent-2: #4d9de0;
  --danger: #e35d5d;
  --warning: #d6a83f;
  --shadow: rgba(0, 0, 0, 0.24);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1024px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #041b16;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.secondary {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

button.compact {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

button.danger {
  background: rgba(227, 93, 93, 0.15);
  color: #ffb3b3;
  border: 1px solid rgba(227, 93, 93, 0.4);
}

input,
select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d0f12;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(77, 157, 224, 0.18);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(684px, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #14171a;
  padding: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #031713;
  font-weight: 900;
}

.brand h1,
.brand p,
.toolbar h2,
.toolbar p,
.hits-header h2,
.hits-header p {
  margin: 0;
}

.brand h1 {
  font-size: 21px;
}

.brand p,
.toolbar p,
.hits-header p {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 24px var(--shadow);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 14px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-title-row h2 {
  margin: 0;
}

.panel form {
  display: grid;
  gap: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  text-transform: none;
  color: var(--text);
  font-size: 14px;
}

.checkbox input {
  width: 16px;
  height: 16px;
}

.status,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status {
  margin-top: 12px;
}

.subtle-count {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.pid-picker {
  position: relative;
}

.process-popup {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111418;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  padding: 10px;
}

.process-popup[hidden] {
  display: none;
}

.process-popup-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.process-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.process-item {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 54px;
  gap: 4px;
  border: 1px solid #252b33;
  border-radius: 6px;
  background: #111418;
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.process-item:hover {
  border-color: rgba(77, 157, 224, 0.65);
  filter: none;
}

.process-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.process-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.process-title code {
  color: #a9d7ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.process-meta,
.process-empty {
  color: var(--muted);
  font-size: 12px;
}

.process-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-empty {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
}

.connected {
  background: rgba(35, 181, 143, 0.18);
  color: #73e8c8;
}

.disconnected {
  background: rgba(227, 93, 93, 0.18);
  color: #ffb3b3;
}

.workspace {
  padding: 22px;
  overflow-x: hidden;
}

.toolbar,
.hits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.toolbar h2,
.hits-header h2 {
  font-size: 20px;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.toolbar-actions label {
  width: 150px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.tab {
  height: 38px;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
}

.tab:hover {
  filter: none;
  color: var(--text);
}

.tab.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 22px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

td code,
.hit-card code {
  color: #a9d7ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.hits-list {
  display: grid;
  gap: 10px;
}

.hit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.hit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.hit-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.hit-meta {
  color: var(--muted);
  font-size: 12px;
}

.reg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.reg {
  border: 1px solid #252b33;
  border-radius: 6px;
  background: #111418;
  padding: 9px;
}

.reg-name {
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
}

.map-path {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  gap: 6px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 520px;
  border: 1px solid rgba(227, 93, 93, 0.4);
  border-radius: 8px;
  background: #2a1719;
  color: #ffd1d1;
  padding: 12px 14px;
  box-shadow: 0 12px 28px var(--shadow);
  font-size: 13px;
}
