/* Report sections reuse the workbench's form, card and field styles. */
.report-form { max-width:900px; }
.report-form section + section { margin-top:28px; padding-top:24px; border-top:1px solid var(--line); }
.report-form section h3 { margin-bottom:16px; }
.report-form input[type=checkbox] { width:18px; min-height:18px; vertical-align:middle; }
.report-form footer { gap:10px; flex-wrap:wrap; }
.report-structure { border:1px solid var(--line); border-radius:8px; padding:16px; margin:16px 0; }
.report-structure > header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.report-structure h4 { margin:0; }
.report-photo-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(210px,100%),1fr)); gap:14px; margin:16px 0; }
.report-photo { min-width:0; margin:0; }
.report-photo img { width:100%; height:180px; object-fit:cover; border-radius:7px; }
.report-photo figcaption { font-size:14px; line-height:1.7; color:var(--muted); overflow-wrap:anywhere; margin:7px 0; }
.report-photo-choice { display:grid; gap:8px; padding:12px; border:1px solid var(--line); border-radius:8px; cursor:pointer; min-width:0; }
.report-photo-choice:has(input:checked) { border-color:var(--teal); background:var(--sys-selected,#f0f6d7); }
.report-photo-choice:focus-within { outline:2px solid var(--teal); outline-offset:2px; }
.report-photo-choice input[type=checkbox] { width:20px; min-height:20px; margin:0; justify-self:start; accent-color:var(--teal); }
.report-photo-choice img { width:100%; height:150px; object-fit:contain; border-radius:5px; background:var(--panel); }
.report-photo-choice small { font-size:13px; overflow-wrap:anywhere; }
.report-map { position:relative; width:100%; margin-bottom:16px; cursor:crosshair; }
.report-map > img { display:block; width:100%; height:auto; }
.report-map-marker { position:absolute; transform:translate(-50%,-50%); border:2px solid white; border-radius:50%; min-width:28px; padding:3px 6px; background:var(--teal); color:white; font-size:13px; text-align:center; pointer-events:none; }
.report-marker-controls { margin:16px 0; }
.report-marker-controls .button { margin:0 6px 10px 0; }
#monthly-links { display:flex; gap:10px; flex-wrap:wrap; margin:16px 0; }
#month-filter { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)) auto auto; align-items:end; gap:12px; }
#month-filter .field { min-width:0; }
.report-form fieldset:disabled { opacity:1; }
.report-form input:disabled,.report-form textarea:disabled,.report-form select:disabled { opacity:1; color:var(--ink); background:var(--paper); }
@media(max-width:900px) {
  #month-filter { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:600px) {
  .report-structure { padding:12px; }
  .report-form footer button { flex:1 1 100%; }
}
.report-extra { margin:16px 0; padding:14px; border:1px solid var(--line); border-radius:8px; }
.report-extra summary { cursor:pointer; color:var(--ink); font-size:14px; line-height:1.6; }
.report-extra[open] summary { margin-bottom:16px; }
.patrol-report-map { width:100%; height:360px; min-width:0; position:relative; overflow:hidden; background:#e5ece5; border:1px solid var(--line); border-radius:8px; margin-bottom:14px; }
.patrol-report-map > svg { width:100%; height:100%; }
.patrol-report-map text { font-size:18px; font-weight:bold; fill:#075b59; cursor:pointer; }
.patrol-point-pin { display:block; min-width:32px; padding:7px; border:2px solid white; border-radius:50% 50% 50% 0; background:#075b59; color:white; font-weight:bold; box-shadow:0 2px 8px #0004; text-align:center; }
[data-point] { scroll-margin:16px; }
[data-point] .muted { overflow-wrap:anywhere; }
@media(max-width:600px) {
  .patrol-report-map { height:300px; }
  .report-extra { padding:12px; }
  #add-map-point, #add-gps-point { flex:1 1 100%; }
}

.report-point-photos h5 { margin:18px 0 12px; font-size:15px; }
.report-point-photos .muted { font-size:14px; line-height:1.7; }
.report-point-photos .patrol-actions { flex-wrap:wrap; gap:10px; }

/* One form and one scroll container; desktop keeps the map beside report fields. */
@media(min-width:1100px) {
  body.worker-app .patrol-main.is-report-view { max-width:1560px; padding-inline:28px; }
  .admin-app .patrol-main.is-report-view #patrol-content,
  .admin-app .patrol-main.is-report-view #patrol-message { width:min(1504px,100%); }
  .is-report-view .patrol-heading { max-width:none; }
  body.worker-app .patrol-form.report-form,
  .admin-app .patrol-form.report-form { max-width:none; padding:0; border:0; background:transparent; }
  .report-form #report-fields {
    display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); gap:20px; align-items:start;
    grid-template-areas:"overview overview" "map points" "map attachments" "map extras" "actions actions";
  }
  .report-form #report-fields > section,
  .report-form #report-fields > .report-other-photos {
    min-width:0; margin:0; padding:20px; background:var(--panel); border:1px solid var(--line); border-radius:10px;
  }
  .report-overview { grid-area:overview; }
  .report-checks { grid-area:checks; }
  .report-form #report-fields > .report-map-panel { grid-area:map; position:sticky; top:12px; }
  .report-points { grid-area:points; }
  .report-attachments { grid-area:attachments; }
  .report-other-photos { grid-area:extras; }
  .report-conclusion { grid-area:conclusion; }
  .report-submit-bar { grid-area:actions; }
  .report-map-panel .patrol-report-map { height:clamp(200px,calc(100dvh - 550px),560px); }
  .report-map-panel > .muted { font-size:13px; line-height:1.65; }
  .report-map-panel #map-pick-status { font-size:13px; line-height:1.65; }
  .report-map-panel #map-pick-status:empty { margin:0; }
  .report-map-panel h3, .report-points h3 { margin-top:0; }
  .report-overview > p { margin:0 0 12px; }
  .report-overview > .report-extra { margin-bottom:0; }
  .report-points .report-structure:last-child { margin-bottom:0; }
  .report-form .report-photo-grid { grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr)); }
  .report-form #report-fields > footer { margin:0; padding:16px 20px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
}
/* Short desktop windows must allow the map controls to scroll into view. */
@media(min-width:1100px) and (max-height:850px) {
  .report-form #report-fields > .report-map-panel { position:static; }
}
@media(min-width:1100px) {
  .report-form #report-fields > .report-overview { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:16px; align-items:center; }
  .report-overview > h3, .report-overview > p, .report-overview > .report-extra { margin:0; }
  .report-overview > .report-extra[open] { grid-column:1/-1; }
}

.report-source-evidence .report-photo img { height:auto; max-height:320px; object-fit:contain; background:var(--paper); }
.report-source-evidence .patrol-actions { flex-wrap:wrap; gap:10px; }
#visit-incident { background:var(--paper); }
#visit-incident .field { margin:12px 0; }
@media(max-width:600px) {
  .report-source-evidence .patrol-actions > .button { flex:1 1 100%; }
  #visit-report-issue { width:100%; }
  .report-source-evidence .report-photo img { max-height:220px; }
}

