/* Find Wood — in-place supplier editor (moderator+). Styles the overlay/sheet
   that supplier-edit.js mounts on the static supplier page, plus the editor form
   itself. The form rules are ported from the standalone supplier_form.html page
   but SCOPED under .fw-edit-sheet so they never restyle the supplier profile. */

.fw-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
  overflow: auto;
  background: rgba(20, 14, 8, 0.5);
}
body.fw-edit-open { overflow: hidden; }

.fw-edit-sheet {
  width: 100%;
  max-width: 760px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.32);
}

.fw-edit-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px 10px 0 0;
}
.fw-edit-bar strong { font-size: 1rem; }
.fw-edit-close {
  background: none;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0 0.2rem;
}
.fw-edit-close:hover { color: var(--ink); }

.fw-edit-body { padding: 4px 22px 24px; }
.fw-edit-loading, .fw-edit-error { padding: 28px 4px; color: var(--muted); }
.fw-edit-flash { color: #b3261e; font-weight: 600; margin: 0.6rem 0; }

.fw-edit-success { padding: 26px 4px; }
.fw-edit-success h3 { font-size: 1.3rem; margin: 0 0 0.4rem; }
.fw-edit-success p { color: var(--ink-soft); margin: 0 0 1.1rem; }

/* ---- the editor form (scoped) -------------------------------------------- */
.fw-edit-sheet form label { display: block; margin: 0.9rem 0; font-weight: 600; color: var(--ink); }
.fw-edit-sheet form input:not([type="checkbox"]):not([type="hidden"]),
.fw-edit-sheet form select,
.fw-edit-sheet form textarea { margin-top: 0.25rem; width: 100%; box-sizing: border-box; }
.fw-edit-sheet form small { font-weight: 400; color: var(--muted); }
.fw-edit-sheet .row { display: flex; gap: 1rem; }
.fw-edit-sheet .row label { flex: 1; }
.fw-edit-sheet .group-heading { margin: 1.4rem 0 0.3rem; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.fw-edit-sheet .loc-help { font-weight: 400; color: var(--muted); font-size: 0.88rem; margin: 0 0 0.6rem; }
.fw-edit-sheet fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 0.6rem; padding: 0.5rem 0.8rem; }
.fw-edit-sheet fieldset.location { border: 1px solid color-mix(in oklab, var(--ink) 14%, var(--line)); background: var(--surface-2); padding: 0.4rem 0.9rem 0.9rem; margin-bottom: 1rem; }
.fw-edit-sheet fieldset.location > legend { font-size: 1rem; }
.fw-edit-sheet fieldset.axis { background: var(--surface); }
.fw-edit-sheet legend { color: var(--ink); font-weight: 600; font-size: 0.9rem; padding: 0 0.3rem; }
.fw-edit-sheet .loc-remove { float: right; background: none; border: 0; color: #b3261e; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0; }
.fw-edit-sheet .loc-remove:hover { text-decoration: underline; }
.fw-edit-sheet .add-loc { background: var(--surface); color: var(--ink); border: 1px dashed color-mix(in oklab, var(--accent) 55%, var(--line)); padding: 0.5rem 1rem; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; }
.fw-edit-sheet .add-loc:hover { background: var(--accent-soft); }
.fw-edit-sheet .chips-grid { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.fw-edit-sheet label.chk { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 400; margin: 0.15rem 0; }
.fw-edit-sheet label.chk input { width: auto; margin: 0; accent-color: var(--accent); }
.fw-edit-sheet button.save { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); padding: 0.7rem 1.5rem; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 1rem; transition: transform 0.12s ease; }
.fw-edit-sheet button.save:hover { transform: translateY(-1px); }
.fw-edit-sheet button.save:disabled { opacity: 0.6; cursor: default; transform: none; }
.fw-edit-sheet .tag-tokens { margin-top: 0.6rem; }
.fw-edit-sheet .tag-tokens .tag-input { font-weight: 400; }
.fw-edit-sheet .tag-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.fw-edit-sheet .tag-chips:empty { margin-top: 0; }
.fw-edit-sheet .tag-chip { display: inline-flex; align-items: center; gap: 0.25rem; background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 0.15rem 0.25rem 0.15rem 0.6rem; font-size: 0.85rem; font-weight: 500; }
.fw-edit-sheet .tag-chip-x { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.25rem; }
.fw-edit-sheet .tag-chip-x:hover { color: #b3261e; }
.fw-edit-sheet .license-note { font-size: 0.82rem; color: var(--muted); font-weight: 400; margin: 1.2rem 0 0; }
.fw-edit-sheet .license-note a { color: var(--accent); }
.fw-edit-sheet .form-error, .fw-edit-sheet .field-error { color: #b3261e; font-weight: 600; font-size: 0.9rem; }
.fw-edit-sheet .req { color: var(--accent); }

/* Brands + their links (repeatable brand blocks in the supplier form). */
#supplier-form fieldset.brand,
.fw-edit-sheet fieldset.brand { border: 1px solid color-mix(in oklab, var(--ink) 14%, var(--line)); background: var(--surface-2); padding: 0.4rem 0.9rem 0.9rem; margin-bottom: 1rem; border-radius: 6px; }
.brand-link-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }
.brand-link-row select { flex: 0 0 auto; width: auto; }
.brand-link-row input[type=url] { flex: 1 1 220px; }
.brand-link-row input[type=text] { flex: 1 1 130px; }
.brand-remove { float: right; background: none; border: 0; color: #b3261e; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0; }
.add-link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-weight: 600; padding: 0; }
.link-remove { background: none; border: 0; color: #b3261e; cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 0 0.3rem; }
