.test-grid,
.grid{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:18px;
}
.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:clamp(16px,3.5vw,22px);
  box-shadow:0 12px 28px rgba(0,0,0,.06);
}

.card h2{
  color:var(--ink);
  font-weight:900;
  font-size:clamp(18px,3.8vw,24px);
  margin:0 0 8px;
}

.card h3{
  color:var(--ink);
  font-weight:900;
  font-size:clamp(16px,3.2vw,20px);
  margin:18px 0 8px;
}

.card h4{
  margin:0 0 6px;
  color:#0b1533;
  font-weight:1000;
  font-size:14px;
}

.card p{
  line-height:1.65;
}

.test-box,
.box{
  width:100%;
  max-width:560px;
  height:min(360px,60vw);
  margin:14px auto 10px;
  border-radius:18px;
  border:1px solid var(--line);
  display:grid;
  place-items:center;
  cursor:pointer;
  user-select:none;
  -webkit-user-select:none;
  transition:background-color .15s ease,color .15s ease,border-color .15s ease;
  box-shadow:0 16px 36px rgba(2,6,23,.08);
  -webkit-tap-highlight-color:transparent;
  position:relative;
}

.test-msg,
.msg{
  font-weight:900;
  letter-spacing:.2px;
  text-align:center;
  padding:0 14px;
  font-size:clamp(18px,4.4vw,30px);
}

.state-start{
  background:#1f4fb8;
  color:#eff6ff;
  border-color:#c7d6ff;
}

.state-wait{
  background:#ef4444;
  color:#fff;
  border-color:#fca5a5;
}

.state-green{
  background:#22c55e;
  color:#06210e;
  border-color:#86efac;
}

.state-false{
  background:#fed7aa;
  color:#7a3e00;
  border-color:#fdba74;
}

.state-result{
  background:#1f4fb8;
  color:#eff6ff;
  border-color:#c7d6ff;
}

.kicker{
  text-align:center;
  color:#64748b;
  margin:6px 0 0;
  font-size:14px;
}

.mini-stats{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  margin:10px 0 0;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid #e6eaf4;
  background:#fff;
  box-shadow:0 8px 18px rgba(2,6,23,.04);
  font-weight:900;
  color:#0b1533;
  font-size:12px;
}

.pill b{
  color:#1f3aa7;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin:12px 0 0;
}

.tools{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin:0 0 10px 0;
}

.clear-btn{
  padding:.5rem .8rem;
  border-radius:10px;
  border:1px solid #fca5a5;
  background:#fee2e2;
  color:#991b1b;
  font-weight:800;
  cursor:pointer;
}

.clear-btn:hover{
  background:#fecaca;
}

.sessions{
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
}

.hist-scroll{
  max-height:260px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.sessions table{
  width:100%;
  border-collapse:collapse;
}

.sessions thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f3f4f6;
  color:#111827;
  text-align:left;
  font-size:14px;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
}

.sessions tbody td{
  padding:10px 12px;
  border-bottom:1px dashed #e6e9f0;
  font-size:15px;
}

.sessions tbody tr:last-child td{
  border-bottom:0;
}

.sessions th,
.sessions td{
  border-left:1px solid #eceff4;
}

.sessions th:first-child,
.sessions td:first-child{
  border-left:0;
}

.charts{
  margin-top:12px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
}

.chart-title{
  margin:0 0 6px 0;
  font-size:14px;
  color:#6b7280;
}

.chart-box{
  width:100%;
  height:auto;
  display:block;
}

.axis-label{
  font-size:11px;
  fill:#6b7280;
}

.axis-line{
  stroke:#e5e7eb;
  stroke-width:1;
}

.line-rt{
  stroke:#2563eb;
  fill:none;
  stroke-width:2;
}

.grid-line{
  stroke:#e5e7eb;
  stroke-width:1;
  opacity:.7;
}

.world-box{
  margin-top:12px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}

.wtip{
  position:absolute;
  left:10px;
  top:10px;
  z-index:5;
  max-width:220px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid #e6eaf4;
  background:rgba(255,255,255,.96);
  box-shadow:0 18px 40px rgba(2,6,23,.12);
  font-weight:900;
  color:#0b1533;
  font-size:12px;
  line-height:1.35;
}

.wtip small{
  display:block;
  color:#64748b;
  font-weight:900;
  margin-top:4px;
}

.legend{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:8px;
  color:#64748b;
  font-weight:900;
  font-size:12px;
}

