/* منبع‌های جست‌وجوی وب زیرِ پاسخ — docs/WEB_SEARCH.md §۵
   تمِ پیش‌فرضِ چت تیره است و روشن با [data-theme="light"] می‌آید. */

.nws {
  --nws-fg: rgba(226, 232, 240, 0.92);
  --nws-dim: rgba(226, 232, 240, 0.58);
  --nws-bg: rgba(255, 255, 255, 0.045);
  --nws-bg-hover: rgba(255, 255, 255, 0.09);
  --nws-edge: rgba(255, 255, 255, 0.10);
  --nws-accent: #7dd3fc;
  direction: rtl;
  margin: 12px 0 2px;
  padding-top: 10px;
  border-top: 1px solid var(--nws-edge);
  max-width: 100%;
}
[data-theme="light"] .nws {
  --nws-fg: #1e293b;
  --nws-dim: #64748b;
  --nws-bg: rgba(15, 23, 42, 0.035);
  --nws-bg-hover: rgba(15, 23, 42, 0.075);
  --nws-edge: rgba(15, 23, 42, 0.10);
  --nws-accent: #0369a1;
}

.nws-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--nws-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
}
.nws-head svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
.nws-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--nws-bg-hover);
  color: var(--nws-fg);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.nws-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nws-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 34px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--nws-edge);
  border-radius: 999px;
  background: var(--nws-bg);
  color: var(--nws-fg);
  font-size: 12.5px;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  animation: nws-in 0.32s ease both;
  animation-delay: calc(var(--nws-i, 0) * 45ms);
  -webkit-tap-highlight-color: transparent;
}
.nws-chip:hover {
  background: var(--nws-bg-hover);
  border-color: color-mix(in srgb, var(--nws-accent) 45%, var(--nws-edge));
  transform: translateY(-1px);
}
.nws-chip:focus-visible,
.nws-cite:focus-visible {
  outline: 2px solid var(--nws-accent);
  outline-offset: 2px;
}
.nws-n {
  color: var(--nws-dim);
  font-size: 11.5px;
  font-weight: 700;
}
.nws-mono {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: hsl(var(--nws-h, 200) 55% 42%);
  color: #fff;
  font: 700 11px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.nws-host {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* [n] در متن — بالانویسِ کوچک و لمس‌پذیر */
.nws-cite {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin: 0 2px;
  padding: 0 4px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--nws-accent, #7dd3fc) 18%, transparent);
  color: var(--nws-accent, #7dd3fc);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  vertical-align: 0.35em;
  transition: background-color 0.15s ease;
}
.text .nws-cite { --nws-accent: #7dd3fc; }
[data-theme="light"] .text .nws-cite { --nws-accent: #0369a1; }
.nws-cite:hover { background: color-mix(in srgb, var(--nws-accent, #7dd3fc) 32%, transparent); }

@keyframes nws-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nws-chip { animation: none; transition: none; }
  .nws-chip:hover { transform: none; }
}
