/* ══════════════════════════════════════════════════════════════
   Noun Configure — Watery v2 (page-specific layout only).
   Colours/surfaces come from watery.css + shell.css tokens; the bespoke
   dark-navy :root palette (--bg/--panel/--accent/…) was dropped. Class names
   (.nc-*) are the noun_configure.js DOM contract and are preserved — this file
   restyles them onto Watery. JS-built rows use the bare .nc-input/.nc-select/
   .nc-btn classes (no Watery class), so those carry the full look here.
═══════════════════════════════════════════════════════════════ */

/* ── Toolbar (project / noun / mode / run) ── */
.nc-toolbar { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.nc-field { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.nc-field > span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-soft); }
#configure-button { margin-left: auto; align-self: flex-end; }

/* ── Inputs / selects (JS-created rows use bare .nc-input / .nc-select) ── */
.nc-input, .nc-select {
  width: 100%; padding: 9px 12px; font-size: 13px; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface2);
  color: var(--text); outline: none; appearance: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.nc-input:focus, .nc-select:focus { border-color: var(--accent); background: rgba(45,212,191,0.06); box-shadow: 0 0 0 3px var(--accent-glow); }
.nc-input:hover:not(:focus), .nc-select:hover:not(:focus) { border-color: var(--border2); }

/* ── Radio mode toggle ── */
.nc-radio-group { display: inline-flex; align-items: center; gap: 14px; border: 0; padding-bottom: 9px; }
.nc-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-mid); cursor: pointer; }
.nc-radio input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ── Buttons (.nc-btn is the JS contract; map onto Watery .btn) ── */
.nc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px;
  font-size: 13px; font-weight: 600; font-family: inherit; border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); background: var(--surface2); color: var(--text); cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s, color .15s;
}
.nc-btn:hover:not(:disabled) { border-color: var(--accent); color: #fff; transform: translateY(-1px); box-shadow: 0 3px 14px var(--accent-glow); }
.nc-btn:active:not(:disabled) { transform: translateY(0); }
.nc-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.nc-btn .icon { width: 14px; height: 14px; }

/* primary CTA — Watery action blue (aqua stays the accent for borders/focus/icons) */
.nc-btn-primary {
  position: relative; overflow: hidden; color: #fff; border: none; padding: 10px 16px; font-weight: 700;
  letter-spacing: 0.2px; background: linear-gradient(135deg, var(--blue-cta-1) 0%, var(--blue-cta-2) 100%);
  box-shadow: 0 4px 20px var(--blue-glow);
}
.nc-btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 30px var(--blue-glow); color: #fff; }

/* icon-only destructive button (delete field / remove row / mark for delete) */
.nc-btn-icon {
  padding: 6px; line-height: 0; gap: 0; color: var(--red-text); background: transparent;
  border: 1.5px solid var(--red-border);
}
.nc-btn-icon:hover:not(:disabled) { border-color: var(--red); color: #fff; background: var(--red-light); box-shadow: 0 3px 14px rgba(240,114,106,0.3); }

/* ── Sections inside the schema panel ── */
.nc-result-body { display: flex; flex-direction: column; gap: 13px; }
.nc-section { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.nc-section:empty { display: none; }
.nc-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.nc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.nc-checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-mid); cursor: pointer; }
.nc-checkbox input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ── Result states (gims-state empty/loading/error blocks live here when not idle) ── */
.nc-result-state { min-height: 120px; }

/* ── Tables ── */
.nc-table-wrap { overflow: auto; max-height: 60vh; border-radius: var(--radius-sm); border: 1px solid var(--card-edge); }
.nc-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 13px; }
.nc-table th, .nc-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-mid); text-align: left; }
.nc-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-soft);
  border-bottom: 1px solid var(--card-edge);
}
.nc-table tbody tr:hover { background: var(--accent-light); }
.nc-table td .nc-input, .nc-table td .nc-select { min-width: 120px; }
.nc-center { text-align: center; }
.nc-row-deleting { opacity: 0.5; text-decoration: line-through; }
.nc-row-deleting td { color: var(--red-text); }

/* ── Primary-ID row (selector + Update) — a clean left-aligned row across the panel width ── */
.nc-primary-row { width: 100%; }
.nc-primary-row .nc-grow { flex: 1 1 auto; }

/* ── Autogenerate segment editor rows ── */
.nc-segment-rows { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.nc-flex { display: flex; gap: 8px; align-items: center; }
/* the type select stays compact so the value control(s) get the rest of the row */
.nc-flex > .nc-select { flex: 0 0 140px; width: 140px; }
.nc-flex-fill { display: flex; gap: 8px; flex: 1; min-width: 0; }
.nc-flex-fill .nc-input, .nc-flex-fill .nc-select { flex: 1 1 auto; min-width: 0; }
.nc-preview { color: var(--text-soft); font-style: italic; font-size: 12.5px; }

/* ── Output (describe JSON dump) ── */
.nc-output {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
  color: var(--text-mid); background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; max-height: 280px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}
.nc-output:empty { display: none; }

/* ── Legacy in-page toast fallback (gims.js .toasts is primary; this only fires
      when window.GIMS is absent, e.g. served outside the shell). Watery tokens. ── */
.nc-toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.nc-toast {
  pointer-events: auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--border2); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 10px 12px; min-width: 180px; max-width: 340px;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease; font-size: 13px; line-height: 1.35;
}
.nc-toast-show { opacity: 1; transform: translateY(0); }
.nc-toast-hide { opacity: 0; transform: translateY(-8px); }
.nc-toast-success { border-left-color: var(--green); }
.nc-toast-error   { border-left-color: var(--red); }
.nc-toast-info    { border-left-color: var(--blue); }

@media (max-width: 720px) {
  .nc-toolbar { flex-direction: column; align-items: stretch; }
  #configure-button { margin-left: 0; align-self: stretch; }
  .nc-field { min-width: 0; }
}
