/* Edit controls — EDIT (INVENTORY E1, E2; SPEC.md §4.12), measured on win2k-pro_dialog_font.png.
   Single line: <input class="w2k-edit">. Multi-line: <div class="w2k-edit w2k-scrollarea" data-scroll="always">
   <textarea class="w2k-scrollarea__viewport"></textarea></div> (scroll bars inside the client edge). */
.w2k-edit {
  box-sizing: border-box;
  height: var(--metric-edit-height);
  margin: 0;
  border: 0;
  border-radius: 0;
  /* 2px client edge; the text line sits 1px inside it; the content box is exactly one line high. */
  padding: calc(2px + var(--metric-edit-text-top)) calc(2px + var(--metric-edit-margin)) 0;
  background: var(--sys-window);
  box-shadow: var(--edge-sunken);
  color: var(--sys-window-text);
  font: inherit;
  line-height: var(--line-height-ui);
  caret-color: var(--sys-window-text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
/* EC_USEFONTINFO margins: TrueType Tahoma 4px, the MS Sans Serif face 1px (js/components/edit.js sets data-font). */
[data-font="mss"] { --metric-edit-margin: 1px; }
input.w2k-edit { padding-bottom: calc(var(--metric-edit-height) - 2px - var(--metric-edit-text-top) - var(--line-height-ui)); }
.w2k-edit::selection, .w2k-edit ::selection { background: var(--sys-hilight); color: var(--sys-hilight-text); }
/* Read-only and disabled: ButtonFace background; disabled text in GrayText (no emboss in edits). */
.w2k-edit:is([readonly], :read-only):not(:disabled):not(div), .w2k-edit[data-readonly] { background: var(--color-surface); }
.w2k-edit:disabled, .w2k-edit[aria-disabled="true"] { background: var(--color-surface); color: var(--sys-gray-text); -webkit-text-fill-color: var(--sys-gray-text); }
.w2k-edit::placeholder { color: var(--sys-gray-text); }

/* Multi-line edit: the edge on the area, the textarea fills it. */
div.w2k-edit.w2k-scrollarea { height: auto; padding: var(--metric-client-edge); }
div.w2k-edit > textarea {
  margin: 0;
  border: 0;
  padding: var(--metric-edit-text-top) var(--metric-edit-margin);
  resize: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: var(--line-height-ui);
  caret-color: var(--sys-window-text);
  outline: none;
  white-space: pre;
}
div.w2k-edit[data-wrap] > textarea { white-space: pre-wrap; }
div.w2k-edit:has(> textarea:disabled) { background: var(--color-surface); color: var(--sys-gray-text); }
div.w2k-edit:has(> textarea[readonly]) { background: var(--color-surface); }
