/* Obsidian Portal — view-listener */

    /* ── Listener view ───────────────────────────────────────── */
    .listener-view { padding:0; overflow:hidden; max-width:100%; }
    @keyframes lst-pulse {
      0%,100% { box-shadow: 0 0 4px #22c55e; }
      50%      { box-shadow: 0 0 10px #22c55e, 0 0 20px rgba(34,197,94,.3); }
    }

    /* Tab strip inside panel */
    .lst-tab {
      background: transparent; border: none; border-bottom: 2px solid transparent;
      padding: 8px 12px; font-size: 11px; font-weight: 600; color: var(--muted);
      cursor: pointer; transition: color .12s, border-color .12s;
      letter-spacing: .03em;
    }
    .lst-tab:hover { color: var(--text); }
    .lst-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

    /* Preset chips */
    .lst-preset-chip {
      background: var(--bg); border: 1px solid var(--border2);
      color: var(--muted); font-size: 10px; font-weight: 600;
      padding: 4px 10px; cursor: pointer; border-radius: 0;
      transition: all .15s; white-space: nowrap; letter-spacing: .02em;
    }
    .lst-preset-chip:hover {
      background: rgba(37,99,235,.1); color: var(--blue);
      border-color: rgba(37,99,235,.35);
    }
    .lst-cat-btn {
      font-size: 10px; font-weight: 600; padding: 4px 8px;
      border-radius: 0; border: 1px solid var(--border2);
      background: var(--bg); color: var(--muted); cursor: pointer;
      transition: all .15s; white-space: nowrap; letter-spacing: .02em;
    }
    .lst-cat-btn:hover { background: var(--surface); color: var(--text); }
    .lst-cat-btn.active {
      background: rgba(37,99,235,.12); color: var(--blue);
      border-color: rgba(37,99,235,.4); font-weight: 700;
    }
    .lst-kw-chip {
      font-size: 10px; font-weight: 600; padding: 3px 8px;
      border-radius: 0; border: 1px solid var(--border2);
      background: var(--surface); color: var(--muted);
      cursor: pointer; transition: all .12s; white-space: nowrap;
    }
    .lst-kw-chip:hover { border-color: rgba(37,99,235,.4); color: var(--text); }
    .lst-kw-chip.selected {
      background: rgba(37,99,235,.15); color: var(--blue);
      border-color: rgba(37,99,235,.5); font-weight: 700;
    }

    /* Result rows */
    .lst-result-row {
      padding: 10px 14px; border-bottom: 1px solid var(--border);
      cursor: pointer; transition: background .1s;
    }
    .lst-result-row:hover { background: var(--surface2); }
    .lst-result-row:last-child { border-bottom: none; }

    /* Hit rows */
    .lst-hit-row {
      padding: 10px 14px; border-bottom: 1px solid var(--border);
      border-left: 3px solid #22c55e; cursor: pointer; transition: background .1s;
    }
    .lst-hit-row:hover { background: var(--surface2); }
    .lst-hit-row:last-child { border-bottom: none; }

    /* Rule rows */
    .lst-rule-row {
      padding: 10px 14px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: 10px;
    }
    .lst-rule-row:last-child { border-bottom: none; }

    /* Keyword badge */
    .lst-kw-badge {
      display: inline-block; font-size: 9px; font-weight: 700;
      background: rgba(37,99,235,.12); color: var(--blue);
      border: 1px solid rgba(37,99,235,.25); padding: 1px 6px;
      border-radius: 0; margin-right: 3px;
    }
    .lst-kw-badge.att { background: rgba(249,115,22,.12); color: #f97316; border-color: rgba(249,115,22,.25); }

    /* Preview expand */
    .lst-preview { display: none; font-size: 11px; color: var(--dim); margin-top: 6px;
                    padding: 8px 10px; background: var(--bg); border-left: 2px solid var(--border2);
                    line-height: 1.6; }

/* ── Layout polish (portal-aligned) ─────────────────────────── */

.listener-view {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  max-width: 100%;
  min-height: 0;
  flex: 1;
}

.app-shell:has(#view-listener.active) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.app-content:has(#view-listener.active) {
  padding: 0;
  overflow: hidden;
}

.lst-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.lst-page-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lst-page-title-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.lst-live-badge {
  display: none;
}

.lst-token-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lst-picker-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.lst-token-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  min-width: 180px;
  max-width: 100%;
  user-select: none;
  transition: border-color var(--t), background var(--t);
}

.lst-token-trigger:hover {
  border-color: var(--border2);
  background: var(--row-hover);
}

.lst-token-trigger-label {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lst-token-trigger-chevron {
  font-size: 9px;
  color: var(--dim);
  flex-shrink: 0;
}

.lst-picker-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  width: 100%;
  min-width: min(400px, 92vw);
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border2);
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.lst-picker-panel[hidden] { display: none !important; }

.lst-picker-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.lst-picker-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.lst-token-info {
  font-size: 10px;
  min-height: 0;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  flex-shrink: 1;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
}
.lst-token-info.is-warn { color: #f87171; }

.lst-stat-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.lst-stat-cell,
.lst-stat-val,
.lst-stat-lbl,
.lst-stat-divider { display: none; }

.lst-main-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 960px) {
  .lst-main-grid { grid-template-columns: 1fr; }
}

.lst-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface2);
  min-height: 0;
}