/* Map viewing tools stay secondary; adding a point is the primary action. */
.report-map-frame { position:relative; isolation:isolate; z-index:0; display:grid; grid-template-columns:minmax(0,1fr); }
.report-map-frame > #report-map-status { grid-area:1/1; }
.report-map-frame > .patrol-report-map { grid-area:2/1; margin-top:0; }
.report-map-tools { grid-area:2/1; align-self:start; justify-self:end; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; margin:10px; max-width:calc(100% - 20px); z-index:20; }
.report-map-tools .button { min-height:40px; padding:8px 12px; background:var(--panel,#fff); color:var(--ink); box-shadow:0 2px 8px #102f3220; font-size:13px; }
.report-map-tools .button[aria-disabled=true] { opacity:.6; cursor:wait; }
.report-map-tools [hidden], .report-map-add [hidden], .report-map-pick-options[hidden] { display:none; }
.report-map-add { display:flex; flex-wrap:wrap; gap:10px; margin-top:6px; }
.report-map-pick-options { margin-top:12px; padding:14px; border:1px solid var(--line); border-radius:8px; background:var(--paper); }
.report-map-pick-options p { margin:0 0 12px; }
.report-map-pick-options p:last-child { margin:12px 0 0; }
@media(max-width:600px) { .report-map-add > .button { flex:1 1 auto; } .report-map-tools .button { min-height:44px; } }

.report-form #report-fields > .report-map-panel.is-picking { position:static; }

/* Keep field evidence visible without letting one photo consume the first screen. */
.report-source-evidence > details > .report-photo-grid { grid-template-columns:repeat(auto-fill,minmax(140px,180px)); }
.report-source-evidence .report-photo img { height:110px; max-height:110px; object-fit:contain; }
.report-source-evidence .report-photo figcaption { font-size:12px; }
.report-source-evidence > details { margin-block:10px; }
.report-check-item { margin-top:18px; }
.report-problem { margin:14px 0; padding:16px; border:1px solid var(--line); border-left:4px solid var(--teal); border-radius:8px; background:var(--paper); min-width:0; }
.report-problem header { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.report-problem h4 { margin:0; }
.report-problem .field { margin-block:14px; }
.report-problem [hidden] { display:none; }
.report-problem .report-photo-grid { grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); }
.report-problem .report-photo-choice img { height:95px; }
.report-problem-error { color:var(--danger,#a52b27); }
.report-problem-error:empty { display:none; }
.report-problem-slot:empty { display:none; }
.report-problem .button { margin-block:6px; }
@media(max-width:600px) {
  .report-source-evidence > details > .report-photo-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-problem { padding:12px; }
}
@media(min-width:900px) {
  .report-source-evidence { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,.8fr); column-gap:24px; align-items:start; }
  .report-source-evidence > :not(details) { grid-column:1; margin-block:6px; }
  .report-source-evidence > details { grid-column:2; grid-row:1 / span 7; margin:0; }
  .report-source-evidence > details > .report-photo-grid { grid-template-columns:repeat(auto-fill,minmax(120px,150px)); margin-block:8px; }
  .report-source-evidence .report-photo img { height:85px; }
}

/* Keep adjacent report actions distinct, including controls rendered in slots. */
.patrol-main.is-report-view .patrol-actions,
.is-report-view .report-map-tools,
.is-report-view .report-map-add,
.patrol-main.is-report-view .report-form footer { gap:12px; }
.is-report-view .report-form .button { min-height:44px; }
.report-problem-slot:not(:empty) { margin-block:16px; }
.report-structure > header,
.report-problem > header { flex-wrap:wrap; gap:12px; }
.report-problem > [data-publish-problem]:not([hidden]) { display:flex; margin-top:16px; }
.report-attachments > .button { margin-bottom:16px; }
.report-form [data-live-capture] + .field { margin-top:12px; }
.report-structure-editor { margin-bottom:0; }
.report-structure-editor > .button { margin-block:12px; }

.report-problem > [data-use-source-photos],
.report-problem > [data-reuse-problem-photos] { display:block; margin-block:16px; max-width:100%; white-space:normal; }
.report-problem > label:not(.field) { display:flex; align-items:center; gap:8px; margin-block:16px; }
.report-problem-slot > .patrol-actions { margin-bottom:12px; }

.report-land-hazards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.report-land-hazards > p { grid-column:1 / -1; margin-bottom:0; }
.report-land-hazards .report-check-item { margin-top:0; min-width:0; }
@media(max-width:700px) { .report-land-hazards { grid-template-columns:minmax(0,1fr); } }

.report-land-hazards [hidden] { display:none; }
.report-land-hazards [data-live-capture] { display:block; margin-block:12px; }
.report-overview > .patrol-form-row,
.report-overview > .report-land-hazards { grid-column:1 / -1; }

/* Report-local navigation stays inside the existing page scroll container. */
.report-jump { position:sticky; top:0; z-index:60; display:flex; align-items:center; gap:14px; padding:4px 12px; margin:0 0 20px; background:var(--panel,#fff); border:1px solid var(--line); border-radius:8px; box-shadow:0 3px 10px #103a390a; }
.report-jump-label { flex:none; padding-right:14px; border-right:1px solid var(--line); color:var(--muted); font-size:12px; line-height:1.5; }
.report-jump-track { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(40px,1fr); overflow-x:auto; position:relative; gap:6px; min-width:0; width:100%; max-width:680px; }
.report-jump button { position:relative; min-width:0; min-height:44px; padding:8px 10px; border:0; border-radius:5px; background:transparent; color:var(--muted); font:inherit; font-size:13px; cursor:pointer; white-space:nowrap; }
.report-jump button:hover { background:var(--paper); color:var(--teal); }
.report-jump button[aria-current] { background:var(--sys-selected,#f0f6d7); color:var(--teal,#087b78); font-weight:700; }
.report-jump button[aria-current]::after { content:""; position:absolute; bottom:0; left:25%; right:25%; height:3px; border-radius:3px; background:var(--teal,#087b78); }
.report-jump button:focus-visible { outline:2px solid var(--teal); outline-offset:-2px; }
.report-jump-short { display:none; }
.report-jump-target { scroll-margin-top:88px; }
@media(min-width:1100px) and (min-height:851px) {
  .report-form #report-fields > .report-map-panel { top:84px; }
}
@media(max-width:600px) {
  .report-jump { gap:6px; padding:4px 6px; margin-bottom:16px; }
  .report-jump-label { font-size:11px; padding-right:6px; }
  .report-jump-label-full, .report-jump-full { display:none; }
  .report-jump-short { display:inline; }
  .report-jump-track { gap:2px; }
  .report-jump button { padding-inline:2px; font-size:12px; }
}
@media print { .report-jump { display:none; } }

.report-overview > .report-basic-edit:not([open]) { padding:0; border:0; background:transparent; }
.report-basic-edit > summary { color:var(--teal,#087b78); font-size:14px; min-height:44px; align-content:center; }
.report-basic-edit[open] > summary { margin-bottom:12px; }

.visit-tabs { display:flex; gap:6px; margin:0 0 20px; padding:6px; border:1px solid var(--line); background:var(--panel); border-radius:10px; }
.visit-tabs a { flex:1; min-height:44px; padding:12px 20px; text-align:center; border-radius:6px; color:var(--ink); text-decoration:none; font-weight:700; }
.visit-tabs a[aria-current] { color:var(--teal,#087b78); background:var(--sys-selected,#f0f6d7); box-shadow:inset 0 -2px var(--teal,#087b78); }
.visit-tabs a:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
.collection-context { position:sticky; top:0; z-index:15; display:flex; justify-content:space-between; align-items:center; gap:16px; }
.collection-context .button { flex:none; }
.collection-grid { grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); }
.collection-photo { min-width:0; border:1px solid var(--line); padding:12px; border-radius:8px; background:var(--paper); }
.collection-photo img { width:100%; height:190px; object-fit:contain; }
.collection-photo figcaption { overflow-wrap:anywhere; }
.collection-photo details { margin-top:10px; }
.collection-library-heading { display:flex; justify-content:space-between; gap:12px; align-items:center; flex-wrap:wrap; }
.collection-library-heading span { font-size:13px; color:var(--muted); }
.collection-pending article { padding:14px 0; border-top:1px solid var(--line); }
.collection-actions { position:sticky; bottom:0; z-index:16; display:flex; gap:12px; padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--panel); box-shadow:0 -4px 20px #103a3910; }
.collection-actions .button { min-height:48px; }
.collection-actions #collection-camera { flex:1; font-size:18px; }
.collection-library-dialog { width:min(640px,calc(100vw - 24px)); max-height:90dvh; padding:20px; border:1px solid var(--line); border-radius:12px; background:var(--panel,#fff); color:var(--ink); overflow:auto; }
.collection-library-dialog::backdrop { background:#072c2b66; }
.collection-library-dialog header { position:sticky; top:-20px; display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--panel,#fff); padding-block:12px; z-index:1; }
.collection-library-dialog .report-photo-grid { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.report-library-actions { margin:0 0 16px; }
@media(min-width:1100px) {
  body.worker-app .patrol-main.is-collection-view { max-width:1560px; padding-inline:28px; }
  .collection-library-dialog { margin-right:20px; }
  .is-report-view #report-open-library { position:fixed; right:32px; bottom:112px; z-index:22; box-shadow:0 4px 16px #103a3922; }
}
@media(max-width:600px) {
  .collection-context { align-items:flex-start; gap:8px; }
  .collection-context .button { padding-inline:10px; }
  .collection-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .collection-photo { padding:8px; }
  .collection-photo img { height:135px; }
  .collection-photo figcaption { font-size:12px; }
  .collection-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px; }
  .collection-actions .button { min-height:44px; }
  .visit-tabs a { padding-inline:12px; }
}
@media(min-width:1100px) {
  .collection-library-dialog.is-desktop { position:fixed; inset:96px 16px 96px auto; width:420px; height:calc(100dvh - 192px); max-height:none; margin:0; z-index:40; box-shadow:0 8px 30px #103a3933; }
  body.worker-app .patrol-main.is-report-view.has-photo-library, .admin-app .patrol-main.has-photo-library { padding-right:460px; }
  .has-photo-library .report-form #report-fields { display:block; }
  .has-photo-library .report-form #report-fields > section, .has-photo-library .report-form #report-fields > details { margin-bottom:20px; }
  .has-photo-library .report-form #report-fields > .report-map-panel { position:static; }
  .has-photo-library .report-form #report-fields > .report-overview { display:block; }
  .has-photo-library .report-overview > h3, .has-photo-library .report-overview > p { margin-bottom:12px; }
  .has-photo-library #report-open-library { right:460px; }
}

/* Keep each inline hazard editor wide enough for location and photo controls. */
.report-land-hazards:has([data-problem-card]) { grid-template-columns:minmax(0,1fr); }
.report-problem-summary { padding:16px; margin-block:12px; border:1px solid var(--border, #c8d7d0); border-radius:10px; }
.report-problem-summary p { white-space:pre-wrap; overflow-wrap:anywhere; }
.report-problem-slot > .patrol-actions { margin-block:16px; }

/* Report editing keeps one photo overview and an explicit completion checklist. */
.is-report-view .patrol-heading.report-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px 12px; }
.report-heading-main { grid-column:1/-1; min-width:0; }
.report-back-link { display:inline-flex; align-items:center; justify-self:start; gap:6px; min-height:44px; color:var(--muted); font-size:13px; text-decoration:none; }
.report-back-link > span { font-size:24px; line-height:1; }
.report-back-link:hover { color:var(--teal); text-decoration:underline; }
.report-back-link:focus-visible { outline:2px solid var(--teal); outline-offset:3px; border-radius:4px; }
.report-heading-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; min-width:0; }
.report-heading .report-heading-actions > .button { min-height:44px; padding:8px 10px; font-size:12px; white-space:nowrap; }
.report-draft-actions { justify-content:flex-end; margin-top:12px; }
@media(max-width:600px) {
  .is-report-view .patrol-heading.report-heading { column-gap:6px; }
  .report-heading-actions { gap:4px; }
  .report-heading .report-heading-actions > .button { padding-inline:6px; }
}
.report-photo-overview { display:grid; grid-template-columns:minmax(0,1fr); align-items:center; gap:14px; }
.report-photo-overview > div { grid-column:auto; margin:0; }
.report-photo-overview h3 { margin:0; }
.report-photo-overview p { margin:4px 0 0; }
.report-photo-count { font-size:14px; color:var(--muted); font-weight:400; }
.report-photo-card {
  display:grid; grid-template-columns:minmax(0,1fr); gap:10px;
  padding:10px; border:1px solid var(--sys-selected-border);
  border-radius:var(--sys-radius-control); background:var(--sys-accent-soft);
}
.report-photo-card > h4 { margin:0; color:var(--sys-heading); font-size:14px; line-height:1.5; }
.report-photo-type-count { color:var(--sys-muted); font-size:12px; font-weight:400; }
.report-photo-card > .patrol-actions { justify-content:flex-end; }
.report-photo-card > :is(.report-photo-timeliness, .report-photo-thumbs) { grid-column:1/-1; }
@media (min-width:1100px) {
  .report-photo-card { grid-template-columns:minmax(0,1fr) auto; align-items:center; }
}
.report-photo-thumbs { display:flex; flex-wrap:wrap; gap:6px; }
.report-photo-thumbs figure { margin:0; text-align:center; }
.report-photo-thumbs img { display:block; width:54px; height:54px; object-fit:cover; border:1px solid var(--line); border-radius:6px; }
.report-photo-thumbs figcaption { margin-top:4px; color:var(--sys-muted); font-size:12px; font-variant-numeric:tabular-nums; line-height:1.25; }
.report-photo-thumbs:empty { display:none; }
.report-photo-overview .patrol-actions { margin:0; }
.is-report-view #report-open-library { position:static; box-shadow:none; }
.report-map-panel > details > summary { min-height:44px; display:list-item; cursor:pointer; font-weight:700; font-size:16px; }
.report-map-panel > details:not([open]) > summary { margin:0; }
.report-map-panel > details[open] > summary { margin-bottom:12px; }
.report-map-panel #map-return-record { margin-top:12px; width:100%; }

/* Selection is a single-purpose surface; the report and its footer remain behind it. */
.report-map-picker {
  position:fixed; inset:0; width:min(860px,calc(100vw - 32px)); height:min(760px,calc(100dvh - 32px));
  max-width:none; max-height:none; box-sizing:border-box; padding:0; margin:auto;
  border:1px solid var(--line); border-radius:var(--radius-card,12px); color:var(--ink); background:var(--panel); overflow:hidden;
}
.report-map-picker[open] { display:flex; flex-direction:column; }
.report-map-picker::backdrop { background:rgb(8 30 29 / 60%); }
.report-map-picker > header { display:flex; flex:none; align-items:center; justify-content:space-between; gap:16px; padding:16px; border-bottom:1px solid var(--line); }
.report-map-picker > header > div { min-width:0; }
.report-map-picker h2 { margin:0; font-size:19px; line-height:1.4; }
.report-map-picker header p { margin:4px 0 0; color:var(--muted); font-size:13px; line-height:1.5; }
.report-map-picker [data-map-picker-close] { flex:none; min-height:44px; }
:root body[data-system-ui] .report-map-picker > .report-map-panel { position:static; flex:1; min-height:0; margin:0; padding:12px; border:0; border-radius:0; background:var(--panel); box-shadow:none; }
.report-map-picker .report-map-panel > details { display:none; }
.report-map-picker-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); grid-template-rows:minmax(0,1fr) auto auto; height:100%; min-height:0; gap:10px; }
.report-map-picker-body > :is(p.muted,.report-map-add,.report-extra) { display:none; }
.report-map-picker .report-map-frame { grid-column:1/-1; grid-row:1; min-height:0; grid-template-rows:auto minmax(0,1fr); }
.report-map-picker #report-map-status { margin:0 0 8px; font-size:12px; line-height:1.45; }
:root body[data-system-ui] .report-map-picker .patrol-report-map { height:100%; min-height:100px; margin:0; }
.report-map-picker .report-map-tools { grid-area:2/1; align-self:start; justify-self:end; justify-content:flex-end; margin:8px; max-width:calc(100% - 16px); z-index:20; }
.report-map-picker #map-pick-status { grid-column:1/-1; grid-row:2; margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.report-map-picker #map-pick-options { grid-column:1; grid-row:3; display:block; margin:0; padding:0; border:0; background:transparent; }
.report-map-picker #map-pick-options p { display:none; }
.report-map-picker #map-pick-options .button { width:100%; min-height:48px; }
.report-map-picker #map-return-record { grid-column:2; grid-row:3; align-self:end; margin:0; min-height:48px; }
.report-structure-photo-actions { display:flex; gap:8px; flex-wrap:wrap; }
.report-structure-photo-actions .button { min-height:44px; flex:1; }
.report-structure-photo-status:empty { display:none; }
.report-structure-reference { margin:0 0 16px; padding:16px; border:1px solid var(--line); border-radius:var(--radius-control,8px); background:var(--paper); }
.report-structure-reference > div { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; }
.report-structure-reference > div span,.report-structure-reference small { color:var(--muted); font-size:13px; line-height:1.5; }
.report-structure-reference p { margin:8px 0 12px; }
.report-structure-reference small { display:block; margin-top:8px; }
.report-structure-reference .button { min-height:44px; }
.report-structure-unchanged { margin:0 0 12px; min-height:44px; }
.report-structure-unchanged[aria-pressed=true] { color:var(--teal-dark); border-color:var(--teal); background:var(--paper); }
.report-structure-facts > summary { min-height:44px; padding:10px 0; cursor:pointer; font-weight:650; }
.report-structure-facts > summary span { display:block; margin-top:4px; font-size:13px; line-height:1.5; font-weight:400; color:var(--muted); }
@media(max-width:900px) {
  :root body[data-system-ui] .report-map-picker { width:100%; height:var(--mobile-viewport-height,100dvh); max-width:none; max-height:none; margin:0; border:0; border-radius:0; }
  .report-map-picker > header { padding:12px; padding-top:max(12px,env(safe-area-inset-top)); }
  :root body[data-system-ui] .report-map-picker > .report-map-panel { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
}
@media(max-height:500px) {
  .report-map-picker > header { padding:8px 12px; }
  .report-map-picker header p { display:none; }
  .report-map-picker #report-map-status { max-height:2.9em; overflow:auto; }
  .report-map-picker #map-pick-status { font-size:12px; }
}
.report-checklist { border:1px solid var(--line); border-radius:8px; padding:10px 14px; margin:16px 0; }
.report-checklist > summary { cursor:pointer; min-height:44px; align-content:center; font-weight:700; }
.report-problem, .report-structure, #report-checklist { scroll-margin-top:88px; }
.report-checklist ul { margin:8px 0 0; padding:0; list-style:none; }
.report-checklist li + li { border-top:1px solid var(--line); }
.report-checklist button { background:transparent; border:0; color:var(--teal); text-align:left; width:100%; min-height:44px; font:inherit; padding:10px 0; cursor:pointer; }
.report-checklist button:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
.report-form .report-extra > summary { min-height:44px; align-content:center; }
.report-form .report-extra[open] > summary { margin-bottom:8px; }
.report-submit-bar #report-save-state { margin:0; line-height:1.5; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.report-submit-bar #report-save-state.is-error { color:#9e3825; }
.report-submit-feedback { flex:1; min-width:0; display:grid; gap:2px; }
.report-submit-feedback #report-form-progress { margin:0; color:var(--sys-status-warning-foreground,#835411); font-size:13px; font-weight:700; line-height:1.5; }
.report-submit-feedback #report-form-progress[data-complete=true] { color:var(--sys-status-success-foreground,#216342); }
.report-submit-actions { display:flex; gap:10px; }
.report-problem .report-photo-grid { grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:10px; }
.report-problem .report-photo-choice { padding:8px; }
.report-problem .report-photo-choice img { width:100%; height:90px; }
#report-status:empty { display:none; }
@media(min-width:1100px) {
  .report-form #report-fields { grid-template-areas:"overview overview" "safety map" "attachments map" "points map" "extras map" "actions actions"; }
  .report-form #report-fields:not(:has(.report-points)) { grid-template-areas:"overview overview" "safety map" "attachments map" "extras map" "actions actions"; }
  .report-safety { grid-area:safety; }
  .report-form #report-fields > .report-map-panel { top:86px; }
  .report-land-hazards { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:1099px) {
  .report-photo-overview { padding:14px; gap:10px; }
  .report-photo-card > .patrol-actions { display:flex; gap:8px; }
  .report-photo-overview .patrol-actions > .button { flex:1; min-width:0; padding-inline:8px; }
  .report-photo-thumbs img { width:38px; height:38px; }
  .report-jump-track { width:100%; }
  .report-form .report-structure, .report-form .report-problem { padding:12px; }
  .report-form .report-extra { margin-block:12px; padding:8px 10px; }
}
@media(min-width:1100px) and (max-height:850px) {
  .report-form #report-fields > .report-map-panel { position:static; }
}

/* Inline capture keeps photo actions and retry status in the report. */
.report-photo-overview > .report-photo-help,
.report-photo-overview > #report-photo-status,
.report-photo-overview > .report-photo-pending { grid-column:1/-1; margin:0; }
.report-photo-overview > .report-photo-help { color:var(--muted); font-size:12px; }
#report-photo-status:empty { display:none; }
.report-photo-pending { min-width:0; padding-top:12px; border-top:1px solid var(--line); }
.report-photo-pending article { padding-block:10px; border-bottom:1px solid var(--line); }
.report-photo-pending article:last-child { border-bottom:0; }
.report-photo-pending p { overflow-wrap:anywhere; }
.report-photo-pending .patrol-actions { flex-wrap:wrap; }
.report-photo-pending [data-photo-discard] { color:#a7352c; }
@media(max-width:600px) {
  .report-photo-card { padding:8px; }
  .report-photo-card > .patrol-actions { display:flex; gap:6px; }
  .report-photo-card > .patrol-actions > .button { min-width:0; padding-inline:4px; font-size:12px; }
}

.collection-library-dialog .library-delete-photo { color:#a7352c; background:transparent; border-color:#edccc8; min-height:44px; margin-top:10px; }
.collection-library-dialog .library-delete-photo:hover { background:#fff0ed; }
.library-photo-status { color:var(--teal); overflow-wrap:anywhere; }
.library-photo-status:empty { display:none; }

@media (max-width:600px) {
  .report-map-tools { grid-area:3/1; justify-self:stretch; justify-content:flex-start; margin:8px 0 0; max-width:100%; z-index:1; }
}

/* Page controls never paint above the report directory; native dialogs still use the top layer. */
.is-report-view #report-open-library { z-index:auto; }
.report-jump .report-input-done { display:none; }
@media(max-width:1099px) {
  .report-jump { padding-block:2px; }
  .report-input-active .report-jump-label { display:none; }
  .report-input-active .report-jump .report-input-done { display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; min-width:44px; min-height:44px; padding:4px; background:var(--acid,#d9f54a); color:var(--ink); font-weight:700; }
}

.report-evidence-dialog { width:min(560px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); box-sizing:border-box; padding:20px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:var(--panel); overflow:auto; }
.report-evidence-dialog::backdrop { background:rgb(8 30 29 / 60%); }
.report-evidence-dialog h2 { font-size:20px; margin:0 0 16px; }
.report-evidence-dialog .patrol-evidence-summary { margin-block:12px; }
.report-evidence-dialog .patrol-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:12px; margin-top:20px; }
.report-evidence-dialog .button { min-height:44px; }

.report-required { color:#b42318; font-weight:700; white-space:nowrap; }
#report-check-items { display:grid; gap:8px; list-style:none; padding:0; }
#report-check-items button { width:100%; text-align:left; white-space:normal; min-height:44px; }

.report-problem .report-posted-photos { max-width:440px; gap:8px; margin:12px 0; }
.report-posted-photos .report-photo { padding:0; border:0; background:transparent; }
.report-posted-photos .report-photo a { display:block; }
.report-posted-photos .report-photo img { display:block; width:100%; height:auto; aspect-ratio:4 / 3; object-fit:contain; background:var(--paper,#f1f4ef); }

/* Keep attachment records in the same reading order and rhythm as hazard cards. */
.report-structure { background:var(--paper,#f1f4ef); border-left:4px solid var(--teal,#087b78); }
.report-structure-location { display:grid; justify-items:start; gap:8px; margin-bottom:18px; }
.report-structure-location p { margin:0; }
.report-structure-facts { border-top:1px solid var(--line); margin-top:20px; padding-top:16px; }
.report-structure-facts h5 { margin:0 0 12px; font-size:14px; }
.report-structure-photos { margin-top:20px; }
.report-structure .report-photo-grid { grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:10px; }
.report-structure .report-photo-choice { padding:8px; }
.report-structure .report-photo-choice img,
.report-structure .report-photo img { display:block; width:100%; height:auto; aspect-ratio:4 / 3; object-fit:contain; background:var(--panel); }
.report-structure-saved-photos .report-photo { padding:0; min-width:0; }

/* Keep the library controls visible while only the photo grid scrolls. */
.collection-library-dialog { box-sizing:border-box; padding:0; overflow:hidden; max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); }
.collection-library-dialog[open] { display:flex; flex-direction:column; }
.collection-library-dialog header { position:static; flex:none; padding:14px 16px; border-bottom:1px solid var(--line); }
.collection-library-dialog header > div { min-width:0; }
.collection-library-dialog h2 { margin:0 0 4px; font-size:17px; line-height:1.4; }
.collection-library-dialog [data-library-close] { flex:none; min-height:44px; padding:8px 14px; white-space:nowrap; }
.library-photo-count, .library-photo-hint { font-size:12px; line-height:1.6; color:var(--muted); }
.library-photo-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:12px 16px 16px; }
.library-photo-hint { margin:0 0 12px; }
.library-photo-status:empty { display:none; }
.collection-library-dialog .report-photo-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.collection-library-dialog .collection-photo { display:flex; flex-direction:column; padding:8px; }
.collection-library-dialog .collection-photo > a { display:block; }
.collection-library-dialog .collection-photo img { display:block; width:100%; height:auto; aspect-ratio:4 / 3; object-fit:contain; background:var(--panel); }
.collection-library-dialog .collection-photo figcaption { font-size:12px; line-height:1.5; margin:8px 0; }
.collection-library-dialog .collection-photo figcaption p { margin:4px 0 0; }
.collection-library-dialog .library-delete-photo { width:100%; margin-top:auto; padding:8px; font-size:12px; }
@media(max-width:600px) {
  .collection-library-dialog { width:calc(100% - 16px); border-radius:14px; }
  .collection-library-dialog header { padding:12px; }
  .library-photo-body { padding:10px 12px max(12px,env(safe-area-inset-bottom)); }
  .collection-library-dialog .report-photo-grid { gap:10px; }
  .collection-library-dialog .collection-photo { padding:6px; }
}

.report-photo-choice-preview { display:block; position:relative; min-width:0; border-radius:5px; overflow:hidden; }
.report-photo-choice-preview img { display:block; }
.report-photo-choice-preview > span { position:absolute; right:4px; bottom:4px; padding:2px 5px; border-radius:4px; background:rgb(8 30 29 / 65%); color:#fff; font-size:11px; line-height:1.5; pointer-events:none; }
.report-photo-choice-select { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-height:44px; cursor:pointer; font-size:12px; line-height:1.5; }
.report-photo-choice-select input[type=checkbox] { flex:none; }
.report-photo-choice-select > span { flex:1; min-width:0; overflow-wrap:anywhere; }
.report-photo-choice-select > small { flex-basis:100%; }

.monthly-report-panel { margin:16px 0; }
.monthly-report-panel .field { margin:16px 0; }
#monthly-links a { overflow-wrap:anywhere; white-space:normal; }
.monthly-report-panel .required { color:var(--red); }
@media(max-width:680px) {
  body.worker-app #month-filter { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.worker-app #month-filter .field { grid-column:1 / -1; min-width:0; }
  body.worker-app #month-filter > .button { width:100%; min-width:0; }
}

.report-problem h4 { overflow-wrap:anywhere; }

body.patrol-app p.report-photo-timeliness { color:#b42318; font-size:13px; font-weight:700; line-height:1.6; overflow-wrap:anywhere; white-space:normal; margin:8px 0; }
body.patrol-app .report-photo-card > .report-photo-timeliness { margin:0; }
.patrol-photo-viewer footer > .report-photo-timeliness { grid-column:1 / -1; }
/* Each check names the same photo number as the report's photo library. */
.patrol-photo-issue { display:grid; grid-template-columns:96px minmax(0,1fr); gap:14px; padding:14px; margin:12px 0; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
.patrol-photo-issue > a { display:block; align-self:start; }
.patrol-evidence-summary .patrol-photo-issue img { display:block; width:96px; height:72px; object-fit:contain; background:#e9ede7; border-radius:4px; }
.patrol-photo-issue strong { display:block; overflow-wrap:anywhere; }
.patrol-photo-issue ul { margin:6px 0; padding-left:20px; overflow-wrap:anywhere; }
@media(max-width:600px) { .patrol-photo-issue { grid-template-columns:72px minmax(0,1fr); gap:10px; padding:12px; } .patrol-evidence-summary .patrol-photo-issue img { width:72px; height:60px; } }

/* Submitted documents lead; live records and editing stay separate. */
:root body[data-system-ui] .monthly-documents { margin-bottom:20px; }
:root body[data-system-ui] .monthly-section-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
:root body[data-system-ui] .monthly-section-heading h3 { margin:0; color:var(--sys-heading); font-size:20px; font-weight:650; }
:root body[data-system-ui] .monthly-section-heading p { margin:4px 0 0; color:var(--sys-muted); font-size:13px; }
:root body[data-system-ui] .monthly-section-heading .button { min-height:44px; flex:none; }
:root body[data-system-ui] .monthly-documents #monthly-links { display:grid; gap:12px; margin:0; }
:root body[data-system-ui] .monthly-company-report { min-width:0; border:1px solid var(--sys-border); border-radius:10px; background:var(--sys-surface); overflow:hidden; }
:root body[data-system-ui] .monthly-documents .business-monthly-version { display:flex; align-items:center; gap:14px; min-width:0; padding:16px 20px; border:0; border-radius:0; background:transparent; text-decoration:none; }
:root body[data-system-ui] .monthly-documents .business-monthly-version:hover { background:var(--sys-subtle); }
:root body[data-system-ui] .monthly-documents .monthly-latest strong { font-size:16px; color:var(--sys-heading); }
:root body[data-system-ui] .monthly-documents .business-monthly-version small { font-size:12px; line-height:1.7; }
:root body[data-system-ui] .monthly-version-note { margin:0; padding:0 20px 16px; color:var(--sys-muted); font-size:13px; overflow-wrap:anywhere; }
:root body[data-system-ui] :is(.monthly-version-history,.monthly-legacy) { border-top:1px solid var(--sys-border); }
:root body[data-system-ui] :is(.monthly-version-history,.monthly-legacy) > summary { min-height:44px; padding:12px 20px; cursor:pointer; color:var(--sys-muted); font-size:13px; }
:root body[data-system-ui] .monthly-version-history .business-monthly-version { border-top:1px solid var(--sys-border); }
:root body[data-system-ui] .monthly-no-report { padding:20px; border:1px dashed var(--sys-border); border-radius:8px; }
:root body[data-system-ui] .monthly-no-report p { margin:0; color:var(--sys-muted); font-size:14px; line-height:1.7; }
:root body[data-system-ui] .monthly-message { margin:12px 0 0; color:var(--sys-primary); font-size:14px; line-height:1.7; }
:root body[data-system-ui] .monthly-message:empty { display:none; }
:root body[data-system-ui] .monthly-message.is-error { color:var(--sys-danger); }
:root body[data-system-ui] .monthly-disclosure { border-top:1px solid var(--sys-border); scroll-margin-top:16px; }
:root body[data-system-ui] .monthly-disclosure > summary { min-height:64px; padding:16px 4px; cursor:pointer; list-style-position:inside; color:var(--sys-heading); }
:root body[data-system-ui] .monthly-disclosure > summary > span { font-size:15px; font-weight:600; }
:root body[data-system-ui] .monthly-disclosure > summary > small { display:block; margin:4px 0 0 18px; color:var(--sys-muted); font-size:12px; line-height:1.6; }
:root body[data-system-ui] :is(.monthly-disclosure-body,.monthly-compose > .monthly-report-panel) { margin:0; padding:0 0 20px; }
:root body[data-system-ui] .monthly-compose > .monthly-report-panel { max-width:900px; }
:root body[data-system-ui] .monthly-compose .monthly-report-panel > p { margin:0 0 16px; color:var(--sys-muted); font-size:14px; line-height:1.7; }
:root body[data-system-ui] .monthly-compose .field { margin-block:16px; }
:root body[data-system-ui] .monthly-compose .button { min-height:44px; }
:root body[data-system-ui] .monthly-live .business-monthly-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media(max-width:900px) {
  :root body[data-system-ui] .monthly-live .business-monthly-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:600px) {
  :root body[data-system-ui] .monthly-documents .business-monthly-version { padding:16px; gap:10px; }
  :root body[data-system-ui] .monthly-documents .business-monthly-version > .business-record-icon { display:none; }
  :root body[data-system-ui] .monthly-documents .business-monthly-version > .business-text-link { max-width:72px; flex:none; }
  :root body[data-system-ui] .monthly-version-note { padding-inline:16px; }
}
@media(max-width:360px) {
  :root body[data-system-ui] .monthly-live .business-monthly-stats { grid-template-columns:minmax(0,1fr); }
}

/* Quick checks and compact records share the report's existing forest palette. */
.report-quick-choice { position:relative; min-width:0; }
.report-quick-choice > span { font-weight:650; }
.report-quick-choice .report-choice-value { position:absolute; width:1px; height:1px; min-height:0; margin:0; padding:0; border:0; overflow:hidden; clip-path:inset(50%); }
.report-choice-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
:root body[data-system-ui] .report-choice-buttons > .button { min-height:48px; background:var(--panel,#fff); border:1px solid var(--line); color:var(--ink); font-size:16px; font-weight:650; }
:root body[data-system-ui] .report-choice-buttons > .button:hover { background:var(--paper); border-color:var(--teal); }
:root body[data-system-ui] .report-choice-buttons > .button[aria-pressed=true] { background:var(--teal-dark,#16483b); border-color:var(--teal-dark,#16483b); color:#fff; box-shadow:inset 0 0 0 1px #ffffff25; }
:root body[data-system-ui] .report-choice-buttons > .button[data-choice-value=yes][aria-pressed=true] { background:#875816; border-color:#875816; color:#fff; }
.report-choice-buttons > .button[aria-pressed=true]::before { content:'✓'; margin-right:8px; }
.report-record-editor { min-width:0; }
.report-record-summary { display:flex; align-items:center; gap:10px; min-height:56px; padding:12px 0; cursor:pointer; list-style:none; }
.report-record-summary::-webkit-details-marker { display:none; }
.report-record-summary:hover { color:var(--teal-dark); }
.report-record-summary:focus-visible { outline:2px solid var(--teal); outline-offset:4px; border-radius:4px; }
.report-record-editor[open] > .report-record-summary { border-bottom:1px solid var(--line); margin-bottom:18px; }
:is(.report-problem,.report-structure):has(> .report-record-actions) { position:relative; padding:12px; }
.report-record-actions { position:absolute; inset-block-start:12px; inset-inline-end:12px; }
.report-record-actions > .button { width:64px; min-height:44px; margin:0; }
.report-record-editor > .report-record-summary { min-height:44px; margin-inline-end:76px; flex-wrap:nowrap; }
.report-record-editor > .report-record-summary::before {
  content:''; flex:none; width:7px; height:7px; border:solid currentColor; border-width:0 2px 2px 0; transform:rotate(-45deg);
}
.report-record-editor[open] > .report-record-summary::before { transform:rotate(45deg); }
.report-record-name { min-width:0; overflow-wrap:anywhere; }
.report-record-fields { min-width:0; }
.report-record-fields > [data-publish-problem]:not([hidden]) { display:flex; margin-top:16px; }
.report-record-fields > label:not(.field) { display:flex; align-items:center; gap:8px; margin-block:16px; }
.report-record-fields > [data-use-source-photos],.report-record-fields > [data-reuse-problem-photos] { margin-block:16px; white-space:normal; }
.report-record-done { margin-top:16px; min-height:44px; }
@media(min-width:1100px) {
  .report-form #report-fields { grid-template-areas:'overview overview' 'safety map' 'attachments map' 'points map' 'actions actions'; }
  .report-form #report-fields:not(:has(.report-points)) { grid-template-areas:'overview overview' 'safety map' 'attachments map' 'actions actions'; }
}
.report-photo-overview > details { grid-column:1/-1; grid-row:auto; }
.report-overview > .report-basic-edit { margin:0; padding:0; border:0; background:transparent; }
.report-basic-edit > summary { min-height:44px; padding:10px 0; }
.report-basic-edit > summary span { margin-left:12px; color:var(--muted); font-size:13px; font-weight:400; }
:root body[data-system-ui] .is-report-view .report-heading h2 { font-size:clamp(24px,3vw,30px); font-weight:750; line-height:1.3; }
:root body[data-system-ui] .is-report-view .report-section-title {
  margin:0 0 12px; padding-inline-start:10px; border-inline-start:3px solid var(--sys-primary);
  color:var(--sys-heading); font-size:20px; font-weight:750; line-height:1.35;
}
:root body[data-system-ui] .is-report-view :is(.report-section-header,.report-photo-overview) .report-section-title { margin:0; }
.report-section-header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; margin-bottom:12px; }
.report-section-header .report-section-title { min-width:0; }
.report-section-header .report-section-progress {
  margin:0; padding:3px 8px; border:1px solid var(--sys-status-warning-border); border-radius:6px;
  background:var(--sys-status-warning-background); color:var(--sys-status-warning-foreground);
  font-size:12px; font-weight:650; line-height:1.5;
}
.report-section-header .report-section-progress[data-complete=true] {
  border-color:var(--sys-status-success-border); background:var(--sys-status-success-background); color:var(--sys-status-success-foreground);
}
.report-section-header .report-section-progress:empty { display:none; }
.is-report-view .report-map-panel > details > summary { font-size:15px; font-weight:650; }
.is-report-view :is(.report-problem,.report-structure) > header > h4 { color:var(--muted); font-size:13px; font-weight:650; }
.report-land-hazards > p { margin:0 0 16px; }
.report-sync-notice { margin-bottom:16px; line-height:1.65; }
.report-sync-notice p { margin:0 0 12px; }
.report-sync-notice .patrol-actions { flex-wrap:wrap; gap:10px; }
.report-sync-notice .button { min-height:44px; }
/* A submitted report is read as a document, with selectable text and no inputs. */
.report-reading-field { min-width:0; margin:0; padding:12px 0; border-bottom:1px solid var(--sys-border); }
.report-reading-field dt { color:var(--sys-muted); font-size:13px; line-height:1.6; }
.report-reading-field dd { margin:6px 0 0; color:var(--sys-heading); font-size:16px; line-height:1.8; overflow-wrap:anywhere; white-space:pre-wrap; }
.report-reading-field dd.is-empty { color:var(--sys-muted); font-size:14px; }
.report-reading .report-structure { margin-top:24px; padding:0 0 24px; border:0; border-bottom:1px solid var(--sys-border); border-radius:0; }
.report-reading .report-structure-facts { padding:0; border:0; background:transparent; }
.report-reading .report-reading-content > section { min-width:0; }
.report-photo-reading-caption { color:var(--sys-muted); font-size:13px; line-height:1.7; }
@media(min-width:1100px) {
  .report-reading #report-fields { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); grid-template-areas:"overview overview" "safety map" "attachments map" "points map"; }
  .report-reading .report-safety { grid-area:safety; }
}
.monthly-work { margin-top:20px; padding:16px; border:1px solid var(--sys-border); border-radius:10px; background:var(--sys-surface); }
.monthly-work[hidden] { display:none; }
.monthly-work progress { display:block; width:100%; height:8px; margin:12px 0 16px; accent-color:var(--sys-primary); }
.monthly-work.is-error { border-color:var(--sys-danger); }
.monthly-work.is-error > p { color:var(--sys-danger); }
.report-heading h2[tabindex="-1"]:focus { outline:none; }
:root body[data-system-ui] .report-reading .report-extra { padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }

.monthly-draft-conflicts { margin:16px 0; padding:16px; border:1px solid var(--sys-warning); border-radius:10px; background:var(--sys-surface); min-width:0; }
.monthly-draft-conflicts[hidden] { display:none; }
.monthly-draft-conflicts > p { margin:0 0 12px; line-height:1.7; }
.monthly-draft-text { margin:12px 0; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }
.monthly-draft-conflicts .patrol-actions { flex-wrap:wrap; }

body[data-system-ui] .monthly-overview { margin-bottom:var(--sys-page-gap); }
body[data-system-ui] .monthly-overview .monthly-section-heading { flex-wrap:wrap; gap:4px 16px; }
body[data-system-ui] .monthly-company-back { display:inline-flex; align-items:center; min-height:44px; }
body[data-system-ui] .monthly-company-overview { margin-top:12px; }
body[data-system-ui] .monthly-company-rows { list-style:none; margin:0; padding:0; border-bottom:1px solid var(--sys-border); }
body[data-system-ui] .monthly-company-row {
  display:grid; grid-template-columns:minmax(128px,1fr) minmax(0,4fr); align-items:center;
  gap:4px 14px; padding:4px 10px; border-top:1px solid var(--sys-border);
}
body[data-system-ui] .monthly-company-row h4 { margin:0; font-size:14px; }
body[data-system-ui] .monthly-company-row h4 a,
body[data-system-ui] .monthly-company-metrics > * {
  display:flex; gap:4px; align-items:center; min-height:44px; overflow-wrap:anywhere;
}
body[data-system-ui] .monthly-company-row a { color:var(--sys-primary); text-underline-offset:3px; }
body[data-system-ui] .monthly-company-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0 10px; font-size:13px; }
body[data-system-ui] .monthly-company-metrics [data-monthly-company-metric=verification] { color:var(--sys-status-warning-foreground); }
body[data-system-ui] .monthly-company-metrics .monthly-company-zero { color:var(--sys-muted); }
body[data-system-ui] .monthly-company-metrics strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
@media(max-width:1000px) {
  body[data-system-ui] .monthly-company-row { grid-template-columns:minmax(0,1fr); gap:0; }
  body[data-system-ui] .monthly-company-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
body[data-system-ui] .monthly-scope { display:flex; flex-wrap:wrap; column-gap:16px; row-gap:2px; overflow-wrap:anywhere; }
body[data-system-ui] .monthly-metrics {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  border:1px solid var(--sys-border); border-radius:var(--sys-radius-panel); background:var(--sys-surface);
}
body[data-system-ui] .monthly-metric { min-width:0; padding:4px 14px; }
body[data-system-ui] .monthly-metric + .monthly-metric { border-inline-start:1px solid var(--sys-border); }
body[data-system-ui] .monthly-metric a {
  display:flex; min-height:44px; align-items:center; justify-content:space-between; gap:4px 12px; flex-wrap:wrap;
  color:var(--sys-primary); text-underline-offset:3px; overflow-wrap:anywhere;
}
body[data-system-ui] .monthly-metric a strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
body[data-system-ui] .monthly-metric .monthly-metric__subset { justify-content:flex-start; font-size:.875rem; }
body[data-system-ui] .monthly-scope-note { margin:8px 0 0; color:var(--sys-muted); font-size:.875rem; }
@media(max-width:600px) {
  body[data-system-ui] .monthly-metrics { grid-template-columns:minmax(0,1fr); }
  body[data-system-ui] .monthly-metric + .monthly-metric { border-inline-start:0; border-top:1px solid var(--sys-border); }
}

.report-submit-feedback .report-progress-trigger {
  padding:0; min-height:32px; border:0; background:transparent; text-align:left;
  color:var(--sys-status-warning-foreground,#835411); font-size:13px; font-weight:700;
  text-decoration:underline; text-underline-offset:3px; cursor:pointer;
}

@media screen {
  :root body[data-system-ui] #patrol-main .report-jump {
    gap: 10px;
    padding: 4px 8px;
    border-color: var(--sys-selected-border);
    border-radius: var(--sys-radius-panel);
    background: var(--sys-accent-soft);
    box-shadow: 0 2px 8px rgb(28 28 30 / 8%);
  }

  :root body[data-system-ui] #patrol-main .report-jump-label {
    padding: 0 8px;
    border: 0;
    color: var(--sys-primary-pressed);
    font-size: 14px;
    font-weight: 750;
  }

  :root body[data-system-ui] #patrol-main .report-jump-track {
    flex: 1;
    max-width: none;
    gap: 6px;
  }

  :root body[data-system-ui] #patrol-main .report-jump button[data-report-jump] {
    min-height: 44px;
    padding: 6px;
    border: 1px solid var(--sys-input-border);
    border-radius: var(--sys-radius-control);
    background: var(--sys-surface);
    color: var(--sys-primary-pressed);
    font-weight: 650;

    &:is(:hover, :active) {
      border-color: var(--sys-primary);
      background: var(--sys-selected);
    }

    &:focus-visible {
      outline: 2px solid var(--sys-focus);
      outline-offset: -3px;
    }

    &[aria-current=location] {
      border-color: var(--sys-primary);
      background: var(--sys-primary);
      color: var(--sys-primary-foreground);
    }

    &[aria-current=location]:is(:hover, :active) {
      background: var(--sys-primary-hover);
    }

    &[aria-current=location]:focus-visible {
      outline-color: var(--sys-primary-foreground);
    }

    &[aria-current=location]::after {
      content: none;
    }
  }

  @media (max-width: 600px) {
    :root body[data-system-ui] #patrol-main .report-jump,
    :root body[data-system-ui] #patrol-main .report-jump-track {
      gap: 4px;
    }

    :root body[data-system-ui] #patrol-main .report-jump-label {
      padding-inline: 4px;
      font-size: 12px;
    }

    :root body[data-system-ui] #patrol-main .report-jump-label-full {
      display: inline;
    }

    :root body[data-system-ui] #patrol-main .report-jump button[data-report-jump] {
      padding-inline: 2px;
    }
  }

  :root body[data-system-ui] .report-photo-guidance {
    border: 1px solid var(--sys-input-border);
    border-radius: var(--sys-radius-control);
    background: var(--sys-accent-soft);
  }

  :root body[data-system-ui] .report-photo-guidance[open] {
    border-color: var(--sys-primary);
    background: var(--sys-selected);
  }

  :root body[data-system-ui] .report-photo-guidance > .report-photo-guidance-copy {
    padding: 10px;
    border-top: 1px solid var(--sys-selected-border);
    color: var(--sys-foreground);
    font-size: 13px;
    line-height: 1.65;
  }

  :root body[data-system-ui] .report-photo-guidance-copy p:first-child {
    margin-top: 0;
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit] :is(
    .report-back-link, .report-progress-trigger,
    details:not(.report-photo-guidance) > summary, .report-choice-buttons > button
  ):where(:not(:disabled, [aria-disabled=true])) {
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--sys-input-border);
    border-radius: var(--sys-radius-control);
    background: var(--sys-accent-soft);
    color: var(--sys-primary-pressed);
    box-shadow: none;

    &:is(:hover, :focus-visible) {
      border-color: var(--sys-primary);
      background: var(--sys-selected-hover);
    }

    &:active {
      background: var(--sys-selected-pressed);
    }
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit] :is(
    .report-choice-buttons > button[aria-pressed=true],
    details[open]:not(.report-photo-guidance) > summary, button[data-structure-unchanged][aria-pressed=true]
  ) {
    border-color: var(--sys-primary);
    background: var(--sys-selected);
    color: var(--sys-primary-pressed);
    font-weight: 650;
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit]
    .report-choice-buttons > button[data-choice-value=yes][aria-pressed=true] {
    border-color: var(--sys-status-warning-foreground);
    background: var(--sys-status-warning-background);
    color: var(--sys-status-warning-foreground);
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit] .report-record-summary {
    padding: 10px;
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit] .report-progress-trigger {
    flex: 0 1 auto;
    justify-self: start;
    width: auto;
    max-width: 100%;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit] :is(
    .report-form .field :is(input:not([type=checkbox], [type=radio], [type=hidden]), select, textarea),
    .report-photo-choice:has(input[type=checkbox]:enabled)
  ):not(:disabled, [readonly], [aria-invalid=true]) {
    border-color: var(--sys-input-border);
    background: var(--sys-surface);
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit]
    .report-photo-choice:has(input[type=checkbox]:enabled:checked) {
    border-color: var(--sys-primary);
    background: var(--sys-selected);
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit] :is(
    summary:focus-visible, .report-photo-choice:has(input:focus-visible)
  ) {
    outline: 2px solid var(--sys-focus);
    outline-offset: 2px;
  }

  :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit]
    :is(.report-photo-choice, .report-form) input:is([type=checkbox], [type=radio]) {
    accent-color: var(--sys-primary);
  }

  :root body[data-system-ui] #patrol-main[data-view] .report-photo-overview
    > .report-photo-guidance > summary {
    display: list-item;
    list-style-position: inside;
    align-content: center;
    min-height: 44px;
    padding: 6px 10px;
    color: var(--sys-primary-pressed);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
    cursor: pointer;
  }

  :root[data-worker-palette] body[data-system-ui] :is(.report-evidence-dialog, .collection-library-dialog)
    :is(.button:not(.button--primary, .button--accent, .button--danger), #report-check-items button):enabled {
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--sys-input-border);
    border-radius: var(--sys-radius-control);
    background: var(--sys-accent-soft);
    color: var(--sys-primary-pressed);

    &:is(:hover, :focus-visible) {
      border-color: var(--sys-primary);
      background: var(--sys-selected-hover);
    }
  }

  @media (max-width: 600px) {
    :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit]
      #report-fields > .report-submit-bar {
      flex-wrap: wrap;
      gap: 6px;
    }

    :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit]
      .report-submit-feedback {
      display: flex;
      flex: 1 1 100%;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px 8px;
    }

    :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit]
      .report-submit-actions {
      flex: 1 1 100%;
    }

    :root[data-worker-palette] body[data-system-ui] #patrol-main[data-view=report-edit]
      .report-submit-actions > .button {
      flex: 1;
    }
  }
}
