/* ==========================================================================
   links.css — страница «Ссылки»
   ========================================================================== */

.lk-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ==========================================================================
   Сводка
   ========================================================================== */
.lk-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.stat-card__ico--violet { background: var(--violet-soft); color: var(--violet); }

/* ==========================================================================
   Ряд: топ-страницы + распределение
   ========================================================================== */
.lk-middle {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: stretch;
}

.lk-targets__table td:first-child,
.lk-targets__table th:first-child { width: 100%; }

.lk-targets__url {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--brand);
}
.lk-targets__url .icon { flex: none; color: var(--brand); }
.lk-targets__url span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- распределение --- */
.lk-dist {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  margin: 6px 0 auto;
}

.lk-dist__chart { position: relative; display: grid; place-items: center; }

.lk-dist__center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.lk-dist__total {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lk-dist__total-label { margin-top: 1px; font-size: 10.5px; color: var(--text-3); }

.lk-dist__legend { display: flex; flex-direction: column; gap: 11px; }

.lk-dist__item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
}

.lk-dist__dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
}

.lk-dist__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

.lk-dist__percent { font-weight: 600; white-space: nowrap; }

/* ==========================================================================
   Нижний ряд
   ========================================================================== */
.lk-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: stretch;
}

.lk-ref__title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lk-ref__target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--brand);
}
.lk-ref__target span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lk-ref__table { font-size: 12px; }
.lk-ref__table th { padding-bottom: 10px; }
.lk-ref__table td { padding: 11px 0; }
.lk-ref__table td + td, .lk-ref__table th + th { padding-left: 14px; }

.lk-ref__source {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 250px;
  color: var(--brand);
}
.lk-ref__source .icon { flex: none; }
.lk-ref__source span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lk-ref__anchor {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

.lk-ref__domain {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: var(--text-2);
}
.lk-ref__domain .icon { color: var(--text-3); }

.lk-ref__date { white-space: nowrap; }
.lk-ref__ago { display: block; margin-top: 2px; font-size: 11px; color: var(--text-3); }

/* --- форма привязки --- */
.lk-form { display: flex; flex-direction: column; gap: 12px; }

.lk-form__label {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  color: var(--text-2);
}

.lk-form .field,
.lk-form .select { height: 40px; }

.lk-form__foot { margin-top: auto; padding-top: 16px; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1150px) {
  .lk-middle,
  .lk-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .lk-summary { grid-template-columns: 1fr; }
  .lk-dist { grid-template-columns: 1fr; justify-items: center; }
}
