* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #0f1419;
  color: #e7e9ea;
  line-height: 1.5;
}

header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #2f3336;
  background: #16181c;
}

h1 {
  margin: 0;
  font-size: 1.25rem;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

nav.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

nav.tabs button {
  background: #16181c;
  border: 1px solid #2f3336;
  color: #e7e9ea;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

nav.tabs button.active {
  background: #1d9bf0;
  border-color: #1d9bf0;
  color: #fff;
}

section.panel {
  display: none;
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

section.panel.active {
  display: block;
}

label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #71767b;
}

input,
select,
button.action {
  margin-top: 0.35rem;
}

input,
select {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #2f3336;
  background: #0f1419;
  color: #e7e9ea;
}

button.action {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: #1d9bf0;
  color: #fff;
  cursor: pointer;
}

button.action.danger {
  background: #f4212e;
}

button.action.secondary {
  background: #2f3336;
}

.port-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.port-grid button {
  min-width: 4rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #2f3336;
  background: #0f1419;
  color: #e7e9ea;
  cursor: pointer;
}

.port-grid button.recommended {
  border-color: #00ba7c;
  color: #00ba7c;
}

.port-grid button.selected {
  background: #1d9bf0;
  border-color: #1d9bf0;
  color: #fff;
}

.message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 6px;
  background: #0f1419;
  white-space: pre-wrap;
  word-break: break-all;
}

.message.error {
  border: 1px solid #f4212e;
  color: #f4212e;
}

.message.ok {
  border: 1px solid #00ba7c;
  color: #00ba7c;
}

.proxy-card {
  border: 1px solid #2f3336;
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.75rem;
}

.proxy-card img {
  margin-top: 0.5rem;
  background: #fff;
  padding: 4px;
}

#login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#login-box {
  background: #16181c;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #2f3336;
  width: 100%;
  max-width: 360px;
}

.hidden {
  display: none !important;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #2f3336;
  font-size: 0.9rem;
}

.warn {
  color: #ffad1f;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
