:root {
  --orange: #ff4f00;
  --blue: #005baa;
  --green: #078442;
  --ink: #17212b;
  --line: #dce5ec;
}

* { box-sizing: border-box; }

.nc-body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f5f8fb;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.nc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.nc-brand {
  color: var(--blue);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.nc-top-home {
  color: #5e7282;
  font-size: 13px;
  text-decoration: none;
}

.nc-top-home:hover { color: var(--blue); }

.nc-wrap {
  width: min(980px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.network-test {
  margin-bottom: 40px;
  padding: 34px;
  border: 1px solid #c9e0f4;
  border-radius: 20px;
  background: linear-gradient(145deg, #edf6ff, #fff);
}

.kicker {
  margin: 0 0 8px;
  color: var(--orange);
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.test-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}

.test-head h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  line-height: 1.2;
}

.test-head p {
  margin: 0;
  color: #5e7282;
  font-size: 14px;
  line-height: 1.55;
}

.test-btn {
  min-height: 50px;
  padding: 0 21px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 11px;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 91, 170, 0.2);
  white-space: nowrap;
}

.test-btn:hover { background: #074f8f; }
.test-btn:disabled { cursor: wait; opacity: 0.65; }

.test-note {
  display: flex;
  gap: 10px;
  margin: 20px 0 0;
  padding: 13px 15px;
  color: #536675;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #dbeaf6;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.55;
}

.test-explainer {
  margin-top: 16px;
  padding: 21px 22px;
  color: #62402f;
  background: #fff7ed;
  border: 2px solid #ffb083;
  border-radius: 15px;
}

.test-explainer__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #87340d;
  font-size: 18px;
  font-weight: 700;
}

.test-explainer__badge {
  display: inline-block;
  padding: 4px 9px;
  color: #fff;
  background: var(--orange);
  border-radius: 999px;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
}

.test-explainer p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
}

.test-explainer p:last-child { margin-bottom: 0; }

.test-explainer ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px 24px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.test-explainer li {
  position: relative;
  padding-left: 17px;
  font-size: 12px;
  line-height: 1.5;
}

.test-explainer li:before {
  content: "•";
  position: absolute;
  left: 2px;
  color: var(--orange);
  font-weight: 700;
}

.test-explainer strong { color: #6f3014; }

.test-endpoints {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.test-endpoint {
  padding: 10px 11px;
  background: #fff;
  border: 1px solid #f0d6c5;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.45;
}

.test-endpoint b {
  display: block;
  color: #713a22;
  font-size: 12px;
  margin-bottom: 2px;
}

.test-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
}

.test-color {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #ead8cc;
  border-radius: 9px;
  color: #5f4c42;
  font-size: 11px;
}

.test-color i,
.scenario-lights i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.light-green { background: var(--green); }
.light-orange { background: #f29b00; }
.light-red { background: #db3b27; }

.test-scenarios-title {
  margin: 18px 0 8px;
  color: #713a22;
  font-size: 13px;
  font-weight: 700;
}

.test-scenarios {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.test-scenario {
  padding: 12px;
  background: #fff;
  border: 1px solid #ead8cc;
  border-radius: 10px;
}

.scenario-lights {
  display: flex;
  gap: 5px;
  margin-bottom: 7px;
}

.test-scenario b {
  display: block;
  color: #603421;
  font-size: 12px;
}

.test-scenario span {
  display: block;
  margin-top: 4px;
  color: #756157;
  font-size: 11px;
  line-height: 1.48;
}

.test-status {
  margin-top: 20px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.test-item {
  padding: 17px;
  background: #fff;
  border: 1px solid #dce7ef;
  border-radius: 13px;
}

.test-item__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: #b8c3cb;
  border-radius: 50%;
}

.test-item strong {
  color: var(--ink);
  font-size: 13px;
}

.test-value {
  display: block;
  margin-top: 8px;
  color: #7a8995;
  font-size: 12px;
}

.test-item[data-state="checking"] .test-dot {
  background: #f2a000;
  animation: testPulse 1s infinite;
}

.test-item[data-state="ok"] { border-color: #bfe4cf; }
.test-item[data-state="ok"] .test-dot { background: var(--green); }
.test-item[data-state="slow"] { border-color: #ffd099; }
.test-item[data-state="slow"] .test-dot { background: #f29b00; }
.test-item[data-state="fail"] { border-color: #ffc9c2; }
.test-item[data-state="fail"] .test-dot { background: #db3b27; }

@keyframes testPulse {
  50% { opacity: 0.35; }
}

.test-conclusion {
  margin-top: 15px;
  padding: 18px 19px;
  border-radius: 13px;
}

.test-conclusion strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.test-conclusion p {
  margin: 0;
  font-size: 13px;
  line-height: 1.58;
}

.test-conclusion--good {
  color: #24583b;
  background: #effaf4;
  border: 1px solid #c5e9d5;
}

.test-conclusion--warn {
  color: #76502f;
  background: #fff7e9;
  border: 1px solid #f5d5a5;
}

.test-conclusion--danger {
  color: #743a32;
  background: #fff1ef;
  border: 1px solid #f4c8c2;
}

.test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.network-test [hidden] {
  display: none !important;
}

.test-copy {
  padding: 9px 13px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #bcd7ed;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.test-copy:hover { background: #f3f8fc; }
.test-copy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* WP-сторінка зі shortcode: тема/Elementor не повинні перебивати кнопку */
.page-id-26971 .test-copy:hover,
.page-id-26971 .test-copy:focus {
  color: var(--blue) !important;
  background: #f3f8fc !important;
  border: 1px solid #bcd7ed !important;
}

.test-history {
  margin-top: 14px;
  padding: 13px 15px;
  color: #586b79;
  background: #fff;
  border: 1px solid #dce7ef;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.55;
}

.test-history b { color: var(--ink); }

.test-support {
  margin: 14px 0 0;
  color: #586b79;
  font-size: 12px;
  line-height: 1.55;
}

.test-support a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.test-privacy {
  margin: 13px 0 0;
  color: #7a8995;
  font-size: 11px;
  line-height: 1.5;
}

.nc-embed {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.nc-embed .network-test {
  margin-bottom: 0;
}

.nc-embed .network-test h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.2;
}

@media (max-width: 680px) {
  .nc-wrap { width: calc(100% - 28px); }
  .network-test { padding: 23px 19px; }
  .test-head { grid-template-columns: 1fr; }
  .test-btn { width: 100%; white-space: normal; }
  .test-explainer ul,
  .test-endpoints,
  .test-scenarios,
  .test-grid {
    grid-template-columns: 1fr;
  }
}
