/* Only what the WebSocket tester needs on top of tool_page.css: the connection
   bar, the mixed-content guard, the counters and the frame log. */
.wst {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
}

.wst [hidden] {
  display: none !important;
}

.wst-panel {
  padding: 20px;
  border-radius: 24px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 2, 18, 0.6);
}

.wst-connect {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wst-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.wst-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wst-field--grow {
  flex: 1 1 320px;
  min-width: 0;
}

.wst-field--buttons {
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.wst-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wst-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.92);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}

.wst-input--short {
  width: 200px;
}

.wst-input:focus {
  outline: none;
  border-color: #6e00ff;
}

.wst-textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.92);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  tab-size: 2;
}

.wst-textarea:focus {
  outline: none;
  border-color: #6e00ff;
}

.wst-guard {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1.6;
}

.wst-guard--error {
  border-color: rgba(255, 107, 129, 0.5);
  background: rgba(255, 107, 129, 0.1);
  color: #ffb3c0;
}

.wst-guard--ok {
  border-color: rgba(52, 199, 123, 0.35);
  background: rgba(52, 199, 123, 0.08);
  color: #9df0c2;
}

.wst-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 22px;
}

.wst-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

.wst-dot--connecting {
  background: #ffce6b;
}

.wst-dot--open {
  background: #6ee7a8;
}

.wst-dot--closing {
  background: #ffce6b;
}

.wst-dot--closed {
  background: #ff8ba0;
}

.wst-state {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.wst-status {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.5;
}

.wst-status--ok {
  color: #6ee7a8;
}

.wst-status--warn {
  color: #ffce6b;
}

.wst-status--error {
  color: #ff8ba0;
}

.wst-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.wst-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  cursor: pointer;
}

.wst-check input {
  width: 16px;
  height: 16px;
  accent-color: #6e00ff;
}

.wst-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.wst-metric {
  padding: 14px;
  border-radius: 18px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 2, 18, 0.6);
  text-align: center;
}

.wst-metric-value {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.wst-metric-label {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.wst-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wst-panel-title {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.wst-segment {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
}

.wst-segment-item {
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  cursor: pointer;
}

.wst-segment-item.is-active {
  background: #6e00ff;
  color: #fff;
}

.wst-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.wst-panel-head .wst-actions {
  margin-top: 0;
}

.wst-hint {
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.wst-log {
  max-height: 520px;
  overflow: auto;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px;
}

.wst-log-empty {
  margin: 0;
  padding: 24px 14px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  text-align: center;
}

.wst-entry {
  padding: 8px 10px;
  border-radius: 12px;
  border-inline-start: 3px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.wst-entry--sent {
  border-inline-start-color: #8ab4ff;
}

.wst-entry--received {
  border-inline-start-color: #6ee7a8;
}

.wst-entry--system {
  border-inline-start-color: rgba(255, 255, 255, 0.25);
}

.wst-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.wst-time {
  color: rgba(255, 255, 255, 0.4);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

.wst-dir {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
}

.wst-dir--sent {
  background: rgba(110, 150, 255, 0.22);
  color: #b9cdff;
}

.wst-dir--received {
  background: rgba(52, 199, 123, 0.22);
  color: #9df0c2;
}

.wst-tag {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.wst-tag--quiet {
  color: rgba(255, 255, 255, 0.4);
}

.wst-entry-body {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.wst-entry-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.55;
}

.wst-copy-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  min-height: 18px;
}

.wst-copy-status--error {
  color: #ff8ba0;
}

@media (max-width: 991px) {
  .wst-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wst-input--short {
    width: 100%;
  }

  .wst-field {
    flex: 1 1 240px;
  }
}

@media (max-width: 575px) {
  .wst-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wst-field--buttons {
    flex: 1 1 100%;
  }

  .wst-field--buttons .tp-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Lists inside the article sections.

   tool_page.css styles .tp-lead's paragraphs and never its lists, so a <ul>
   here would otherwise fall through to the global theme: a different grey, a
   taller line, markers set `inside` with no indent, and a bottom margin that
   stacks on top of the flex gap .tp-lead already provides. */

.tp-lead ul {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-lead ul li {
  list-style: disc outside;
  color: rgba(13, 0, 31, 0.66);
  font-size: 16px;
  line-height: 26px;
}

.tp-lead ul li::marker {
  color: rgba(13, 0, 31, 0.35);
}
