/* #883 Nest fields batch (the visual audit of 9 Nov): ONE field look for every box that has the phone's microphone, on every
   Nest screen (New survey, roof and building Property, Roof set-up, core samples and the other schedules, the Report tab,
   Account). Generalised from #901's building Property and #906's roof Property, which now use it. Every rule needs
   label[data-nest-field] (set only by assets/phone-nest-field.js, only while Nest is on and the screen shows), so with the
   switch off nothing here matches. Values are reference/sn.css's .field, .box, .box.area and .mic (tokens --nest-* from
   assets/phone-nest.css). The app wraps such a box in .ph-flow-voice-field, so the label's box is not its direct child:
   - the label over a 48 px box, the label's lines at the top (so two boxes side by side start on one line, same top, same
     height: Inspection date and Surveyor, Roof reference and Roof type, Instrument reading and unit);
   - the microphone inside the box: a 36 px pill, vertically centred in a one-line box, bottom right in a text box, the
     text stopping before it;
   - Clear, Undo and the dictation words on one line under the box (only while relevant: assets/phone-nest-field.js).
   The test server's phone_compact_layout sets min-height: 48px !important on every button (assets/phone.css), so the
   microphone and the line's text buttons answer with !important; each keeps a 44 pt hit area through its ::after.
   :not(#nest-field) raises these over each screen's own label and box rules (one id each) without !important. No url(),
   no web fonts.
   No :has() in this file (codex-crit-929): the app's minimum is iOS 15.0 and Safari has :has() only from 15.4, where a rule
   with it is dropped whole. A text box is told from a one-line box by its own tag (the app puts the microphone after the
   box: assets/phone-flow-voice.js), and the row of two boxes by data-nest-pair, which assets/phone-nest-field.js sets. */
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; align-content: flex-start; gap: 6px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
  width: auto; min-width: 0; font: 600 13px/1.2 var(--nest-text); color: var(--nest-soft); text-align: left;
}
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > :is(.ph-flow-voice-field, .ph-nest-voiceline, .ph-error) { flex: 1 0 100%; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > :is(.ph-opt, .ph-optional) { font: 400 12px/1.2 var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field { position: relative; display: block; width: 100%; min-width: 0; max-width: none; margin: 0; padding: 0; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > :is(input, textarea):not(#nest-field-x) {
  display: block; box-sizing: border-box; width: 100%; max-width: none; min-height: 48px; margin: 0; padding: 0 52px 0 12px;
  background: var(--nest-field); border: 1px solid var(--nest-line); border-radius: 2px; box-shadow: none;
  font: 400 16px/1.35 var(--nest-text); color: var(--nest-ink); text-align: left;
}
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > input:not(#nest-field-x) { height: 48px; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > textarea:not(#nest-field-x) { min-height: 88px; padding: 12px 56px 12px 12px; resize: none; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > :is(input, textarea):not(#nest-field-x)::placeholder { color: var(--nest-faint); opacity: 1; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > :is(input, textarea):not(#nest-field-x):focus { border-color: var(--nest-teal); box-shadow: 0 0 0 1px var(--nest-teal); outline: 0; }
/* the words being heard, drawn over the box: the box's own padding (assets/phone-flow-voice.js copies it) */
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > .ph-flow-voice-heard { font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > .ph-mic {
  position: absolute; z-index: 2; right: 6px; top: 50%; bottom: auto; left: auto; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-width: 36px !important; min-height: 36px !important; margin: 0; padding: 0; border: 0; border-radius: 999px !important;
  background: var(--nest-notice); color: var(--nest-teal); box-shadow: none;
}
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > textarea ~ .ph-mic { top: auto; bottom: 8px; right: 8px; transform: none; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > .ph-mic::after { content: ""; position: absolute; inset: -4px; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > .ph-mic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > .ph-mic[aria-pressed="true"] { background: var(--nest-teal); color: #fff; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-flow-voice-field > .ph-mic:focus-visible { outline: 2px solid var(--nest-teal); outline-offset: 2px; }
/* the one line under the box: what the microphone says on the left, Undo and Clear as small text buttons on the right */
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-nest-voiceline {
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0 4px; min-width: 0; margin: -2px 0 0; padding: 0;
  font: 400 13px/18px var(--nest-text); color: var(--nest-muted); text-align: left;
}
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-nest-voiceline[data-nest-idle] { display: none; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-nest-voiceline > :is(.ph-voice-status, .ph-flow-voice-status) { flex: 1 1 140px; min-width: 0; margin: 0; padding: 0; font: inherit; color: inherit; text-align: left; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-nest-voiceline > :is(.ph-voice-status, .ph-flow-voice-status):is([data-nest-idle], [hidden], :empty) { display: none; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-nest-voiceline > :is(.ph-voice-undo, .ph-voice-clear) {
  position: relative; flex: none; align-self: center; display: inline-flex; align-items: center; gap: 4px; width: auto; height: 32px; min-width: 0 !important; min-height: 32px !important;
  margin: 0; padding: 0 8px; border: 0; border-radius: 999px; background: none; box-shadow: none; font: 600 14px/1 var(--nest-text); color: var(--nest-teal);
}
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-nest-voiceline > :is(.ph-voice-undo, .ph-voice-clear)::after { content: ""; position: absolute; inset: -6px 0; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-nest-voiceline > :is(.ph-voice-undo, .ph-voice-clear)[hidden] { display: none; }
html[data-phone-nest][data-app-design="flow"] body label[data-nest-field]:not(#nest-field) > .ph-nest-voiceline > :is(.ph-voice-undo, .ph-voice-clear) > .ph-nest-icon { width: 16px; height: 16px; flex: none; }

/* the line under a survey screen's title is a sentence ("Saved on this phone"): the body font; the saved time alone
   ("Saved 10:30") stays in the data font (HANDOVER rule 8). data-nest-words is set by assets/phone-nest-field.js.
   :not(#nest-field) gives this the weight of each screen's own rule for the line (.ph-top:has(#back) #status), which it
   follows in the page, without needing :has() itself. */
html[data-phone-nest][data-app-design="flow"] body .ph-top #status[data-nest-words]:not(#nest-field) { font: 500 12px/1.2 var(--nest-text); letter-spacing: 0; }

/* two boxes side by side (.ph-nest-half, as Inspection date and Surveyor): when one has a microphone, its partner keeps its
   label and box at the top too, so both labels sit on one line and both boxes have the same top and the same 48 px height,
   whether or not the microphone line shows under one of them (Roof reference and Roof type on Roof set-up, Instrument
   reading and unit on a core). data-nest-pair is on the row that holds such a pair (assets/phone-nest-field.js pair). The
   partner has the label-over-box arrangement written out here too (the same values each screen's own label rule gives it,
   which is label:has(> select) and so is not read before iOS 15.4), so the pair lines up on every iPhone the app runs on. */
html[data-phone-nest][data-app-design="flow"] body [data-nest-pair] { align-items: start; }
html[data-phone-nest][data-app-design="flow"] body [data-nest-pair] > label.ph-nest-half:not([data-nest-field]) {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; align-content: flex-start; gap: 6px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
  min-width: 0; font: 600 13px/1.2 var(--nest-text); color: var(--nest-soft);
}
html[data-phone-nest][data-app-design="flow"] body [data-nest-pair] > label.ph-nest-half:not([data-nest-field]) > :is(input, textarea, select, .ph-error) { flex: 1 0 100%; }
html[data-phone-nest][data-app-design="flow"] body [data-nest-pair] > label.ph-nest-half:not([data-nest-field]) > select { box-sizing: border-box; height: 48px; min-height: 48px; margin: 0; }
