:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #111821;
  --surface: #151d28;
  --surface-strong: #1a2430;
  --text: #f6f8fb;
  --muted: #adbac8;
  --border: #233142;
  --primary: #3be05f;
  --primary-dark: #2ac24e;
  --focus-ring: rgba(59, 224, 95, 0.18);
  --ok-bg: rgba(59, 224, 95, 0.16);
  --ok-text: #79f495;
  --warning-bg: rgba(255, 196, 87, 0.14);
  --warning-text: #ffd36e;
  --error-bg: rgba(255, 107, 107, 0.14);
  --error-text: #ff9d9d;
  --gray-bg: rgba(173, 186, 200, 0.12);
  --gray-text: #cad5e1;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(59, 224, 95, 0.08) 0, rgba(59, 224, 95, 0) 320px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.shell-narrow {
  width: min(1120px, calc(100% - 32px));
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.hero-stack {
  align-items: flex-start;
}

.page-title {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

.download-extension-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: 0 0 auto;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  overflow: hidden;
  border: 1px solid rgba(59, 224, 95, 0.34);
  border-radius: 999px;
  padding: 0 11px;
  background: var(--primary);
  color: #08110a;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(59, 224, 95, 0.22);
  transition:
    width 0.28s ease,
    gap 0.28s ease,
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.download-extension-button:hover {
  transform: translateY(-1px);
  width: 154px;
  gap: 8px;
  border-color: #7bff97;
  background: #49e968;
  color: #08110a;
  box-shadow: 0 14px 30px rgba(59, 224, 95, 0.28);
}

.download-extension-button i {
  font-size: 0.82rem;
}

.download-extension-button__label {
  order: 1;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 0.78rem;
  transition:
    max-width 0.28s ease,
    opacity 0.18s ease;
}

.download-extension-button__arrow {
  order: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.download-extension-button:hover .download-extension-button__label,
.download-extension-button:focus-visible .download-extension-button__label {
  max-width: 112px;
  opacity: 1;
}

.download-extension-button:focus-visible {
  width: 154px;
  gap: 8px;
  outline: none;
  border-color: #7bff97;
  box-shadow:
    0 0 0 4px rgba(59, 224, 95, 0.18),
    0 14px 30px rgba(59, 224, 95, 0.28);
}

.secondary-link-button,
.primary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 15px;
  font-weight: 800;
  text-decoration: none;
}

.secondary-link-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.secondary-link-button:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
  color: var(--primary);
}

.primary-link-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #08110a;
}

.primary-link-button:hover {
  background: #49e968;
  color: #08110a;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow,
.check-form label,
.section-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-form label {
  gap: 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.85rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.6rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 0.98rem;
}

.subtitle {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel,
.section-card,
.loading {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 12px;
  margin-bottom: 10px;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.86rem;
}

.extension-browser-panel,
.extension-notes-panel {
  padding: 18px;
}

.browser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.browser-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--surface);
}

.browser-card-ready {
  box-shadow: inset 0 0 0 1px rgba(59, 224, 95, 0.04);
}

.browser-card-soon {
  opacity: 0.95;
}

.browser-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.browser-title-with-logo {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
}

.browser-title-with-logo h2 {
  margin: 0;
}

.browser-card__header h2 {
  font-size: 1.08rem;
}

.browser-card__copy {
  min-height: 48px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.browser-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.browser-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 30px;
  border: 1px solid rgba(59, 224, 95, 0.18);
  border-radius: 999px;
  padding: 0;
  background: rgba(59, 224, 95, 0.08);
  color: #bffbcb;
  font-size: 0.82rem;
  font-weight: 750;
}

