:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --border: rgba(15, 18, 25, 0.08);
  --text: #050608;
  --muted: rgba(5, 6, 8, 0.55);
  --accent: #050608;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(920px, 94vw);
  margin: 40px auto 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.masthead {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted);
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel h2 {
  margin: 0;
}

textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 1.1rem 1.25rem;
  min-height: 150px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.4;
  color: var(--text);
  background: rgba(5, 6, 8, 0.02);
  resize: vertical;
}

textarea:focus {
  outline: 2px solid rgba(5, 6, 8, 0.5);
}

.input-actions {
  display: flex;
  justify-content: flex-end;
}

button {
  border-radius: 999px;
  border: 1px solid rgba(5, 6, 8, 0.3);
  background: transparent;
  color: var(--text);
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  background: #ffffff;
  border: 1px solid rgba(5, 6, 8, 0.9);
  box-shadow: 0 10px 20px rgba(5, 6, 8, 0.08);
}

button.ghost {
  border: 1px solid rgba(5, 6, 8, 0.2);
}

.key-status {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.stats-panel {
  flex-direction: column;
  gap: 18px;
}

.stats-panel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 0;
}

.stats-panel p:last-child {
  margin: 0;
  font-size: 1.8rem;
}

#heroBadCount {
  color: #c23737;
}

#heroCleanCount {
  color: #2c8c52;
}

.results-panel {
  gap: 20px;
}

.pill {
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) minmax(200px, 1fr) minmax(240px, 0.8fr);
  gap: 20px;
  padding: 18px 22px;
  border-radius: 12px;
  border: 1px solid rgba(15, 18, 25, 0.08);
  background: #fafafa;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1 1 320px;
}

.result-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.result-main-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-flag {
  width: 40px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(5, 6, 8, 0.1);
  flex-shrink: 0;
}

.result-flag--empty {
  border-style: dashed;
  background: rgba(5, 6, 8, 0.03);
}

.result-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-ip {
  margin: 0;
  font-weight: 600;
  word-break: break-all;
}

.result-location {
  margin: 0;
  font-size: 0.9rem;
}

.result-isp,
.result-status {
  margin: 0;
  font-size: 0.95rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-status.success {
  color: #30845a;
}

.result-status.warning {
  color: #b58100;
}

.result-status.error {
  color: #ba1b1b;
}

.result-score {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  margin: 0;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(43, 100, 216, 0.1);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2b64d8, #6bb4ff);
  transition: width 0.2s ease;
}

.score-line {
  display: block;
}

.result-status-block {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  min-width: 0;
}

.result-status {
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  text-align: right;
  padding-right: 12px;
  flex-shrink: 0;
}

.result-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 125, 242, 0.35);
  background: rgba(61, 125, 242, 0.12);
  color: #2b64d8;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 150px;
  justify-content: center;
}

.result-link-text {
  display: flex;
  flex-direction: column;
  text-transform: uppercase;
  line-height: 1.1;
}

.result-link-text span:last-child {
  letter-spacing: 0.15em;
}

.result-link-arrow {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.muted {
  color: var(--muted);
}

.result-card.success {
  background: rgba(77, 176, 130, 0.08);
  border-color: rgba(77, 176, 130, 0.3);
}

.result-card.warning {
  background: rgba(255, 193, 59, 0.12);
  border-color: rgba(255, 193, 59, 0.4);
}

.result-card.error {
  background: rgba(244, 105, 105, 0.12);
  border-color: rgba(244, 105, 105, 0.4);
}

@media (max-width: 720px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .result-card {
    grid-template-columns: 1fr;
  }

  .result-status-block {
    width: 100%;
  }
}
