:root {
  --bg: #0f1115;
  --card: #171a21;
  --line: #262b36;
  --text: #e8eaf0;
  --muted: #8f97a8;
  --accent: #6d8bff;
  --accent-text: #0b0d12;
  --danger: #ff7a7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(900px 500px at 50% -10%, #1c2233 0%, var(--bg) 60%);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 520px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.row {
  display: flex;
  gap: 8px;
}

input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10131a;
  color: var(--text);
  font: inherit;
  outline: none;
}

input[type="text"]::placeholder {
  color: #5d6577;
}

input[type="text"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 139, 255, 0.25);
}

button[type="submit"] {
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button[type="submit"]:hover {
  filter: brightness(1.08);
}

.error {
  margin: 10px 2px 0;
  color: var(--danger);
  font-size: 13.5px;
}

.result {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10131a;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.result a {
  color: var(--accent);
}

.recents {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.recents-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  color: var(--text);
}

.recent-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-list:empty {
  display: none;
}

.recent-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10131a;
}

.recent-list a {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-list a:hover {
  color: var(--accent);
}

.recent-list .host {
  color: var(--muted);
}

.close {
  flex: none;
  width: 30px;
  height: 30px;
  margin-right: 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.close:hover {
  background: #20242e;
  color: var(--text);
}

.empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.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;
}
