:root {
  color-scheme: dark;
  --bg: #07111f;
  --surface: rgba(13, 27, 45, .82);
  --surface-strong: #10243b;
  --line: rgba(148, 173, 205, .18);
  --line-strong: rgba(102, 224, 255, .38);
  --text: #edf7ff;
  --muted: #94aac2;
  --cyan: #55dff6;
  --cyan-strong: #21c8e6;
  --green: #72e6ad;
  --warning: #ffc978;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(7, 17, 31, .92), rgba(7, 17, 31, .98)),
    radial-gradient(circle at 20% 0%, #163451, transparent 44%);
  color: var(--text);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .11;
  pointer-events: none;
}

.ambient-one { top: -280px; right: -120px; background: #2ee2ff; }
.ambient-two { bottom: -350px; left: -220px; background: #2c6fff; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.12; }
.brand strong { letter-spacing: -.02em; font-size: 17px; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.brand-mark {
  width: 39px;
  height: 39px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(69, 218, 244, .08);
  box-shadow: inset 0 0 18px rgba(69, 218, 244, .07);
}

.brand-mark span { width: 3px; border-radius: 3px; background: var(--cyan); }
.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; }

.service-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 13px rgba(114, 230, 173, .7);
}

.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 76px 0 70px; }

.hero { max-width: 870px; margin-bottom: 46px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow span { width: 24px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.eyebrow.active { color: var(--green); }
.eyebrow.active span { background: var(--green); box-shadow: 0 0 8px var(--green); }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 20px; font-size: clamp(38px, 5.5vw, 66px); line-height: 1.03; letter-spacing: -.052em; }
h1 em { color: var(--cyan); font-style: normal; font-weight: 520; }
.hero > p, .result-header > div > p { max-width: 700px; margin: 0; color: var(--muted); font-size: 17px; }
h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
h3 { margin-bottom: 7px; font-size: 17px; }

.layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .72fr); gap: 24px; align-items: start; }
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(17, 36, 58, .88), rgba(10, 24, 41, .88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
}
.test-form { padding: 30px; }

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.form-error {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 137, 137, .32);
  border-radius: 11px;
  color: #ffd7d7;
  background: rgba(142, 45, 56, .18);
}

.form-error span {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #07111f;
  background: #ff9d9d;
  font-weight: 850;
}

.form-error p { margin: 0; font-size: 12px; }
.turnstile-wrap { min-height: 65px; margin-top: 27px; display: flex; justify-content: center; }
.turnstile-wrap + .primary-button { margin-top: 18px; }

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.panel-heading > div, .section-title { display: flex; align-items: center; gap: 12px; }
.helper, .section-title p { margin: 0; color: var(--muted); font-size: 12px; }

.step-number, .info-label {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(85, 223, 246, .28);
  border-radius: 6px;
  background: rgba(85, 223, 246, .06);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card { position: relative; cursor: pointer; }
.mode-card:last-child { grid-column: 1 / -1; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-content {
  min-height: 145px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(6, 17, 31, .45);
  transition: border-color .2s, background .2s, transform .2s;
}
.mode-card:hover .mode-content { transform: translateY(-2px); border-color: rgba(85, 223, 246, .28); }
.mode-card input:checked + .mode-content {
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(39, 157, 183, .15), rgba(6, 17, 31, .52));
  box-shadow: inset 0 0 0 1px rgba(85, 223, 246, .08), 0 8px 28px rgba(0, 0, 0, .18);
}
.mode-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mode-top strong { font-size: 15px; }
.recommended, .lock-icon, .plain-icon {
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--cyan);
  background: rgba(85, 223, 246, .1);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.plain-icon { color: var(--warning); background: rgba(255, 201, 120, .1); }
.mode-description { margin-top: 12px; color: var(--muted); font-size: 12px; }
.mode-port { margin-top: auto; color: #b8c9d9; font-size: 11px; }
.mode-port b { color: var(--text); }

.form-section { margin-top: 30px; padding-top: 27px; border-top: 1px solid var(--line); }
.section-title { margin-bottom: 17px; }

.toggle-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 17, 31, .38);
  cursor: pointer;
}
.toggle-row > span:first-child { flex: 1; display: flex; flex-direction: column; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 30px;
  background: #2a4057;
  transition: .2s;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9e5ef;
  transition: .2s;
}
.toggle-row input:checked + .toggle { background: var(--cyan-strong); }
.toggle-row input:checked + .toggle::after { left: 23px; background: white; }

.duration-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.duration-group label { position: relative; }
.duration-group input { position: absolute; opacity: 0; }
.duration-group span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(6, 17, 31, .38);
  cursor: pointer;
}
.duration-group input:checked + span { border-color: var(--cyan); color: var(--text); background: rgba(85, 223, 246, .1); }

