/* moaa-edit-fields.css — MOAA inline-editing standard.
 *
 * In edit mode an editable field should look like its view-mode text: no
 * border, no box, transparent background — only the text turns gold. This
 * mirrors Admin › Manage › Consultants (the reference panel) and is applied
 * suite-wide so editing feels the same everywhere.
 *
 * Scope: data cards only (.mg-card). Toolbar search, scope selectors, header
 * buttons and AI-drawer controls live OUTSIDE .mg-card, so they keep their
 * normal boxed look. To force a control inside a card to keep its box, add
 * the class "moaa-keepbox". Checkboxes/radios/files/colour pickers and the
 * project-list search (.mg-search) are left untouched.
 *
 * `background-color` (not the `background` shorthand) is overridden so the
 * shared select chevron — a background-IMAGE from moaa-chevron.css — survives.
 * Load this AFTER moaa-chevron.css.
 */

.mg-card input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not(.moaa-keepbox):not(.mg-search):not(:disabled),
.mg-card textarea:not(.moaa-keepbox):not(:disabled),
.mg-card select:not([multiple]):not([size]):not(.moaa-keepbox):not(:disabled) {
  border: none !important;
  background-color: transparent !important;
  color: #B8860B !important;
  box-shadow: none !important;
  outline: none !important;
  border-radius: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Borderless selects still need room on the right for the shared chevron. */
.mg-card select:not([multiple]):not([size]):not(.moaa-keepbox):not(:disabled) {
  padding-right: 16px !important;
}

/* Empty fields read as editable (faint gold) rather than as filled grey. */
.mg-card input:not([type=checkbox]):not([type=radio]):not(.moaa-keepbox):not(.mg-search)::placeholder,
.mg-card textarea:not(.moaa-keepbox)::placeholder {
  color: rgba(184, 134, 11, 0.45) !important;
}

/* ── No row-height jump between view and edit ──────────────────────────────
 * A form control renders the `normal` line-height TALLER than a text <span>
 * (browsers reserve extra space for controls). View mode is spans, edit mode
 * is controls, so the row grows when you start editing. Pinning the field to
 * an explicit unitless line-height removes that reserve: 1.3 is the font's own
 * text ratio, so an input/select/textarea now occupies exactly the same line
 * box as the view-mode text at every font size. Combined with stripping the
 * box (no min-height, no vertical padding) the row height is identical in both
 * modes. The view text (.pw-rotext in schedules) is pinned to the same ratio. */
.mg-card input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not(.moaa-keepbox):not(.mg-search):not(:disabled),
.mg-card select:not([multiple]):not([size]):not(.moaa-keepbox):not(:disabled),
.mg-card textarea:not(.moaa-keepbox):not(:disabled) {
  min-height: 0 !important;
  line-height: 1.3 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.mg-card input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not(.moaa-keepbox):not(.mg-search):not(:disabled),
.mg-card select:not([multiple]):not([size]):not(.moaa-keepbox):not(:disabled) {
  height: auto !important;
}
.pw-docreg .pw-cell .pw-rotext { line-height: 1.3 !important; }

/* ── Canonical table-row delete control ───────────────────────────────────
 * Grey ×, turning red on hover — the behaviour of the Fittings schedule's
 * .pw-del. One rule drives both .moaa-x and .pw-del so every delete control in
 * the suite is identical in size, colour, weight and hover feel. Sized (15px,
 * line 1, no vertical padding) so it never sits taller than a 1.3-line field
 * and can't grow the row it lives in. */
.moaa-x, .pw-del {
  border: none !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 0 !important;              /* hide whatever glyph the markup used (× or ✕) */
  line-height: 1 !important;
  cursor: pointer;
  padding: 0 2px !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color .12s, background .12s;
}
/* One canonical glyph everywhere, at one size — so every delete control is
 * visually identical regardless of what character the markup contains. */
.moaa-x::before, .pw-del::before {
  content: '\00D7';                      /* × multiplication sign (lighter than ✕) */
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
}
.moaa-x:hover, .pw-del:hover { color: #B91C1C !important; background: #FEF2F2 !important; }
.moaa-x:disabled, .pw-del:disabled { color: var(--border) !important; background: transparent !important; cursor: default; }
