:root{
  --primary:#25539d;
  --secondary:#2C2C2C;
  --bg:#FFFFFF;
  --success:#10B981;
  --error:#EF4444;
  --text:#1F2937;
  --muted:#6B7280;
  --border:#E5E7EB;
  --card:#FFFFFF;
  --shadow: 0 10px 30px rgba(31,41,55,0.08);
  --radius:16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:"DM Sans","Poppins",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.container{
  width:100%;
  max-width:860px;
  margin:0 auto;
  padding:24px 16px;
}

.topbar{
  border-bottom:1px solid var(--border);
  background:#fff;
}

.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{ width:34px; height:34px; border-radius:10px; background:var(--primary); }
.brand-title{ font-weight:700; letter-spacing:-0.2px; }
.brand-subtitle{ font-size:14px; color:var(--muted); margin-top:2px; }

.hero{ padding:24px 0 8px; text-align:center; }
.hero-title{ font-size:34px; letter-spacing:-0.6px; margin:0; }
.hero-desc{ margin:10px 0 0; color:var(--muted); }

.search-card{
  margin:24px auto 0;
  padding:16px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--card);
  box-shadow:var(--shadow);
  text-align:left;
}

.label{ display:block; font-size:14px; font-weight:600; margin-bottom:8px; }

.search-row{ display:flex; gap:12px; align-items:center; }

.input{
  flex:1;
  height:48px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  outline:none;
  font-size:16px;
  background:#fff;
  color:var(--text);
}

.input:focus{
  border-color:rgba(37,83,157,0.55);
  box-shadow:0 0 0 4px rgba(37,83,157,0.12);
}

.btn{
  height:48px;
  padding:0 16px;
  border-radius:14px;
  border:1px solid var(--border);
  cursor:pointer;
  font-weight:700;
  font-size:15px;
}

.btn-primary{
  background:var(--primary);
  color:#fff;
  border-color:rgba(37,83,157,0.85);
}

.btn-primary:disabled{ opacity:0.55; cursor:not-allowed; }
.btn-ghost{ background:#fff; color:var(--secondary); }

.status-row{ margin-top:12px; min-height:20px; }
.status{ font-size:14px; color:var(--muted); }
.status.success{ color:var(--success); }
.status.error{ color:var(--error); }

.card{
  margin-top:16px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--card);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.card.subtle{ box-shadow:none; }

.card-head{
  padding:16px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
}

.card-title{ margin:0; font-size:18px; }
.card-subtitle{ margin:6px 0 0; font-size:14px; color:var(--muted); word-break:break-all; }
.card-body{ padding:16px; }

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:16px;
}

@media (max-width: 720px){
  .search-row{ flex-direction:column; }
  .btn{ width:100%; }
  .grid{ grid-template-columns:1fr; }
  .card-head{ flex-direction:column; align-items:stretch; }
}

.metric{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:#fff;
}
.metric-label{ font-size:12px; color:var(--muted); font-weight:600; }
.metric-value{ margin-top:6px; font-size:16px; font-weight:700; color:var(--secondary); }

.divider{ height:1px; background:var(--border); margin:16px 0; }

.section-title{ margin:0; font-size:14px; font-weight:800; color:var(--secondary); }
.section-head{ margin-bottom:10px; }
.section-head.split{ display:flex; align-items:center; justify-content:space-between; gap:12px; }

.evidence{ display:flex; flex-direction:column; gap:10px; }
.evidence-item{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:#fff;
}
.evidence-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }

.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  font-weight:700;
  color:var(--secondary);
  background:#fff;
}

.pill.success{
  border-color: rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.08);
  color: #0f766e;
}

.pill.error{
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
  color: #991b1b;
}

.evidence-code{
  margin-top:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size:12px;
  color:#111827;
  background:#F9FAFB;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  overflow:auto;
}

.pre{
  margin:0;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#F9FAFB;
  overflow:auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size:12px;
  color:#111827;
}

.muted{ color:var(--muted); font-size:14px; }

.notice{
  border-radius:14px;
  padding:12px 14px;
  font-weight:700;
  font-size:14px;
  margin-bottom:16px;
}
.notice-error{
  border:1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
  color:#991b1b;
}

/* Level scale */
.scale-wrap{
  min-width: 220px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
.scale-label{ font-size:12px; font-weight:800; color:var(--secondary); }
.scale{ display:flex; gap:8px; align-items:center; }

.square{
  width:16px;
  height:16px;
  border-radius:4px;
  border:1px solid #D1D5DB;
  background:#fff;
}
.square.on{
  border-color: rgba(16,185,129,0.55);
  background: rgba(16,185,129,0.22);
}
.square.fail{
  border-color: rgba(239,68,68,0.55);
  background: rgba(239,68,68,0.18);
}

/* Always-visible 2-col section */
.always-section{ padding:0; }
.twocol{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:16px;
  padding:16px;
}
@media (max-width: 720px){
  .twocol{ grid-template-columns: 1fr; }
}

.col{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:#fff;
}

.col-title{
  font-weight:800;
  color:var(--secondary);
  margin-bottom:8px;
  font-size:14px;
}

.linklist{ margin:0; padding-left:18px; }
.linklist li{ margin:8px 0; }

a{
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}
a:hover{ text-decoration: underline; }

/* Footer with logo */
.footer{
  padding:16px 0 40px;
  text-align:center;
}
.footer-inner{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}
.footer-logo{
  height:28px;
  width:auto;
  display:block;
}
.footer-text{
  color:var(--muted);
  font-size:14px;
  font-weight:700;
}

/*Turnstile widget row */
.turnstile-row{
  margin-top: 12px;
  display:flex;
  justify-content:flex-start;
}

/*Github ribbon*/
.github-ribbon{
  position: fixed;
  top: 20px;
  right: -60px;
  width: 220px;
  text-align: center;
  background: #25539d;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 0;
  transform: rotate(45deg);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  z-index: 9999;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.github-ribbon:hover{
  background: #1d4280;
}