.lst-sidebar-rules {
  max-height: 160px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 0 1 auto;
}

.lst-sidebar-head {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: var(--surface);
}

.lst-sidebar-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text);
}

.lst-sidebar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lst-live-dot-sm {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 5px #22c55e;
  animation: lst-pulse 2s ease-in-out infinite;
}

.lst-rules-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.lst-sidebar-foot {
  border-top: 1px solid var(--border);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.lst-pane-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.lst-pane-tab {
  flex: 1;
  padding: 6px 0;
  font-size: 10px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--dim);
  border-bottom: 2px solid transparent;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--t), border-color var(--t);
}

.lst-pane-tab:hover { color: var(--text); }

.lst-pane-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.lst-pane-search,
.lst-pane-rule {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

.lst-pane-rule {
  display: none;
  max-height: 300px;
  overflow-y: auto;
}

.lst-pane-rule.is-open { display: flex; }

.lst-field-lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 4px;
}

.lst-kw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.lst-search-primary {
  width: 100%;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 9px 0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: filter var(--t), opacity var(--t);
  font-family: var(--font-sans);
}

.lst-search-primary:hover { filter: brightness(1.1); }

.lst-create-rule-btn {
  width: 100%;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  padding: 8px 0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}

.lst-create-rule-btn:hover {
  background: rgba(34, 197, 94, 0.18);
}

.lst-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.lst-rtab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
  align-items: stretch;
}

.lst-rtab {
  flex: 1;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color var(--t), border-color var(--t);
}

.lst-rtab.active-hits {
  color: var(--green);
  border-bottom-color: var(--green);
}

.lst-rtab.active-results {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.lst-rtab-tools {
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}

.lst-monitoring-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.07em;
}

.lst-rpanel-hits,
.lst-rpanel-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.lst-rpanel-results {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lst-rpanel-results[hidden] { display: none !important; }

.lst-results-head {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

.lst-results-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: var(--surface);
}

.lst-empty-state {
  padding: 18px 16px;
  text-align: center;
  color: var(--dim);
}
.lst-empty-compact {
  padding: 10px 12px;
}

.lst-empty-icon {
  font-size: 26px;
  margin-bottom: 10px;
  opacity: 0.45;
  line-height: 1;
}

.lst-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.lst-empty-hint {
  font-size: 11px;
  line-height: 1.5;
  max-width: 36ch;
  margin: 0 auto;
}

.lst-empty-link {
  color: var(--blue);
  cursor: pointer;
  font-weight: 600;
}

.lst-empty-link:hover { text-decoration: underline; }

.lst-rule-card {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}

.lst-rule-card:hover { background: var(--row-hover); }

.lst-rule-card.is-live { border-left: 3px solid var(--green); }
.lst-rule-card.is-idle { border-left: 3px solid var(--border2); }
