/* tools/image-redact/style.css
   Redact tool + minimal NicheWorks shell styles (local-only, LIGHT)
*/

:root{
  --nw-bg: #ffffff;
  --nw-surface: #ffffff;
  --nw-surface-2: #ffffff;
  --nw-border: rgba(15,23,42,0.14);
  --nw-border-2: rgba(15,23,42,0.18);
  --nw-text: rgba(15,23,42,0.92);
  --nw-dim: rgba(15,23,42,0.72);
  --nw-muted: rgba(15,23,42,0.60);
  --nw-accent: #2563eb; /* blue */
  --nw-danger: #dc2626; /* red */

  --nw-radius: 18px;
  --nw-radius-sm: 14px;
  --nw-shadow: 0 18px 55px rgba(2,6,23,0.10);
  --nw-shadow-sm: 0 10px 30px rgba(2,6,23,0.08);

  --nw-max: 1120px;
  --nw-narrow: 980px;
}

html, body{
  background: var(--nw-bg);
  color: var(--nw-text);
}
body{
  margin: 0;
  line-height: 1.55;
}
a{ color: var(--nw-accent); text-decoration: none; }
a:hover{ text-decoration: underline; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* ---------- shell (nw-*) ---------- */
.nw-header{ padding: 18px 16px 10px; }
.nw-title{
  max-width: var(--nw-max);
  margin: 0 auto;
  padding: 16px 18px;
  background: var(--nw-surface);
  border: 1px solid var(--nw-border);
  border-radius: var(--nw-radius);
  box-shadow: var(--nw-shadow-sm);
}
.nw-title h1{
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0.2px;
}
.nw-sub{
  margin: 0 0 10px;
  color: var(--nw-dim);
  font-size: 13px;
}
.nw-lang-switch{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--nw-border);
  border-radius: 999px;
  background: rgba(2,6,23,0.03);
}
.nw-lang-switch button{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--nw-text);
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
}
.nw-lang-switch button:hover{ background: rgba(2,6,23,0.05); }

.nw-main{ padding: 10px 16px 22px; }
.nw-main-narrow{ max-width: var(--nw-narrow); margin: 0 auto; }

.nw-brief{
  margin: 12px 0 14px;
  padding: 14px 16px;
  background: var(--nw-surface);
  border: 1px solid var(--nw-border);
  border-radius: var(--nw-radius);
}
.nw-brief p{ margin: 0 0 10px; color: var(--nw-dim); font-size: 13px; }
.nw-usage-link{ margin: 0; font-weight: 800; }

.ad-slot{
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px dashed rgba(15,23,42,0.22);
  border-radius: var(--nw-radius);
  color: var(--nw-muted);
  background: rgba(2,6,23,0.02);
}

.nw-donate{
  margin: 16px 0 10px;
  padding: 14px 16px;
  background: var(--nw-surface);
  border: 1px solid var(--nw-border);
  border-radius: var(--nw-radius);
}
.nw-donate-text{ margin: 0 0 10px; color: var(--nw-dim); font-size: 13px; }
.nw-donate-links{ display: flex; gap: 10px; flex-wrap: wrap; }
.nw-donate-links a{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(2,6,23,0.03);
  border: 1px solid var(--nw-border);
  color: var(--nw-text);
  font-weight: 900;
}
.nw-donate-links a:hover{ background: rgba(2,6,23,0.05); text-decoration: none; }

.nw-links{
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: var(--nw-radius);
  border: 1px solid var(--nw-border);
  background: rgba(2,6,23,0.02);
  color: var(--nw-dim);
  font-size: 13px;
}
.nw-links a{ font-weight: 800; }

/* ---------- tool layout ---------- */
.tool-wrap{
  display: grid;
  grid-template-columns: 1.1fr 1.9fr 1.1fr;
  gap: 12px;
  align-items: start;
  margin: 12px 0 14px;
}

.panel{
  background: var(--nw-surface-2);
  border: 1px solid var(--nw-border);
  border-radius: var(--nw-radius);
  box-shadow: var(--nw-shadow-sm);
  overflow: hidden;
}
.panel-title{
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  letter-spacing: 0.2px;
  border-bottom: 1px solid rgba(15,23,42,0.10);
}

