:root {
  --bg: #08080a;
  --panel: #101013;
  --line: #1f1f24;
  --text: #f4f4f5;
  --muted: #8b8b93;
  --accent: #ea580c;
  --accent-soft: #fb923c;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(700px 400px at 50% -10%, rgba(234, 88, 12, 0.12), transparent 70%);
  min-height: 100vh;
}

.bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.brand {
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
}

.tag {
  color: var(--muted);
  font-size: 0.82rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--line);
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  display: grid;
  gap: 1.25rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}

h2 {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.count {
  color: var(--accent-soft);
  font-variant-numeric: tabular-nums;
}

label > span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

label > span em {
  font-style: normal;
  opacity: 0.6;
}

form > label {
  display: block;
  margin-bottom: 1rem;
}

input[type="text"] {
  width: 100%;
  background: #0a0a0c;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.65rem 0.8rem;
  color: var(--text);
  font: inherit;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.16);
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.15rem;
}

legend {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
  padding: 0;
}

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.55rem;
}

.mode {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  background: #0a0a0c;
  transition: border-color 120ms ease, background 120ms ease;
}

.mode:hover { border-color: #2c2c33; }

.mode:has(input:checked) {
  border-color: var(--accent);
  background: rgba(234, 88, 12, 0.07);
}

.mode input {
  margin: 0.22rem 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.mode strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mode p {
  margin: 0.15rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}

button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 0.68rem 1.4rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 120ms ease, transform 60ms ease;
}

button[type="submit"]:hover { background: #d94d09; }
button[type="submit"]:active { transform: translateY(1px); }
button[type="submit"]:disabled { opacity: 0.55; cursor: default; }

.error {
  margin: 0.7rem 0 0;
  color: #fca5a5;
  font-size: 0.82rem;
}

.list {
  display: grid;
  gap: 0.5rem;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.row {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.7rem 0.85rem;
  background: #0a0a0c;
}

.row-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.short {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 500;
}

.short:hover { text-decoration: underline; }

.badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.12rem 0.42rem;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

.badge.mode-proxy,
.badge.mode-browser { color: #7dd3fc; border-color: #164e63; }
.badge.mode-iframe { color: #c4b5fd; border-color: #3b2f6b; }
.badge.mode-redirect { color: #86efac; border-color: #20462c; }

.spacer { flex: 1; }

.hits {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mini {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.22rem 0.5rem;
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.mini:hover { color: var(--text); border-color: #33333a; }
.mini.danger:hover { color: #fca5a5; border-color: #7f1d1d; }

.target {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
