/* Loaded after yandex.css so the proxy widget wins the legacy cascade. */
.screen-home .proxy-status-card {
  position: relative;
  z-index: 2;
  display: inline-grid;
  width: auto;
  min-width: 176px;
  min-height: 42px;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 7px 9px;
  border: 1px solid rgba(238, 238, 239, .95);
  border-radius: 15px;
  background: rgba(255, 255, 255, .86);
  color: #111;
  text-align: left;
  box-shadow: 0 8px 20px rgba(20, 24, 32, .045);
  backdrop-filter: blur(10px);
  transform: none !important;
}

.screen-home .proxy-status-card:hover,
.screen-home .proxy-status-card:focus-visible,
.screen-home .proxy-status-card:active {
  border-color: rgba(255, 79, 94, .22);
  background: rgba(255, 255, 255, .94);
  outline: none;
  transform: none !important;
}

.proxy-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b8bdc7;
  box-shadow: 0 0 0 5px rgba(184, 189, 199, .14);
}

.proxy-status-dot[data-state="alive"] {
  background: #21c76a;
  box-shadow: 0 0 0 5px rgba(33, 199, 106, .16), 0 0 18px rgba(33, 199, 106, .34);
}

.proxy-status-dot[data-state="partial"],
.proxy-status-dot[data-state="checking"] {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 79, 94, .13), 0 0 18px rgba(255, 79, 94, .28);
}

.proxy-status-dot[data-state="dead"] {
  background: #c7cbd3;
  box-shadow: 0 0 0 5px rgba(199, 203, 211, .18);
}

.proxy-status-card span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 0;
}

.proxy-status-card small {
  overflow: hidden;
  color: #8d939d;
  font-size: 8px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-status-card strong {
  overflow: hidden;
  color: #111;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -.25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-status-card b {
  padding: 4px 7px;
  border-radius: 999px;
  background: #fff0f1;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-proxy-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 12px;
}

.admin-proxy-summary,
.admin-proxy-row,
.admin-proxy-empty {
  border: 1px solid #eeeeef;
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 24, 32, .04);
}

.admin-proxy-summary {
  display: grid;
  min-height: 54px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border-radius: 18px;
}

.admin-proxy-summary span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-proxy-summary strong {
  color: #111;
  font-size: 13px;
  font-weight: 900;
}

.admin-proxy-summary small {
  color: #8f949d;
  font-size: 10px;
  font-weight: 750;
}

.admin-proxy-summary b {
  grid-column: 1 / -1;
  display: grid;
  width: 100%;
  min-width: 44px;
  min-height: 28px;
  place-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f8ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.admin-proxy-sort-btn {
  min-height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: #f4f5f7;
  color: #111;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-proxy-sort-btn:hover,
.admin-proxy-sort-btn:focus-visible {
  background: #eceff3;
  outline: none;
}

.admin-proxy-row {
  display: grid;
  min-height: 48px;
  grid-template-columns: 10px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 16px;
}

.admin-proxy-row i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c7cbd3;
  box-shadow: 0 0 0 5px rgba(199, 203, 211, .18);
}

.admin-proxy-row[data-state="alive"] i {
  background: #21c76a;
  box-shadow: 0 0 0 5px rgba(33, 199, 106, .16), 0 0 16px rgba(33, 199, 106, .28);
}

.admin-proxy-row span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-proxy-row strong {
  overflow: hidden;
  color: #111;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-proxy-row small {
  overflow: hidden;
  color: #8f949d;
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-proxy-row b {
  padding: 6px 8px;
  border-radius: 999px;
  background: #f1f2f4;
  color: #8f939b;
  font-size: 9px;
  font-weight: 900;
}

.admin-proxy-row[data-state="alive"] b {
  background: #eafbf2;
  color: #159c52;
}

.admin-proxy-pingbar {
  grid-column: 2 / 5;
  display: block !important;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f2;
}

.admin-proxy-pingbar span {
  display: block !important;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #28d477, #1683ff);
}

.admin-proxy-row[data-state="dead"] .admin-proxy-pingbar span {
  background: #c7cbd3;
}

.admin-proxy-delete {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #eeeeef;
  border-radius: 11px;
  background: #fff7f8;
  color: var(--accent);
}

.admin-proxy-delete svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-proxy-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}

.admin-proxy-pager button {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid #eeeeef;
  border-radius: 12px;
  background: #fff;
  color: #111;
  font-size: 11px;
  font-weight: 850;
}

.admin-proxy-pages {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.admin-proxy-pages button[data-active="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 79, 94, .18);
}

.admin-proxy-page-arrow {
  font-size: 18px !important;
  line-height: 1;
}

.admin-proxy-pager button:disabled {
  background: #f1f2f4;
  color: #b2b6bd;
  opacity: 1;
}

.admin-proxy-pages small {
  min-width: 14px;
  color: #8f949d;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.admin-proxy-empty {
  padding: 14px 12px;
  border-radius: 16px;
  color: #8f949d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-panel .admin-textarea-field textarea#adminProxyInput {
  min-height: 92px;
  max-height: 132px;
  font-size: 10px;
  line-height: 1.45;
}

#adminProxyPanel .admin-panel-head {
  align-items: flex-start;
}

#adminProxyAddBtn {
  transform: translateY(-3px);
}

#adminProxyAddBtn:active {
  transform: translateY(-2px) scale(.99);
}

@media (max-width: 360px) {
  .screen-home .proxy-status-card {
    min-width: 166px;
    min-height: 40px;
    margin-top: 10px;
    padding: 7px 8px;
  }

  .proxy-status-card strong {
    font-size: 11px;
  }

  .proxy-status-card b {
    padding-inline: 7px;
    font-size: 9px;
  }

  .admin-proxy-row {
    grid-template-columns: 9px minmax(0, 1fr) 34px;
  }

  .admin-proxy-row b {
    grid-column: 2;
    justify-self: start;
  }

  .admin-proxy-pingbar {
    grid-column: 2 / 4;
  }

  .admin-proxy-delete {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}
