/* Link Gap: shared by the standalone page and the project Backlinks > Link Gap view.
   Brand tokens with fallbacks; the site forces every svg to 1em, so icon sizes
   below are set with !important on purpose. */

.nslg { color: var(--text-primary, #e5e5e5); font-size: 14px; }
/* Standalone page: same frame as the other tool pages (/backlinks/ is 1100). */
.nslg--standalone { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
@media (max-width: 600px) { .nslg--standalone { padding: 20px 0; } }
.nslg-lookup { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border, rgba(255,255,255,0.08)); }
.nslg-cost-tag { color: var(--primary, #fbbf24); font-size: 12px; font-weight: 600; margin-left: 4px; }
.nslg-lookup-geo[hidden] { display: none; }
.nslg-lookup-geo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nslg-lookup-geo .nslg-select { width: auto; flex: 1 1 160px; }
.nslg-lookup-geo .nslg-help { flex-basis: 100%; margin-top: 2px; }
.nslg * { box-sizing: border-box; }
.nslg svg { width: 16px !important; height: 16px !important; flex: none; vertical-align: -3px; }
.nslg .nslg-icon-sm svg, .nslg svg.nslg-icon-sm { width: 13px !important; height: 13px !important; }
.nslg a { color: var(--primary, #fbbf24); text-decoration: none; }
.nslg a:hover { text-decoration: underline; }
.nslg button { font-family: inherit; }

.nslg-card { background: var(--bg-tertiary, #1a1a1a); border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.nslg-card h3 { font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }

/* Form */
.nslg-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; }
@media (max-width: 800px) { .nslg-form-grid { grid-template-columns: 1fr; } }
.nslg-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
    color: var(--text-secondary, #a1a1a1); margin-bottom: 6px; }
.nslg-input, .nslg-select, .nslg-textarea { width: 100%; background: var(--surface, #1f1f1f); color: var(--text-primary, #e5e5e5);
    border: 1px solid var(--border-light, rgba(255,255,255,0.12)); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.nslg-input:focus, .nslg-select:focus, .nslg-textarea:focus { outline: none; border-color: var(--primary, #fbbf24); }
.nslg-input.is-invalid { border-color: var(--danger, #ef4444); }
.nslg-input[readonly] { color: var(--text-secondary, #a1a1a1); }
.nslg-textarea { min-height: 70px; resize: vertical; font-family: inherit; }
.nslg-comp-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.nslg-comp-row .nslg-num { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center;
    justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.nslg-icon-btn { background: transparent; border: 1px solid var(--border-light, rgba(255,255,255,0.12));
    color: var(--text-secondary, #a1a1a1); border-radius: 8px; width: 36px; height: 38px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nslg-icon-btn:hover { color: var(--text-primary, #e5e5e5); background: var(--surface-hover, #252525); }
.nslg-link-btn { background: none; border: none; color: var(--primary, #fbbf24); cursor: pointer; padding: 4px 0;
    font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.nslg-chips-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.nslg-suggest { background: var(--surface, #1f1f1f); border: 1px dashed var(--border-light, rgba(255,255,255,0.12));
    color: var(--text-secondary, #a1a1a1); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.nslg-suggest:hover { color: var(--text-primary, #e5e5e5); border-color: var(--primary, #fbbf24); }
.nslg-options { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: center; margin-top: 14px; }
.nslg-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-secondary, #a1a1a1); }
.nslg-check input { accent-color: var(--primary, #fbbf24); width: 15px; height: 15px; }
.nslg-inline-select { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary, #a1a1a1); }
.nslg-inline-select .nslg-select { width: auto; padding: 6px 10px; }
.nslg-advanced { margin-top: 12px; }
.nslg-advanced summary { cursor: pointer; color: var(--text-secondary, #a1a1a1); font-size: 13px; }
.nslg-advanced[open] summary { margin-bottom: 10px; }
.nslg-help { color: var(--text-muted, #6b6b6b); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.nslg-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.nslg-btn { background: linear-gradient(135deg, var(--primary, #fbbf24), var(--primary-dark, #f59e0b)); color: var(--bg-primary, #0a0a0a);
    border: none; padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; }
.nslg-btn:disabled { opacity: .5; cursor: not-allowed; }
.nslg-btn-ghost { background: var(--surface, #1f1f1f); color: var(--text-primary, #e5e5e5); border: 1px solid var(--border-light, rgba(255,255,255,0.12));
    padding: 9px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.nslg-btn-ghost:hover { background: var(--surface-hover, #252525); }
.nslg-msg { color: var(--danger, #ef4444); font-size: 13px; min-height: 18px; }
.nslg-msg.is-info { color: var(--text-secondary, #a1a1a1); }
.nslg-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(10,10,10,.3); border-top-color: var(--bg-primary, #0a0a0a);
    border-radius: 50%; animation: nslgspin .8s linear infinite; }
@keyframes nslgspin { to { transform: rotate(360deg); } }

/* Notices */
.nslg-notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 10px;
    background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.3); color: var(--text-primary, #e5e5e5); line-height: 1.5; }
.nslg-notice svg { color: var(--ns-info, #3b82f6); margin-top: 2px; }
.nslg-notice.is-warn { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.3); }
.nslg-notice.is-warn svg { color: var(--warning, #f59e0b); }

/* Summary strip */
.nslg-run-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; color: var(--text-secondary, #a1a1a1); font-size: 13px; margin-bottom: 14px; }
.nslg-run-meta strong { color: var(--text-primary, #e5e5e5); }
.nslg-strip { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .nslg-strip { grid-template-columns: 1fr; } }
.nslg-bars { display: flex; flex-direction: column; gap: 9px; }
.nslg-bar-row { display: grid; grid-template-columns: minmax(90px, 190px) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.nslg-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.nslg-bar-track { height: 10px; background: var(--surface, #1f1f1f); border-radius: 999px; overflow: hidden; }
.nslg-bar-fill { height: 100%; border-radius: 999px; }
.nslg-bar-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 64px; text-align: right; }
.nslg-bar-sub { color: var(--text-muted, #6b6b6b); font-size: 12px; font-weight: 400; }
.nslg-delta { font-size: 12px; font-weight: 600; margin-left: 6px; color: var(--text-secondary, #a1a1a1); }
.nslg-delta.is-alert { color: var(--warning, #f59e0b); }
.nslg-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nslg-stat { background: var(--surface, #1f1f1f); border-radius: 10px; padding: 12px; }
.nslg-stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nslg-stat .l { color: var(--text-secondary, #a1a1a1); font-size: 12px; margin-top: 2px; }
.nslg-types { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Chips */
.nslg-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface, #1f1f1f); color: var(--text-secondary, #a1a1a1);
    border: 1px solid var(--border-light, rgba(255,255,255,0.12)); border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer; }
.nslg-chip .n { color: var(--text-muted, #6b6b6b); font-variant-numeric: tabular-nums; }
.nslg-chip.is-on { color: var(--text-primary, #e5e5e5); border-color: var(--primary, #fbbf24); background: rgba(251,191,36,.08); }
.nslg-chip.is-on .n { color: var(--text-secondary, #a1a1a1); }

/* Controls */
.nslg-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.nslg-controls .nslg-input { width: 240px; padding: 8px 12px; }
.nslg-controls .nslg-grow { flex: 1 1 auto; }
.nslg-auth { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary, #a1a1a1); font-size: 13px; }
.nslg-controls .nslg-auth input.nslg-input { width: 64px; padding: 6px 8px; }

/* Table */
.nslg-table-wrap { overflow-x: auto; border: 1px solid var(--border, rgba(255,255,255,0.08)); border-radius: 10px; }
.nslg-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.nslg-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
    color: var(--text-secondary, #a1a1a1); padding: 10px; border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    white-space: nowrap; background: var(--bg-secondary, #111111); position: sticky; top: 0; }
.nslg-table th[data-sort] { cursor: pointer; }
.nslg-table th[data-sort]:hover { color: var(--text-primary, #e5e5e5); }
.nslg-table th .dir { color: var(--primary, #fbbf24); }
.nslg-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.nslg-table tr.is-hidden-row { opacity: .45; }
.nslg-dom { display: flex; align-items: center; gap: 6px; max-width: 240px; }
.nslg-dom a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nslg-new { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--bg-primary, #0a0a0a); background: var(--success, #10b981);
    border-radius: 4px; padding: 1px 5px; flex: none; }
.nslg-prio { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 3px 8px; border-radius: 6px;
    font-weight: 700; font-variant-numeric: tabular-nums; }
.nslg-prio.p-high { background: rgba(16,185,129,.15); color: var(--success, #10b981); }
.nslg-prio.p-mid { background: rgba(251,191,36,.12); color: var(--primary, #fbbf24); }
.nslg-prio.p-low { background: var(--surface, #1f1f1f); color: var(--text-muted, #6b6b6b); }
.nslg-type { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nslg-type select { background: transparent; color: inherit; border: 1px solid transparent; border-radius: 6px; padding: 3px 2px; font-size: 13px; cursor: pointer; }
.nslg-type select:hover, .nslg-type select:focus { border-color: var(--border-light, rgba(255,255,255,0.12)); background: var(--surface, #1f1f1f); outline: none; }
.nslg-type select option { background: var(--bg-tertiary, #1a1a1a); }
.nslg-badges { display: flex; gap: 4px; }
.nslg-badge { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; }
.nslg-badge.is-off { background: transparent !important; color: var(--text-muted, #6b6b6b) !important; border: 1px dashed var(--border-light, rgba(255,255,255,0.12)); }
.nslg-page { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.nslg-anchor { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary, #a1a1a1); }
.nslg-muted { color: var(--text-muted, #6b6b6b); }
.nslg-status { background: var(--surface, #1f1f1f); color: var(--text-primary, #e5e5e5); border: 1px solid var(--border-light, rgba(255,255,255,0.12));
    border-radius: 6px; padding: 4px 6px; font-size: 13px; }
.nslg-status[data-v="won"] { border-color: rgba(16,185,129,.5); color: var(--success, #10b981); }
.nslg-status[data-v="target"] { border-color: rgba(251,191,36,.5); color: var(--primary, #fbbf24); }
.nslg-status[data-v="skip"] { color: var(--text-muted, #6b6b6b); }
.nslg-row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.nslg-row-actions .nslg-icon-btn { width: 30px; height: 30px; }
.nslg-detail td { background: var(--bg-secondary, #111111); padding: 14px 16px; }
.nslg-detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .nslg-detail-grid { grid-template-columns: 1fr; } }
.nslg-detail h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-secondary, #a1a1a1); }
.nslg-detail ul { margin: 0; padding: 0; list-style: none; }
.nslg-detail li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); display: flex; gap: 8px; align-items: baseline; }
.nslg-detail li .u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.nslg-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 10px; }
.nslg-detail dt { color: var(--text-secondary, #a1a1a1); }
.nslg-detail dd { margin: 0; }
.nslg-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; color: var(--text-secondary, #a1a1a1); font-size: 13px; flex-wrap: wrap; }
.nslg-pager .btns { display: flex; gap: 6px; }

.nslg-empty { text-align: center; padding: 36px 16px; color: var(--text-secondary, #a1a1a1); line-height: 1.6; }
.nslg-empty svg { width: 32px !important; height: 32px !important; color: var(--success, #10b981); margin-bottom: 8px; }
.nslg-won li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.nslg-won ul { list-style: none; margin: 0; padding: 0; }
.nslg-history { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nslg-history .nslg-select { width: auto; min-width: 280px; }

/* Competitor colours: badges, bars and dots share them. Series 1-3 are brand
   tokens; 4-5 have no token, so they are defined once here. */
.nslg { --nslg-c4: #f472b6; --nslg-c5: #a78bfa; }
.nslg-c0 { background: var(--text-primary, #e5e5e5); color: var(--bg-primary, #0a0a0a); }
.nslg-c1 { background: var(--primary, #fbbf24); color: var(--bg-primary, #0a0a0a); }
.nslg-c2 { background: var(--ns-info, #3b82f6); color: var(--bg-primary, #0a0a0a); }
.nslg-c3 { background: var(--success, #10b981); color: var(--bg-primary, #0a0a0a); }
.nslg-c4 { background: var(--nslg-c4); color: var(--bg-primary, #0a0a0a); }
.nslg-c5 { background: var(--nslg-c5); color: var(--bg-primary, #0a0a0a); }

/* Project sub-navigation inside the Backlinks tab */
.nslg-subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--border, rgba(255,255,255,0.08)); margin-bottom: 20px; }
.nslg-subnav a { padding: 10px 16px; color: var(--text-secondary, #a1a1a1); border-bottom: 2px solid transparent; margin-bottom: -1px;
    font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.nslg-subnav a:hover { color: var(--text-primary, #e5e5e5); text-decoration: none; }
.nslg-subnav a.is-active { color: var(--primary, #fbbf24); border-bottom-color: var(--primary, #fbbf24); }
.nslg-subnav svg { width: 16px !important; height: 16px !important; }

.nslg-bar-name .nslg-badge { flex: none; }
@media (max-width: 600px) {
    .nslg-controls .nslg-input { width: 100%; }
    .nslg-controls > * { max-width: 100%; }
    .nslg-auth { flex-wrap: wrap; }
    .nslg-bar-row { grid-template-columns: minmax(0, 1fr) auto; }
    .nslg-bar-row .nslg-bar-track { grid-column: 1 / -1; order: 3; }
    .nslg-stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
    .nslg-history .nslg-select { min-width: 0; width: 100%; }
    .nslg-card { padding: 16px; }
}