.panel-upload{ padding: 12px; }
.upload-row{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
#fileInput{ max-width: 100%; color: var(--nw-dim); font-weight: 700; }
.drop-zone{
  border: 1px dashed rgba(15,23,42,0.22);
  border-radius: var(--nw-radius);
  padding: 14px 12px;
  background: rgba(2,6,23,0.02);
  cursor: pointer;
}
.drop-zone:focus{ outline: 2px solid rgba(37,99,235,0.35); outline-offset: 2px; }
.dz-title{ margin: 0 0 6px; font-weight: 900; }
.dz-meta{ margin: 0; color: var(--nw-muted); font-size: 12px; }

.panel-canvas{ padding: 12px; }
.canvas-wrap{
  position: relative;
  border-radius: var(--nw-radius);
  border: 1px solid rgba(15,23,42,0.12);
  background: rgba(2,6,23,0.01);
  overflow: hidden;
}
#canvas{
  display: block;
  width: 100%;
  height: auto;
  background: rgba(2,6,23,0.04);
}
.canvas-hint{
  position: absolute;
  left: 12px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.14);
  color: rgba(15,23,42,0.86);
  font-weight: 900;
  font-size: 12px;
}

.controls{ margin-top: 10px; display: grid; gap: 10px; }
.ctrl-row{ display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ctrl-group{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: var(--nw-radius-sm);
  background: rgba(2,6,23,0.02);
  border: 1px solid rgba(15,23,42,0.10);
}
.ctrl-label{
  color: var(--nw-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
#zoomRange{ width: 160px; }
#zoomLabel{ min-width: 52px; text-align: right; color: var(--nw-dim); font-weight: 900; }

.panel-mask{ padding: 0; }
.panel-mask > *:not(.panel-title){ padding: 12px 14px; }
.mask-type{ display: grid; gap: 8px; }
.mask-type label{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--nw-radius-sm);
  background: rgba(2,6,23,0.02);
  border: 1px solid rgba(15,23,42,0.10);
  cursor: pointer;
}
.mask-type input{ transform: scale(1.1); }
.mask-type span{ font-weight: 900; }

.strength-row{ display: flex; align-items: center; gap: 10px; }
#strengthRange{ width: 100%; }
#strengthLabel{ min-width: 34px; text-align: right; font-weight: 900; color: var(--nw-dim); }
.hint{ margin: 8px 0 0; color: var(--nw-muted); font-size: 12px; }

.mask-actions{ display: flex; gap: 10px; flex-wrap: wrap; }
.mask-list{ padding-top: 0 !important; }
.mask-list-head{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.chips{ display: flex; gap: 8px; flex-wrap: wrap; }

.panel-export{ padding: 12px; }
.btn-wide{ width: 100%; }

/* ---------- buttons ---------- */
.btn{
  appearance: none;
  border: 1px solid rgba(15,23,42,0.16);
  background: rgba(255,255,255,0.90);
  color: var(--nw-text);
  font-weight: 900;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(2,6,23,0.08);
}
.btn:hover{ background: rgba(255,255,255,1); }
.btn:active{ transform: translateY(1px); }

.btn-muted{ background: rgba(255,255,255,0.70); }
.btn-primary{
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.30);
}
.btn-primary:hover{ background: rgba(37,99,235,0.16); }

.btn-danger{
  background: rgba(220,38,38,0.10);
  border-color: rgba(220,38,38,0.28);
}
.btn-danger:hover{ background: rgba(220,38,38,0.14); }

/* ---------- modal (preview) ---------- */
.modal.hidden{ display: none; }
.modal{
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(2,6,23,0.35);
  padding: 18px;
  box-sizing: border-box;
}
.modal-card{
  max-width: min(980px, 100%);
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.14);
  border-radius: 18px;
  box-shadow: var(--nw-shadow);
  overflow: hidden;
}
.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15,23,42,0.10);
}
.modal-title{ font-weight: 900; color: var(--nw-text); }
.modal-body{ padding: 12px 14px 14px; }
#previewCanvas{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.12);
  background: rgba(2,6,23,0.04);
}
.modal-controls{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px){
  .tool-wrap{ grid-template-columns: 1fr 1.6fr; }
  .panel-mask{ grid-column: 1 / -1; }
}
@media (max-width: 820px){
  .tool-wrap{ grid-template-columns: 1fr; }
  .nw-title h1{ font-size: 20px; }
  #zoomRange{ width: 140px; }
}
