/* #1042 phone_report_edit: the report editor on the phone. Used only while window.PhoneReportEdit has the screen open
   (#report-edit exists); nothing here matches anything else in the app. Nest: pills 999 px, everything else 2 px. */
.ph-report-edit { position: fixed; inset: 0; z-index: 10003; background: var(--bg, #eef1ee); color: var(--ink, #16242b); box-shadow: 0 0 0 100vmax var(--bg, #eef1ee); }
/* nothing of the screen under the editor shows through at its edges (a keyboard coming up moves them for a moment) */
html[data-report-edit="on"] body > :not(#report-edit) { visibility: hidden !important; }
.ph-report-edit-work, .ph-report-edit-screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg, #eef1ee); }
.ph-report-edit-work[hidden] { display: none; }
.ph-report-edit-bar { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: var(--brand, #0f2e2d); }
#report-edit .ph-report-edit-bar h2 { flex: 1; min-width: 0; margin: 0; font-size: 1.0625rem; color: #f4f7f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#report-edit .ph-report-edit-pill { flex: none; width: auto; min-height: 44px; margin: 0; padding: 8px 18px; border: 0; border-radius: 999px; background: #fff; color: var(--brand, #0f2e2d); font: inherit; font-weight: 700; }
#report-edit .ph-report-edit-pill.ph-report-edit-go { background: var(--accent, #1f5c5b); color: var(--on-accent, #fff); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
#report-edit .ph-report-edit-pill:disabled { opacity: .45; }
.ph-report-edit-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--line, #d3d9d5); }
#report-edit #report-edit-more { margin-left: auto; }
#report-edit .ph-report-edit-tool { flex: none; width: auto; min-height: 44px; margin: 0; padding: 8px 16px; border: 2px solid var(--accent, #1f5c5b); border-radius: 999px; background: #fff; color: var(--accent, #1f5c5b); font: inherit; font-weight: 600; }
#report-edit .ph-report-edit-tool:disabled { opacity: .4; }
/* what has changed: a line of its own under the buttons, ALWAYS ONE LINE HIGH (a second line pushed the report down under his
   finger); a sentence too long for it ends in dots here and is in full under More */
#report-edit-count { order: 9; flex: 0 0 100%; min-width: 0; margin: 0; font-size: .8125rem; line-height: 1.3; color: var(--soft, #5a6970); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the frame is pinned to its pane: a frame sized by "100%" inside a flexible box keeps its old height on an iPhone, and would lie under the note */
.ph-report-edit-pane { flex: 1 1 0; min-height: 0; position: relative; overflow: hidden; background: #fff; }
#report-edit-frame { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: #fff; }
/* until the report is there the pane says so (a long report takes a second or two): never a blank page */
.ph-report-edit-wait { display: none; position: absolute; inset: 0; margin: 0; padding: 24px; align-items: center; justify-content: center; text-align: center; color: var(--soft, #5a6970); font-size: 1rem; }
.ph-report-edit.is-loading .ph-report-edit-wait { display: flex; }
.ph-report-edit.is-loading #report-edit-frame { visibility: hidden; }
/* a line for him: a strip UNDER the report, in the flow, so nothing he is working on is ever covered */
#report-edit-note { flex: none; margin: 0; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); background: #f4f6f4; border-top: 1px solid var(--line, #d3d9d5); border-left: 4px solid var(--accent, #1f5c5b); font-size: .9375rem; line-height: 1.35; max-height: 30%; overflow-y: auto; }
.ph-report-edit-line { margin: 0; padding: 10px 14px; background: #f4f6f4; border-left: 4px solid var(--accent, #1f5c5b); border-radius: 2px; font-size: .9375rem; }
.ph-report-edit-line[hidden] { display: none; }
#report-edit-note[hidden] { display: none; }
#report-edit-note { touch-action: none; }   /* a drag on it is the app's, to move the report (phone-report-edit.js) */
/* the app's own sheets, over the report */
.ph-report-edit-dim { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; background: rgba(0, 0, 0, .35); }
.ph-report-edit-sheet { width: 100%; max-height: 82%; display: flex; flex-direction: column; background: #fff; border-radius: 2px 2px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .25); padding-bottom: env(safe-area-inset-bottom); }
.ph-report-edit-sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
#report-edit .ph-report-edit-sheet-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 1.0625rem; color: var(--ink, #16242b); }
.ph-report-edit-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.ph-report-edit-sheet-body p, .ph-report-edit-sheet-body h4 { margin: 0; }
#report-edit .ph-report-edit-sheet-body :is(.ph-primary, .ph-secondary) { width: 100%; min-height: 48px; margin: 0; border-radius: 999px; }
#report-edit .ph-report-edit-choice { display: block; width: 100%; min-height: 48px; margin: 0; padding: 10px 14px; text-align: left; border: 1px solid var(--line, #d3d9d5); border-radius: 999px; padding-left: 20px; background: #fff; color: var(--ink, #16242b); font: inherit; font-weight: 600; }
#report-edit .ph-report-edit-choice.is-now { border: 2px solid var(--brand, #0f2e2d); background: #ddede8; }
.ph-report-edit-row { display: flex; align-items: center; gap: 8px; }
#report-edit .ph-report-edit-row input { flex: 1; min-width: 0; min-height: 48px; margin: 0; padding: 8px 10px; border: 2px solid var(--brand, #0f2e2d); border-radius: 2px; font: inherit; font-size: 1.0625rem; font-weight: 600; background: #fff; color: var(--ink, #16242b); }
#report-edit .ph-report-edit-row .ph-primary { flex: none; width: auto; padding: 8px 22px; }
.ph-report-edit-warn { color: #a32a1e; font-size: .875rem; }
.ph-report-edit-warn[hidden] { display: none; }
.ph-report-edit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#report-edit .ph-report-edit-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--line, #d3d9d5); border-radius: 2px; background: #eef1ee; overflow: hidden; }
#report-edit .ph-report-edit-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
#report-edit .ph-report-edit-thumb:disabled { opacity: .35; }
/* the screens after Save */
.ph-report-edit-screen { z-index: 3; }
.ph-report-edit-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.ph-report-edit-ok { margin: 0; padding: 12px 14px; background: #ddede8; border-radius: 2px; font-weight: 600; color: var(--brand, #0f2e2d); }
.ph-report-edit-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: #fff; border: 1px solid var(--line, #d3d9d5); border-radius: 2px; }
.ph-report-edit-card b { font-size: 1.0625rem; }
.ph-report-edit-card span { color: var(--soft, #5a6970); font-size: .9375rem; }
.ph-report-edit-warns { border-left: 4px solid #b67a0a; background: #fff6dd; }
.ph-report-edit-warns span { color: var(--ink, #16242b); font-weight: 600; }
.ph-report-edit-warns small { display: block; margin-top: 2px; font-size: .8125rem; font-weight: 400; color: var(--soft, #5a6970); }
.ph-report-edit-warns span + span { padding-top: 6px; border-top: 1px solid rgba(182, 122, 10, .3); margin-top: 2px; }
#report-edit .ph-report-edit-body :is(.ph-primary, .ph-secondary) { width: 100%; min-height: 52px; margin: 6px 0 0; border-radius: 999px; }
html[data-report-edit="on"] body { overflow: hidden; }
/* the Nest rule, over whatever look of the app is on: every button a pill, everything else 2 px */
#report-edit button { border-radius: 999px !important; }
#report-edit :is(.ph-report-edit-thumb, .ph-report-edit-card, .ph-report-edit-ok, .ph-report-edit-row input) { border-radius: 2px !important; }
/* on its side a phone has little height: one row of bars, and the counts give way to the report */
/* (wider than any phone is upright: a small phone held UPRIGHT whose keyboard makes the page shorter is wider than it is tall
   too, and must keep the upright layout) */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 501px) {
  /* Back and Save keep their width; the buttons and the line of what changed share the rest (the line gives way, in one line) */
  .ph-report-edit-work { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .ph-report-edit-work > .ph-report-edit-bar { grid-column: 1; grid-row: 1; padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; padding-left: max(14px, env(safe-area-inset-left)); }
  .ph-report-edit-work > .ph-report-edit-tools { grid-column: 2; grid-row: 1; flex-wrap: nowrap; padding: calc(4px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 4px 0; background: var(--brand, #0f2e2d); border-bottom: 0; }
  .ph-report-edit-work > .ph-report-edit-pane { grid-column: 1 / 3; grid-row: 2; }
  .ph-report-edit-work > #report-edit-note { grid-column: 1 / 3; grid-row: 3; }
  /* while he types on its side the bars give way: the report has every point there is */
  .ph-report-edit.is-typing .ph-report-edit-work > .ph-report-edit-bar, .ph-report-edit.is-typing .ph-report-edit-work > .ph-report-edit-tools { display: none; }
  .ph-report-edit.is-typing .ph-report-edit-work > .ph-report-edit-pane { grid-row: 1 / 3; }
  /* a note there shows whole: "a share of the height" works out as nothing in this layout and cut the words off to an empty strip */
  .ph-report-edit-work > #report-edit-note { max-height: none; overflow-y: visible; padding: 6px max(14px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); font-size: .875rem; line-height: 1.25; }   /* and takes as little of so little height as it can */
  /* the counts take the title's place in the one row */
  .ph-report-edit-work > .ph-report-edit-bar h2 { display: none; }
  .ph-report-edit-work > .ph-report-edit-bar { justify-content: space-between; }
  .ph-report-edit-work #report-edit-count { order: 0; flex: 1 1 0; color: #f4f7f6; }
  #report-edit .ph-report-edit-work .ph-report-edit-tool, #report-edit .ph-report-edit-work .ph-report-edit-pill { flex: none; white-space: nowrap; }
  #report-edit .ph-report-edit-work .ph-report-edit-tool { background: transparent; color: #f4f7f6; border-color: rgba(255, 255, 255, .55); }
}
/* THE WORKING SIGN (assets/busy-sign.js) inside the editor: a spinner and a word in the button he tapped. A button that is working looks the same as everywhere (phone.css), and the sign's own "This can take a minute." beside a bar button is not used here: the editor says it in its own note
   ("Making your report again ... This can take a minute.") and a second sentence in the bar would move the buttons. */
#report-edit .ph-report-edit-bar .sn-busy-note { display: none; }
/* until the report is there: a spinner above the words (the words say what is happening; a long wait adds "This can take a minute.") */
.ph-report-edit-wait { flex-direction: column; gap: 14px; }
.ph-report-edit-wait::before { content: ""; flex: none; width: 28px; height: 28px; box-sizing: border-box; border: 4px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ph-report-edit-wait-spin .8s linear infinite; }
@keyframes ph-report-edit-wait-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ph-report-edit-wait::before { animation-duration: 2.4s; } }
/* the line that says what is going on while a Save runs or waits for the print room: a spinner before the words */
#report-edit .is-working::before { content: ""; display: inline-block; box-sizing: border-box; width: 1em; height: 1em; margin: 0 .55em -.15em 0; border: .17em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ph-report-edit-wait-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { #report-edit .is-working::before { animation-duration: 2.4s; } }
/* the working sign on the Back button, while a Save runs and he has pressed Back: a spinner, in the button */
#report-edit .ph-report-edit-pill.is-busy::before { content: ''; display: inline-block; width: .9em; height: .9em; margin-right: .5em; vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ph-report-edit-spin .8s linear infinite; }
@keyframes ph-report-edit-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #report-edit .ph-report-edit-pill.is-busy::before { animation-duration: 2.4s; } }
/* the line under an export button: always there (empty), so the sign's "This can take a minute." takes nobody's place and the Word card stays where it is */
.ph-report-edit-slot { height: 1.4em; overflow: hidden; margin: 0; font-size: .875rem; line-height: 1.4; color: var(--soft, #5a6970); }
.ph-report-edit-slot .sn-busy-note { display: inline; margin: 0; font-size: inherit; line-height: inherit; }   /* a fixed line: the sentence fills it, never makes it taller */
/* a working button inside a card: the card's own rule for its small grey words (".ph-report-edit-card span") must not reach the sign's label and spinner:
   they take the button's colour and size (the label was grey on the button's own colour, very hard to read) */
#report-edit .ph-report-edit-card button span { color: inherit; font-size: inherit; font-weight: inherit; }
/* THE STRIP UNDER THE REPORT while a Save works, waits or takes too long: ONE fixed room for all three sentences (four lines, its own scroll beyond that), so the
   strip never grows under the report and cuts off its last lines. (On its side it keeps the one-row layout below.) */
@media not all and (orientation: landscape) and (max-height: 500px) and (min-width: 501px) {
  #report-edit-note.is-reserved { box-sizing: border-box; min-height: calc(5.4em + 20px + env(safe-area-inset-bottom)); max-height: calc(5.4em + 20px + env(safe-area-inset-bottom)); overflow-y: auto; }
}