.primary-button, .secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.primary-button {
  margin-top: 27px;
  color: #04121a;
  background: linear-gradient(110deg, var(--cyan), #7ce5d3);
  box-shadow: 0 12px 35px rgba(42, 204, 231, .19);
}
.test-form > .primary-button { width: 100%; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.button-arrow { font-size: 20px; }
.secondary-button { border: 1px solid var(--line); color: var(--text); background: rgba(15, 31, 51, .78); }
.primary-button.compact { min-height: 43px; margin: 0; padding: 0 17px; }
.danger-button {
  min-height: 43px;
  padding: 0 16px;
  border: 1px solid rgba(255, 137, 137, .3);
  border-radius: 10px;
  color: #ffc7c7;
  background: rgba(142, 45, 56, .14);
  font-weight: 750;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.danger-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 137, 137, .55);
  background: rgba(142, 45, 56, .25);
}
.form-note { margin: 11px 0 0; text-align: center; color: var(--muted); font-size: 10px; }

.info-column { display: grid; gap: 15px; }
.info-card { padding: 25px; }
.flow-list { margin: 24px 0 0; padding: 0; list-style: none; }
.flow-list li { position: relative; display: flex; gap: 13px; padding-bottom: 25px; }
.flow-list li:not(:last-child)::after { content: ""; position: absolute; top: 28px; bottom: 6px; left: 13px; border-left: 1px dashed rgba(85, 223, 246, .25); }
.flow-list li > span {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(85, 223, 246, .32);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 10px;
}
.flow-list strong { font-size: 13px; }
.flow-list p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.privacy-card { display: flex; gap: 14px; padding: 20px; border: 1px solid rgba(114, 230, 173, .16); border-radius: 15px; background: rgba(23, 73, 67, .19); }
.privacy-icon { color: var(--green); font-size: 23px; }
.privacy-card strong { font-size: 12px; color: #bff6db; }
.privacy-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.home-notice { margin-top: -20px; margin-bottom: 28px; }

.active-tests-panel { margin-bottom: 24px; padding: 25px; }
.active-tests-panel .panel-heading { margin-bottom: 15px; }
.active-tests-list { display: grid; gap: 9px; }
.active-test-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(6, 17, 31, .38);
  transition: border-color .2s, background .2s, transform .2s;
}
.active-test-row:hover {
  transform: translateY(-1px);
  border-color: rgba(85, 223, 246, .32);
  background: rgba(85, 223, 246, .06);
}
.active-test-main { min-width: 0; display: flex; flex-direction: column; }
.active-test-main strong {
  overflow: hidden;
  color: #d8f7ff;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-test-main small, .active-test-time small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.active-test-time { display: flex; flex-direction: column; text-align: right; }
.active-test-time strong { margin-top: 3px; color: var(--cyan); font: 700 12px ui-monospace, monospace; }
.active-test-arrow { color: var(--cyan); font-size: 19px; }

.capacity-page {
  width: min(680px, 100%);
  margin: 4vh auto 0;
  padding: clamp(30px, 6vw, 58px);
  text-align: center;
}

.capacity-page .eyebrow { justify-content: center; }
.capacity-page h1 { margin-bottom: 18px; font-size: clamp(40px, 7vw, 62px); }
.capacity-page > p { max-width: 510px; margin: 0 auto; color: var(--muted); font-size: 16px; }

.capacity-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  padding: 17px;
  border: 1px solid rgba(255, 201, 120, .3);
  border-radius: 18px;
  background: rgba(255, 201, 120, .08);
}

.capacity-icon span {
  width: 5px;
  border-radius: 5px;
  background: var(--warning);
  animation: capacity-bars 1.2s ease-in-out infinite alternate;
}

.capacity-icon span:nth-child(1) { height: 13px; }
.capacity-icon span:nth-child(2) { height: 28px; animation-delay: .2s; }
.capacity-icon span:nth-child(3) { height: 20px; animation-delay: .4s; }

@keyframes capacity-bars {
  to { height: 8px; opacity: .45; }
}

.capacity-wait {
  width: min(340px, 100%);
  margin: 28px auto 18px;
  padding: 14px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(6, 17, 31, .38);
}

.capacity-wait span { color: var(--muted); font-size: 11px; }
.capacity-wait strong { color: var(--warning); font: 700 15px ui-monospace, monospace; }
.capacity-page .primary-button { margin-top: 0; }
.primary-button.disabled { opacity: .45; pointer-events: none; }

.result-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 35px; }
.result-header h1 { margin-bottom: 12px; font-size: clamp(34px, 4.5vw, 54px); }
.result-tools { display: grid; gap: 10px; flex: 0 0 auto; }
.result-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.result-actions form { display: flex; margin: 0; }
.countdown-card {
  min-width: 275px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(85, 223, 246, .25);
  border-radius: 11px;
  background: rgba(85, 223, 246, .07);
}
.countdown-card span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.countdown-card strong {
  color: var(--cyan);
  font: 700 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  text-shadow: 0 0 18px rgba(85, 223, 246, .3);
}
.countdown-card.expired {
  border-color: rgba(255, 201, 120, .3);
  background: rgba(255, 201, 120, .08);
}
.countdown-card.expired strong { color: var(--warning); font-size: 13px; text-shadow: none; }

