/* ================================
 * NicheWorks Base (smartphone-first tools)
 * ================================ */

:root{
  --bg:#ffffff;
  --bg-soft:#f9fafb;
  --border:#e5e7eb;
  --text:#111827;
  --muted:#6b7280;
  --muted2:#9ca3af;
  --accent:#111827;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:var(--bg);
  line-height:1.5;
}

.nw-header{
  padding:14px 12px 6px;
  border-bottom:1px solid var(--border);
  text-align:center;
}
.nw-title{
  margin:0;
  font-size:18px;
  letter-spacing:.2px;
}
.nw-lead{
  margin:6px 0 0;
  font-size:12px;
  color:var(--muted);
}

.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;
}

.nw-main{
  max-width:600px; /* smartphone-first tools allowed by spec */
  margin:0 auto;
  padding:10px 12px 18px;
}

.ad-slot{
  margin:12px 0 16px;
  padding:8px;
  border:1px dashed #d4d4d4;
  font-size:11px;
  color:var(--muted2);
  text-align:center;
  min-height:60px;
}
.ad-top{ margin-top:4px; }
.ad-bottom{ margin-bottom:8px; }

.nw-note{
  margin:0 0 10px;
  padding:8px 10px;
  border:1px solid var(--border);
  background:var(--bg-soft);
  border-radius:10px;
  font-size:12px;
  color:var(--muted);
}

.card{
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 1px 0 rgba(0,0,0,.03);
  margin:10px 0 14px;
}
.card-hd{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:var(--bg-soft);
}
.card-title{
  margin:0;
  font-size:13px;
}
.card-bd{
  padding:12px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:10px 0;
}
.label{
  font-size:12px;
  color:var(--muted);
}
.input, .textarea, .select{
  width:100%;
  padding:10px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  font-size:14px;
  outline:none;
}
.textarea{ min-height:110px; resize:vertical; }

.row{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:10px 12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:10px;
  cursor:pointer;
  font-size:13px;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover{
  background:var(--bg-soft);
  transform:translateY(-1px);
  box-shadow:0 1px 4px rgba(0,0,0,.08);
}
.btn.primary{
  background:var(--accent);
  color:#fff;
  border-color:var(--accent);
}
.btn.primary:hover{ background:#000; }
.btn.danger{
  border-color:#ef4444;
  color:#ef4444;
}
.btn.danger:hover{
  background:#fff5f5;
}

.out{
  width:100%;
  padding:10px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--bg-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12px;
  white-space:pre-wrap;
  word-break:break-word;
}

.hr{
  border:none;
  border-top:1px solid var(--border);
  margin:12px 0;
}

.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:6px;
}
.nw-donate-links a{
  display:inline-block;
  padding:8px 14px;
  border:1px solid #d1d5db;
  border-radius:8px;
  background:#fff;
  font-size:13px;
  color:var(--text);
  text-decoration:none;
}

.nw-other{
  margin:10px 0 0;
  padding:10px 0 0;
  border-top:1px solid var(--border);
  text-align:center;
}
.nw-other-title{
  margin:0 0 8px;
  font-size:12px;
  color:var(--muted);
}
.nw-other-links{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
}
.nw-other-links a{
  font-size:12px;
  color:#4b5563;
  text-decoration:underline;
}

.nw-footer{
  margin-top:24px;
  padding:16px 8px 12px;
  border-top:1px solid var(--border);
  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; }

.og-canvas{
  width:100%;
  height:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}

/* Responsive transform: <=480px */
@media (max-width:480px){
  .nw-main{ padding:10px 10px 18px; }
  .row{ flex-direction:column; align-items:stretch; }
  .btn{ width:100%; }
}