.browser-pill::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.browser-pill:hover::after,
.browser-pill:focus-visible::after {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.browser-pill i {
  font-size: 1rem;
}

.browser-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.browser-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.browser-action {
  width: fit-content;
}

.browser-placeholder {
  color: var(--warning-text);
  font-size: 0.84rem;
  font-weight: 750;
}

.extension-notes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.extension-notes p {
  margin-bottom: 0;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.check-form label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 750;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button i {
  font-size: 0.95rem;
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
}

.secondary-button:hover {
  background: var(--surface-strong);
  border-color: var(--primary);
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.share-box {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.share-box-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-link {
  flex: 1 1 auto;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-link:hover {
  color: var(--primary);
}

.share-status {
  margin: 0;
  flex: 1 1 auto;
  font-size: 0.82rem;
}

.copy-feedback {
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.share-copy-button {
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
}

.share-copy-button i {
  font-size: 0.82rem;
}

.recheck-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  border: 1px solid var(--border);
  padding: 0 8px;
  background: var(--surface);
  color: var(--primary);
}

.important-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  border: 1px solid var(--border);
  padding: 0 8px;
  background: var(--surface);
  color: var(--muted);
}

.important-button:hover {
  border-color: #f7c948;
  background: rgba(247, 201, 72, 0.12);
  color: #ffd76a;
}

.important-button.is-active {
  border-color: #f7c948;
  background: rgba(247, 201, 72, 0.16);
  color: #ffd76a;
}

.important-icon {
  font-size: 0.84rem;
}

.recheck-button i {
  font-size: 0.85rem;
}

.recheck-button:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.drag-handle {
  display: inline-flex;
  min-height: 32px;
  min-width: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed var(--border);
  padding: 0 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  cursor: grab;
}

.drag-handle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-strong);
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle-icon {
  font-size: 0.84rem;
}

.collapse-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  border: 1px solid var(--border);
  padding: 0 8px;
  background: var(--surface);
  color: var(--muted);
}

.collapse-button:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
  color: var(--primary);
}

.collapse-icon {
  font-size: 0.8rem;
  transition: transform 0.16s ease;
}

.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.section-heading {
  color: var(--text);
}

.section-heading i {
  color: var(--primary);
  font-size: 0.92rem;
}

.checking-dots span {
  opacity: 0;
  animation: dotPulse 1.2s infinite;
}

.checking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.checking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

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

.error-message {
  margin-top: 10px;
  border: 1px solid rgba(255, 107, 107, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--error-bg);
  color: var(--error-text);
  font-weight: 700;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(173, 186, 200, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.results {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.result-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.result-heading time {
  color: var(--muted);
  font-size: 0.92rem;
}

.section-card {
  padding: 12px;
  overflow: hidden;
}

.section-card.is-important {
  border-color: rgba(247, 201, 72, 0.7);
  background:
    linear-gradient(180deg, rgba(247, 201, 72, 0.08), rgba(247, 201, 72, 0.02)),
    var(--panel);
  box-shadow:
    0 0 0 1px rgba(247, 201, 72, 0.14),
    0 18px 45px rgba(0, 0, 0, 0.28);
}

.section-card.is-important .section-heading,
.section-card.is-important .section-title-row h3 {
  color: #fff3c4;
}

.section-card.is-important .section-heading i {
  color: #ffd76a;
}

.section-body {
  display: block;
}

.collapsible-section.collapsed {
  padding-bottom: 12px;
}

.collapsible-section.collapsed > .section-title-row {
  margin-bottom: 0;
}

.collapsible-section.collapsed > .section-body {
  display: none;
}

.compact-card {
  margin-top: 8px;
}

.sortable-section {
  transition: box-shadow 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.sortable-section.is-dragging {
  opacity: 0.55;
  box-shadow: 0 12px 28px rgba(59, 224, 95, 0.18);
}

.sortable-section.drag-target-before {
  border-top: 3px solid var(--primary);
}

.sortable-section.drag-target-after {
  border-bottom: 3px solid var(--primary);
}

.summary-grid,
.ip-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ip-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
  display: flex;
  min-height: 56px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface);
}

.summary-card span:first-child {
  color: var(--muted);
  font-weight: 750;
  font-size: 0.8rem;
}

.summary-card strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  text-transform: capitalize;
  white-space: normal;
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.badge-gray {
  background: var(--gray-bg);
  color: var(--gray-text);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

td {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.detail-grid,
.mail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ip-detail-list {
  display: grid;
  gap: 10px;
}

.ip-detail-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.ip-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ip-detail-heading h3 {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.detail-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface);
}

.detail-item dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-item dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: 6px;
}

.ping-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.ping-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 8px;
  background: var(--surface);
}

.ping-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ping-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
}

.ping-window {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.ping-line {
  border-radius: 6px;
  padding: 5px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.ping-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.ping-fail {
  background: var(--error-bg);
  color: var(--error-text);
}

.ping-wait {
  background: var(--gray-bg);
  color: var(--gray-text);
}

.redirect-list {
  display: grid;
  gap: 6px;
}

.redirect-hop {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface);
}

.redirect-index {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--gray-bg);
  color: var(--gray-text);
  font-size: 0.72rem;
  font-weight: 900;
}

.redirect-body {
  min-width: 0;
}

.redirect-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.redirect-row span:not(.badge),
.redirect-row strong {
  color: var(--muted);
  font-size: 0.84rem;
}

.redirect-url,
.redirect-next,
.redirect-error-text {
  overflow-wrap: anywhere;
}

.redirect-url {
  font-weight: 800;
}

.redirect-next {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.redirect-error,
.redirect-error-text {
  color: var(--error-text);
}

.section-title-row h3,
.section-title-row p {
  margin-bottom: 0;
}

.section-title-row p,
.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.site-footer {
  padding: 14px 0 6px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  opacity: 0.62;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dotPulse {
  0%,
  20% {
    opacity: 0;
  }

  35%,
  100% {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding: 26px 0;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .collapse-button,
  .recheck-button,
  .drag-handle {
    width: auto;
  }

  .download-extension-button {
    width: 100%;
    gap: 8px;
  }

  .download-extension-button__label {
    max-width: 112px;
    opacity: 1;
  }

  .section-actions {
    width: auto;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .share-box-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .browser-grid,
  .ip-card-grid,
  .ping-stats,
  .detail-grid,
  .mail-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .ping-window {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-heading,
  .section-title-row,
  .ip-detail-heading,
  .browser-card__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .secondary-link-button,
  .primary-link-button,
  .browser-action {
    width: 100%;
  }
}
