/* News Hub V2 — Phase A */

#v2-news-hub.v2-tool-pane.active,
#v2-news-hub.v2-tool-pane {
  height: 100%;
  min-height: 0;
}

.nh-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg, #f7f8fa);
  color: var(--text, #1f2937);
}

.nh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  flex-shrink: 0;
}

.nh-header__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nh-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.nh-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.nh-status-pill.is-loading {
  background: rgba(9, 100, 160, 0.12);
  color: #0964a0;
}

.nh-status-pill.is-error {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.nh-btn {
  border: 1px solid var(--border, #d1d5db);
  background: var(--surface, #fff);
  color: var(--text, #1f2937);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nh-btn:hover:not(:disabled) {
  border-color: var(--accent, #0964a0);
  color: var(--accent, #0964a0);
}

.nh-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nh-btn--ghost {
  background: transparent;
}

.nh-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}

.nh-filters {
  overflow: auto;
  border-right: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  padding: 14px 14px 24px;
}

.nh-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.nh-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  flex-shrink: 0;
}

.nh-toolbar__search {
  position: relative;
  flex: 1 1 240px;
  max-width: 420px;
}

.nh-toolbar__search > i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted, #6b7280);
  font-size: 0.85rem;
}

.nh-toolbar__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted, #6b7280);
  font-size: 0.82rem;
}

.nh-context {
  color: var(--text, #1f2937);
  font-weight: 600;
}

.nh-banners {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.nh-banners:not(:empty) {
  padding-top: 12px;
}

.nh-banner {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.35;
}

.nh-banner--warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.nh-banner--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.nh-banner--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.nh-articles {
  flex: 1;
  overflow: auto;
  padding: 16px;
  min-height: 0;
}

.nh-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 14px;
  background: var(--bg, #f3f4f6);
  border-radius: 10px;
  padding: 4px;
}

.nh-seg__btn {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #6b7280);
  cursor: pointer;
}

.nh-seg__btn.is-active {
  background: var(--surface, #fff);
  color: var(--text, #111827);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.nh-hint {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--muted, #6b7280);
  line-height: 1.4;
}

.nh-filter-block {
  margin-bottom: 16px;
}

.nh-filter-label,
.nh-filter-label-row {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b7280);
  margin-bottom: 8px;
}

.nh-filter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nh-source-actions {
  display: flex;
  gap: 8px;
}

.nh-link-btn {
  border: 0;
  background: none;
  color: var(--accent, #0964a0);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.nh-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nh-chip {
  border: 1px solid var(--border, #d1d5db);
  background: var(--surface, #fff);
  color: var(--text, #374151);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.nh-chip.is-active {
  border-color: var(--accent, #0964a0);
  background: rgba(9, 100, 160, 0.1);
  color: var(--accent, #0964a0);
  font-weight: 600;
}

.nh-chip--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.nh-chip__count {
  opacity: 0.65;
  margin-left: 2px;
}

.nh-check-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.nh-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}

.nh-check input {
  margin-top: 2px;
}

.nh-mini-pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.nh-mini-pill--muted {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.nh-input {
  width: 100%;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  background: var(--surface, #fff);
  color: var(--text, #1f2937);
  box-sizing: border-box;
}

.nh-input--search {
  padding-left: 32px;
}

.nh-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface, #fff);
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
}

.nh-wl-dropdown {
  margin-top: 8px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #fff);
}

.nh-wl-dropdown .nh-input {
  border: 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  border-radius: 0;
}

.nh-wl-list {
  max-height: 240px;
  overflow: auto;
}

.nh-wl-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border, #f3f4f6);
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.nh-wl-row:hover,
.nh-wl-row.is-active {
  background: rgba(9, 100, 160, 0.06);
}

.nh-wl-row__name {
  font-weight: 650;
  font-size: 0.85rem;
}

.nh-wl-row__meta,
.nh-wl-row__desc {
  font-size: 0.72rem;
  color: var(--muted, #6b7280);
  margin-top: 2px;
}

.nh-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nh-acc__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border, #e5e7eb);
  border-left: 3px solid var(--nh-acc-color, #2563eb);
  border-radius: 8px;
  background: var(--surface, #fff);
  padding: 9px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
}

.nh-acc__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.nh-channel-row {
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.nh-channel-row.is-active {
  border-left-color: var(--accent, #0964a0);
  background: rgba(9, 100, 160, 0.08);
}

.nh-channel-row__name {
  font-size: 0.82rem;
  font-weight: 600;
}

.nh-channel-row__desc {
  font-size: 0.72rem;
  color: var(--muted, #6b7280);
  margin-top: 2px;
}

.nh-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.nh-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}

.nh-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.nh-source {
  font-weight: 700;
  color: var(--text, #111827);
}

.nh-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  font-weight: 650;
  font-size: 0.68rem;
}

.nh-time {
  margin-left: auto;
  color: var(--muted, #6b7280);
}

.nh-card__title {
  color: var(--text, #111827);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.98rem;
  line-height: 1.35;
}

.nh-card__title:hover {
  color: var(--accent, #0964a0);
}

.nh-card__summary {
  margin: 0;
  color: var(--muted, #4b5563);
  font-size: 0.84rem;
  line-height: 1.45;
  flex: 1;
}

.nh-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nh-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg, #f3f4f6);
  color: var(--muted, #4b5563);
}

.nh-tag--ticker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(9, 100, 160, 0.1);
  color: #0964a0;
  font-weight: 650;
}

.nh-card__read {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent, #0964a0);
  text-decoration: none;
}

.nh-card__read:hover {
  text-decoration: underline;
}

.nh-agent-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0b4f6c;
  background: rgba(11, 79, 108, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
}

.nh-pill--kind {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
  font-weight: 600;
}

.nh-agent-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
}

.nh-agent-stat {
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #6b7280);
}

.nh-agent-stat.is-up {
  color: #0f766e;
}

.nh-agent-stat.is-down {
  color: #b91c1c;
}

.nh-card__title--static {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text, #111827);
}

.nh-agent-sources {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.nh-agent-source {
  font-size: 0.78rem;
  color: var(--accent, #0964a0);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nh-agent-source:hover {
  text-decoration: underline;
}

.nh-agent-date,
.nh-agent-budget {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #111827);
}

.nh-card--agent .nh-card__summary {
  white-space: pre-wrap;
}

.nh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 240px;
  color: var(--muted, #6b7280);
  text-align: center;
}

.nh-empty i {
  font-size: 1.75rem;
  color: var(--accent, #0964a0);
}

.nh-empty-mini {
  padding: 14px;
  text-align: center;
  color: var(--muted, #6b7280);
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .nh-body {
    grid-template-columns: 1fr;
  }

  .nh-filters {
    border-right: 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
    max-height: 42vh;
  }
}
