:root{
  --bg:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --soft:#f9fafb;
  --danger:#b91c1c;
  --warn:#b45309;
  --ok:#047857;
  --pro:#4f46e5;
  --shadow:0 1px 8px rgba(0,0,0,.06);
  --radius:14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:var(--sans)}
a{color:inherit}
button,select,textarea{font-family:inherit}

.nw-header{
  padding:16px 12px 10px;
  border-bottom:1px solid var(--line);
  background:#fff;
}
.nw-header-inner{max-width:960px;margin:0 auto}
.nw-title{margin:0;font-size:18px;line-height:1.25}
.nw-sub{margin:8px 0 0;color:var(--muted);font-size:13px;line-height:1.6}

.nw-main{max-width:960px;margin:0 auto;padding:12px}
.ad-slot{
  margin:12px 0 16px;
  padding:8px;
  border:1px dashed #d4d4d4;
  font-size:11px;
  color:#9ca3af;
  text-align:center;
  min-height:60px;
}
.ad-top{margin-top:4px}
.ad-bottom{margin-bottom:8px}

.nw-lang-switch{
  text-align:center;
  margin:6px 0 0;
  font-size:11px;
  color:var(--muted);
}
.nw-lang-switch button{
  border:none;background:transparent;padding:0 2px;cursor:pointer;
  font-size:11px;color:#4b5563;
}
.nw-lang-switch button.active{font-weight:600;text-decoration:underline}

.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:12px;
  margin:12px 0;
}

.row{display:flex;gap:12px;align-items:flex-start}
.row-wrap{flex-wrap:wrap}
.field{min-width:180px}
.field.grow{flex:1;min-width:240px}

.label{display:block;font-size:12px;color:var(--muted);margin:0 0 6px}
.select{
  width:100%;
  padding:10px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.textarea{
  width:100%;
  padding:10px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  font-family:var(--mono);
  font-size:12px;
  line-height:1.6;
  resize:vertical;
}
.hint{margin:8px 0 0;color:var(--muted);font-size:12px}

.actions{
  display:flex;
  gap:10px;
  margin-top:12px;
}
.btn{
  appearance:none;
  border:1px solid #d1d5db;
  background:#fff;
  color:#111827;
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
  font-size:13px;
  transition:all .15s ease;
}
.btn:hover{background:var(--soft)}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn-primary{
  border-color:#111827;
  background:#111827;
  color:#fff;
}
.btn-primary:hover{filter:brightness(1.05)}
.btn-danger{
  border-color:var(--danger);
  background:var(--danger);
  color:#fff;
}
.btn-danger:hover{filter:brightness(1.05)}

.progress-wrap{
  margin-top:12px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--soft);
}
.progress-bar{
  height:10px;border-radius:999px;
  background:linear-gradient(90deg,#111827 0%, #e5e7eb 50%, #111827 100%);
  background-size:200% 100%;
  animation:move 1.1s linear infinite;
}
@keyframes move{0%{background-position:0 0}100%{background-position:200% 0}}
.progress-text{margin:8px 0 0;color:var(--muted);font-size:12px}

.result-head{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap}
.risk{display:flex;gap:8px;align-items:center}
.risk-label{font-size:12px;color:var(--muted)}
.badge{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--line);
  font-size:12px;
  background:#fff;
}
.badge.low{border-color:rgba(4,120,87,.25); background:rgba(4,120,87,.08); color:var(--ok)}
.badge.medium{border-color:rgba(180,83,9,.25); background:rgba(180,83,9,.10); color:var(--warn)}
.badge.high{border-color:rgba(185,28,28,.25); background:rgba(185,28,28,.10); color:var(--danger)}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{
  font-size:12px;color:var(--muted);
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
}

.divider{height:1px;background:var(--line);margin:12px 0}

.h2{margin:0 0 10px;font-size:14px}
.findings{display:flex;flex-direction:column;gap:8px}
.finding{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  background:#fff;
}
.finding-top{
  display:flex;gap:8px;align-items:center;flex-wrap:wrap;
  margin-bottom:6px;
}
.tag{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--soft);
}
.tag.high{border-color:rgba(185,28,28,.25);background:rgba(185,28,28,.08);color:var(--danger)}
.tag.medium{border-color:rgba(180,83,9,.25);background:rgba(180,83,9,.10);color:var(--warn)}
.tag.low{border-color:rgba(4,120,87,.25);background:rgba(4,120,87,.08);color:var(--ok)}
.code-line{
  font-family:var(--mono);
  font-size:12px;
  color:#111827;
  white-space:pre-wrap;
  word-break:break-word;
}
.meta{font-size:12px;color:var(--muted)}