.leg-item{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.sw{
  width:12px;
  height:12px;
  border-radius:4px;
  background:#2563eb;
}

.sw2{
  width:12px;
  height:12px;
  border-radius:4px;
  background:#1f4fb8;
  opacity:.22;
  border:1px solid rgba(31,79,184,.35);
}

.sw3{
  width:12px;
  height:12px;
  border-radius:4px;
  background:#22c55e;
}

.callouts{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:12px 0;
}

.callout{
  border:1px solid #e6eaf4;
  border-radius:14px;
  background:linear-gradient(#fff,rgba(255,255,255,.75));
  box-shadow:0 10px 22px rgba(2,6,23,.05);
  padding:12px 14px;
}

.callout p{
  margin:0;
  color:#475569;
  line-height:1.6;
}

.callout a{
  color:#1f3aa7;
  font-weight:900;
  text-decoration:none;
}

.callout a:hover{
  text-decoration:underline;
}

.badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0 0;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid #e6eaf4;
  background:#fff;
  box-shadow:0 8px 18px rgba(2,6,23,.04);
  font-weight:1000;
  color:#0b1533;
  font-size:12px;
}

.badge small{
  color:#64748b;
  font-weight:900;
}

.table-wrap{
  overflow:auto;
  border:1px solid #e6eaf4;
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 18px rgba(2,6,23,.04);
  margin:10px 0;
}

.bench{
  width:100%;
  border-collapse:collapse;
  min-width:520px;
}

.bench th{
  position:sticky;
  top:0;
  background:#f3f4f6;
  text-align:left;
  padding:10px 12px;
  font-weight:1000;
  color:#0b1533;
  border-bottom:1px solid #e6eaf4;
}

.bench td{
  padding:10px 12px;
  border-bottom:1px dashed #e6e9f0;
  color:#334155;
  font-weight:800;
}

.bench tr:last-child td{
  border-bottom:0;
}

.faq details{
  border:1px solid #e6eaf4;
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 18px rgba(2,6,23,.04);
  margin:10px 0;
  overflow:hidden;
}

.faq summary{
  cursor:pointer;
  list-style:none;
  padding:12px 14px;
  font-weight:1000;
  color:#0b1533;
  display:flex;
  align-items:center;
  gap:10px;
}

.faq summary::-webkit-details-marker{
  display:none;
}

.faq summary::after{
  content:"+";
  margin-left:auto;
  font-weight:1000;
  color:#1f3aa7;
}

.faq details[open] summary::after{
  content:"–";
}

.faq .a{
  padding:0 14px 14px;
  color:#475569;
  line-height:1.65;
}

.faq .a p{
  margin:0;
}

.ad-card{
  padding:14px;
  border:1px dashed #e6ecf6;
  border-radius:14px;
  background:#fbfdff;
  margin:14px 0 0;
}

.ad-note{
  font-size:12px;
  color:#94a3b8;
  margin:0 0 8px;
  font-weight:900;
  letter-spacing:.2px;
}

.explainer ul{
  padding-left:18px;
  line-height:1.7;
}

.explainer li{
  margin:6px 0;
}

@media (max-width:900px){
  .test-grid,
  .grid{
    grid-template-columns:1fr;
  }

  .callouts{
    grid-template-columns:1fr;
  }
}

@media (max-width:640px){
  .test-grid,
  .grid{
    grid-template-columns:1fr;
    gap:14px;
  }

  .card{
    padding:14px 14px 16px;
    border-radius:14px;
    max-width:100%;
  }

  .test-box,
  .box{
    width:100%;
    height:min(420px,90vw);
  }

  .test-msg,
  .msg{
    font-size:clamp(22px,6vw,32px);
  }

  .kicker{
    font-size:13px;
  }

  .sessions{
    max-width:100%;
    overflow:hidden;
  }

  .hist-scroll{
    max-width:100%;
    overflow-x:auto;
  }

  .sessions table{
    min-width:520px;
  }

  .sessions thead th,
  .sessions tbody td{
    white-space:nowrap;
  }

  .charts,
  .ad-card{
    max-width:100%;
  }

  ins.adsbygoogle,
  iframe{
    max-width:100% !important;
  }
}

.wrap{
  max-width:min(1100px,94vw);
  margin:24px auto;
  padding:clamp(12px,3vw,20px);
}

@media (max-width:640px){
  .wrap{
    width:100%;
    max-width:100%;
    margin:18px auto 24px;
    padding-left:calc(12px + env(safe-area-inset-left));
    padding-right:calc(12px + env(safe-area-inset-right));
    padding-top:12px;
    padding-bottom:12px;
  }
}