:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #65726d;
  --line: #dce4df;
  --soft-line: #e9efeb;
  --paper: #f7f9f6;
  --white: #ffffff;
  --green: #b9f227;
  --green-dark: #739d00;
  --mint: #eafbc2;
  --violet: #6e56cf;
  --shadow: 0 20px 50px rgba(28, 45, 36, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(185, 242, 39, 0.15), transparent 23rem),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  align-items: end;
  gap: 3px;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 9px;
  background: var(--ink);
}

.brand-mark span {
  display: block;
  border-radius: 3px;
  background: var(--green);
}

.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(3rem, 8vw, 7rem);
  align-items: end;
  padding: clamp(3.8rem, 8vw, 7.5rem) 0 clamp(4rem, 9vw, 7rem);
}

.eyebrow,
.section-kicker {
  margin: 0 0 1rem;
  color: var(--green-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-dark);
  box-shadow: 0 0 0 5px rgba(115, 157, 0, 0.12);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 1.5rem;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

h1 span {
  color: var(--green-dark);
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin: 0;
}

.stat-card {
  min-height: 145px;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 34px rgba(28, 45, 36, 0.04);
}

.stat-primary {
  grid-column: span 2;
  color: var(--white);
  background: var(--ink);
}

.stat-card dt {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.stat-primary dt,
.stat-primary span {
  color: #aab8b2;
}

.stat-card dd {
  margin: 0 0 0.35rem;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.stat-primary dd {
  color: var(--green);
  font-size: 3.3rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.68rem;
}

.workspace,
.list-section {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.workspace {
  padding: clamp(1.35rem, 4vw, 2.5rem);
}

.workspace-heading,
.list-heading,
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.workspace h2,
.list-section h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: -0.035em;
}

.refresh-button,
.copy-all-button,
.reset-button,
.pagination button,
.error-panel button,
.row-copy {
  border: 0;
  border-radius: 10px;
  font-weight: 750;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.refresh-button,
.copy-all-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  color: var(--ink);
  background: var(--mint);
}

.refresh-button svg,
.copy-all-button svg {
  width: 16px;
  fill: currentColor;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(110, 86, 207, 0.3);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.refresh-button.is-loading svg {
  animation: spin 800ms linear infinite;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.85rem;
  align-items: end;
  margin-top: 2rem;
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field > span:first-child {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.input-wrap,
.select-wrap {
  position: relative;
  display: block;
}

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  width: 17px;
  fill: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.input-wrap input,
.select-wrap select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fbfcfb;
}

.input-wrap input {
  padding: 0 0.9rem 0 2.7rem;
}

.select-wrap select {
  padding: 0 2.4rem 0 0.9rem;
  appearance: none;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.input-wrap input::placeholder {
  color: #a1aaa6;
}

.reset-button {
  height: 46px;
  padding: 0 1rem;
  color: var(--muted);
  background: var(--paper);
}

.error-panel {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid #f0c8c4;
  border-radius: 14px;
  color: #752e2a;
  background: #fff3f1;
}

.error-panel:not([hidden]) {
  display: flex;
}

.error-panel p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
}

.error-panel button {
  flex: 0 0 auto;
  padding: 0.7rem 0.9rem;
  color: #fff;
  background: #9b3e37;
}

.list-section {
  margin-top: 1rem;
  overflow: hidden;
}

.list-heading {
  padding: clamp(1.35rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--soft-line);
}

.list-heading h2 span {
  margin-left: 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
}

.table-shell {
  position: relative;
  min-height: 420px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 1rem clamp(0.8rem, 2.4vw, 1.5rem);
  border-bottom: 1px solid var(--soft-line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #fbfcfb;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #53605b;
  font-size: 0.82rem;
}

tbody tr:hover {
  background: #fbfdf8;
}

.proxy-value {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
}

.protocol-badge {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: #40570a;
  background: var(--mint);
  font-size: 0.66rem;
  font-weight: 850;
}

.protocol-badge[data-protocol^="socks"] {
  color: #524096;
  background: #eeeafd;
}

.country-cell {
  color: var(--ink);
  font-weight: 650;
}

.country-cell span {
  margin-right: 0.45rem;
  font-size: 1rem;
}

.anonymity-badge {
  color: var(--muted);
  font-size: 0.72rem;
}

.row-copy {
  padding: 0.48rem 0.7rem;
  color: var(--muted);
  background: var(--paper);
}

.row-copy:hover {
  color: var(--ink);
  background: var(--mint);
}

.loading-state,
.empty-state {
  position: absolute;
  inset: 68px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  background: var(--white);
}

.loading-state[hidden],
.empty-state[hidden] {
  display: none;
}

.loading-state strong,
.empty-state strong {
  margin-top: 1rem;
  color: var(--ink);
}

.loading-state p,
.empty-state p {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
}

.loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--soft-line);
  border-top-color: var(--green-dark);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.empty-state > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--mint);
  font-size: 1.3rem;
  font-weight: 800;
}

.pagination {
  padding: 1rem clamp(1rem, 3vw, 1.5rem);
  background: #fbfcfb;
}

.pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.pagination div {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.pagination button {
  padding: 0.55rem 0.75rem;
  color: var(--ink);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pagination span {
  min-width: 64px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.7rem;
}

footer p {
  margin: 0;
}

footer a {
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: calc(100% - 2.5rem);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 14px 35px rgba(23, 35, 31, 0.25);
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clipboard-fallback {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-primary {
    grid-column: span 1;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: span 2;
  }

  .optional-column {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 68px;
  }

  .hero {
    padding: 3.2rem 0 3.5rem;
  }

  h1 {
    font-size: clamp(2.7rem, 13vw, 3.6rem);
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-primary {
    grid-column: span 2;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .workspace-heading,
  .list-heading {
    align-items: flex-start;
  }

  .refresh-button,
  .copy-all-button {
    padding: 0.7rem;
    font-size: 0;
  }

  .refresh-button svg,
  .copy-all-button svg {
    width: 18px;
  }

  th,
  td {
    padding: 0.9rem 0.75rem;
  }

  .country-cell {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  footer {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