.ul{margin:0;padding-left:18px;color:#111827}
.ul li{margin:6px 0;color:#111827}
.result-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}

.pro-block{
  margin-top:16px;
  border:1px solid rgba(79,70,229,.25);
  background:rgba(79,70,229,.06);
  border-radius:14px;
  padding:12px;
}
.pro-head{
  display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;
}
.badge-pro{
  border-color:rgba(79,70,229,.30);
  background:rgba(79,70,229,.10);
  color:var(--pro);
  font-weight:700;
}
.pro-title{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.pro-note{margin:8px 0 0;color:var(--muted);font-size:12px}

.nw-donate{
  text-align:center;
  margin:16px 0 8px;
  padding:8px 0;
  font-size:12px;
  color:var(--muted);
}
.nw-donate-text{margin:4px 0;font-size:12px}
.nw-donate-links{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:4px;
}
.nw-donate-links a{
  display:inline-block;
  padding:8px 14px;
  border:1px solid #d1d5db;
  border-radius:8px;
  background:#ffffff;
  font-size:13px;
  color:#111827;
  text-decoration:none;
  transition:all .2s ease;
}
.nw-donate-links a:hover{
  background:#f9fafb;
  transform:translateY(-1px);
  box-shadow:0 1px 3px rgba(0,0,0,.1);
}

.usage-link{margin:12px 0 0;text-align:center}
.usage-link a{font-size:14px;color:#374151;text-decoration:underline}

.nw-links{
  margin:16px 0 0;
  text-align:center;
  font-size:12px;
  color:var(--muted);
}
.nw-links a{color:var(--muted);text-decoration:underline}

.nw-footer{
  margin-top:24px;
  padding:16px 8px 12px;
  border-top:1px solid var(--line);
  font-size:11px;
  color:var(--muted);
  text-align:center;
  line-height:1.6;
}
.nw-footer-line{margin:2px 0}
.nw-footer a{color:var(--muted);text-decoration:underline}

/* Responsive: <=480px must stack buttons */
@media (max-width: 480px){
  .nw-main{padding:10px}
  .nw-title{font-size:17px}
  .actions{flex-direction:column}
  .btn{width:100%}
  .field{min-width:100%}
}

/* 481-768px: allow 2 buttons row */
@media (min-width: 481px) and (max-width: 768px){
  .btn{min-width:160px}
}

/* --- Pro Step 1 (safe append) --- */
.chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border:1px solid #e5e7eb;
  border-radius:999px;
  font-size:12px;
  background:#fff;
}
.badge-danger{
  border-color:rgba(185,28,28,.25);
  background:rgba(185,28,28,.10);
  color:#b91c1c;
  font-weight:700;
}
.badge-warn{
  border-color:rgba(245,158,11,.30);
  background:rgba(245,158,11,.12);
  color:#92400e;
  font-weight:700;
}
.badge-ok{
  border-color:rgba(4,120,87,.25);
  background:rgba(4,120,87,.08);
  color:#047857;
  font-weight:700;
}
.finding{
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:10px;
  margin:10px 0;
  background:#fff;
}
.finding-code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12px;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:8px;
  margin:8px 0;
  white-space:pre-wrap;
  word-break:break-word;
}
.finding-item{ margin:10px 0; }
.finding-item-head{ display:flex; gap:8px; align-items:center; }
.finding-sev{
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid #e5e7eb;
}
.finding-sev.high{ border-color:rgba(185,28,28,.25); background:rgba(185,28,28,.10); color:#b91c1c; font-weight:700; }
.finding-sev.medium{ border-color:rgba(245,158,11,.30); background:rgba(245,158,11,.12); color:#92400e; font-weight:700; }
.finding-sev.low{ border-color:rgba(4,120,87,.25); background:rgba(4,120,87,.08); color:#047857; font-weight:700; }