.notice { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; padding: 15px 18px; border-radius: 12px; }
.success-notice { border: 1px solid rgba(114, 230, 173, .24); background: rgba(37, 108, 82, .18); }
.notice-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: rgba(114, 230, 173, .14); color: var(--green); }
.notice strong { color: #bff6db; }
.notice p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.result-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(230px, .72fr); gap: 18px; align-items: start; }
.connection-panel, .summary-card, .messages-panel { padding: 27px; }
.mode-badge, .message-count, .table-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(85, 223, 246, .09);
  border: 1px solid rgba(85, 223, 246, .18);
  font-size: 10px;
  font-weight: 750;
}
.credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.credential {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 17, 31, .38);
}
.credential.wide { grid-column: 1 / -1; }
.credential > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.credential > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.credential code { overflow: hidden; color: #d8f7ff; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.credential code.muted { color: var(--muted); }
.credential button {
  flex: 0 0 auto;
  border: 0;
  color: var(--cyan);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.credential button.copied { color: var(--green); }
.expiry { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.expiry-icon { color: var(--warning); }

.summary-card dl { margin: 20px 0 0; }
.summary-card dl > div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.summary-card dl > div:last-child { border-bottom: 0; }
.summary-card dt { color: var(--muted); font-size: 10px; }
.summary-card dd { margin: 4px 0 0; font-size: 12px; font-weight: 700; }

.messages-panel { margin-top: 18px; }
.messages-panel .panel-heading { margin-bottom: 15px; }
.inbox-status { display: flex; align-items: center; gap: 8px; }
.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.auto-refresh i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(114, 230, 173, .65);
  animation: poll-pulse 1.8s ease-in-out infinite;
}
.auto-refresh.degraded i { background: var(--warning); box-shadow: none; }
.auto-refresh.stopped i { background: var(--muted); box-shadow: none; animation: none; }
@keyframes poll-pulse { 50% { opacity: .35; transform: scale(.72); } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 13px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 15px 13px; border-top: 1px solid var(--line); color: #cbd9e7; font-size: 12px; }
td code { color: #d8f7ff; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.new-message { animation: message-arrived 2.2s ease-out; }
@keyframes message-arrived {
  0% { background: rgba(85, 223, 246, .18); }
  100% { background: transparent; }
}
.table-badge { min-height: 23px; color: #bff6db; background: rgba(114, 230, 173, .07); border-color: rgba(114, 230, 173, .15); }

.empty-state { padding: 47px 20px 38px; text-align: center; border-top: 1px solid var(--line); }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.signal-animation { height: 36px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; margin-bottom: 16px; }
.signal-animation i { width: 4px; border-radius: 4px; background: var(--cyan); animation: signal 1.2s ease-in-out infinite; }
.signal-animation i:nth-child(1) { height: 12px; }
.signal-animation i:nth-child(2) { height: 27px; animation-delay: .12s; }
.signal-animation i:nth-child(3) { height: 19px; animation-delay: .24s; }
@keyframes signal { 0%, 100% { opacity: .35; transform: scaleY(.72); } 50% { opacity: 1; transform: scaleY(1); } }

.footer {
  width: min(1180px, calc(100% - 40px));
  min-height: 85px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.footer p { margin: 0; }

@media (max-width: 850px) {
  .page { padding-top: 50px; }
  .layout, .result-layout { grid-template-columns: 1fr; }
  .result-header { align-items: flex-start; flex-direction: column; }
  .result-tools { width: 100%; }
  .countdown-card { min-width: 0; width: 100%; }
  .result-actions { width: 100%; }
  .result-actions a { flex: 1; }
  .summary-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
}

@media (max-width: 580px) {
  .topbar, .page, .footer { width: min(100% - 24px, 1180px); }
  .service-status { font-size: 0; }
  .page { padding-top: 38px; }
  h1 { font-size: 36px; }
  .hero { margin-bottom: 30px; }
  .hero > p { font-size: 15px; }
  .test-form, .connection-panel, .summary-card, .messages-panel { padding: 20px; }
  .panel-heading { align-items: flex-start; }
  .messages-panel .panel-heading { flex-direction: column; }
  .inbox-status { width: 100%; justify-content: space-between; }
  .helper { display: none; }
  .mode-grid, .credential-grid { grid-template-columns: 1fr; }
  .mode-card:last-child, .credential.wide { grid-column: auto; }
  .duration-group { gap: 6px; }
  .result-actions { flex-direction: column; }
  .result-actions a, .result-actions form, .result-actions button { width: 100%; }
  .active-test-row { grid-template-columns: minmax(0, 1fr) auto; gap: 13px; }
  .active-test-time { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .active-test-arrow { grid-column: 2; grid-row: 1; }
  .footer { padding: 25px 0; align-items: flex-start; flex-direction: column; }
}
