:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --text: #111827;
  --muted: #64748b;
  --accent: #2563eb;
  --danger: #be123c;
  --shadow: 0 16px 42px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 360px;
  min-height: 220px;
  max-height: 600px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  padding: 12px;
  overflow: auto;
}

.popup {
  width: 100%;
  max-height: 576px;
  overflow-y: auto;
}

.card {
  display: grid;
  gap: 12px;
  padding: 14px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.header,
.feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title {
  font-size: 18px;
  font-weight: 900;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.warning {
  padding: 12px;
  border: 1px solid rgba(190, 18, 60, 0.18);
  border-radius: 8px;
  background: #fff1f2;
  color: var(--danger);
  font-weight: 800;
}

.flow,
.feature-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.subtitle,
.help-text,
.status {
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  word-break: break-word;
}

.help-text a,
.message-box a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  word-break: break-all;
}

.ipv6-card,
details,
.message-box,
.loader {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ipv6-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ipv6-value {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.copy-btn,
.primary-btn,
.danger-btn,
.message-button,
.button-row button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.primary-btn,
.message-button {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.message-button.proxy-first {
  background: #16a34a;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.22);
}

.danger-btn {
  width: 100%;
  color: var(--danger);
  background: #fff1f2;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: var(--muted);
  font-size: 13px;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  color: var(--text);
}

summary {
  cursor: pointer;
  font-weight: 900;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.button-row button[data-active="true"] {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

.loader {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.message-box {
  line-height: 1.5;
  word-break: break-word;
}

.message-box.proxy-first {
  border-color: rgba(22, 163, 74, 0.24);
  background: #f0fdf4;
  color: #166534;
}

.message-box.proxy-second {
  border-color: rgba(190, 18, 60, 0.24);
  background: #fff1f2;
  color: #be123c;
}
