/* Screen styles: site workbench (S-16). imported by assets/app.js.
   Layout: header, section nav, .sv-workbench grid (main 2fr / aside 1fr from 64em; one column with
   the ui.md S-16 mobile order below). */

.sv-site-header { display: flex; flex-direction: column; gap: var(--sv-space-3); margin-block-end: var(--sv-space-4); }
.sv-site-header .sv-page-header { margin-block-end: 0; }
.sv-site-header__line { flex-basis: 100%; color: var(--sv-color-text-muted); font-size: var(--sv-text-sm); }

.sv-section-nav {
  position: sticky;
  z-index: var(--sv-z-sticky);
  inset-block-start: var(--sv-topbar-height);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sv-space-2);
  margin-block-end: var(--sv-space-4);
  padding-block: var(--sv-space-2);
  background: var(--sv-color-bg, var(--sv-color-surface));
}
.sv-section-nav .sv-chip { text-decoration: none; }
.sv-section-nav .sv-chip[aria-current] { border-color: var(--sv-color-primary); background: var(--sv-color-primary-subtle); color: var(--sv-color-primary); }

.sv-workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sv-space-4); align-items: start; }
.sv-workbench__main,
.sv-workbench__aside { display: flex; flex-direction: column; gap: var(--sv-space-4); min-width: 0; }
@media (min-width: 64em) {
  .sv-workbench { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .sv-workbench__aside { position: sticky; inset-block-start: calc(var(--sv-topbar-height) + 3.5rem); }
  .sv-section-nav { position: static; }
}
@media (max-width: 63.99em) {
  /* ui.md S-16 mobile order: progress and review right after the header. */
  .sv-workbench__aside { order: -1; }
}

/* Site data card. */
.sv-site-data__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--sv-space-3) var(--sv-space-4); }
.sv-site-data__wide { grid-column: 1 / -1; }
.sv-site-geometry { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sv-space-4); margin-block-start: var(--sv-space-4); }
.sv-site-geometry__fields { display: flex; flex-direction: column; gap: var(--sv-space-3); min-width: 0; }
@media (min-width: 48em) {
  .sv-site-geometry { grid-template-columns: minmax(0, 3fr) minmax(14rem, 2fr); }
  .sv-site-geometry__map { order: -1; }
}
.sv-input-suffix { color: var(--sv-color-text-muted); font-size: var(--sv-text-sm); white-space: nowrap; }
.sv-input--num { font-variant-numeric: tabular-nums; }

/* Progress and review. */
.sv-progress-panel .sv-checklist + .sv-checklist,
.sv-progress-panel [data-testid] + [data-testid] .sv-checklist { margin-block-start: 0; }
.sv-progress-panel:focus-visible { box-shadow: var(--sv-focus-ring); }
.sv-review__meta { margin: 0 0 var(--sv-space-2); color: var(--sv-color-text-muted); font-size: var(--sv-text-sm); }
.sv-review__items { display: flex; flex-direction: column; gap: var(--sv-space-2); margin: 0; padding: 0; list-style: none; }
.sv-review__item { display: flex; flex-direction: column; gap: var(--sv-space-1); }
.sv-review__item .sv-choice { display: flex; align-items: center; gap: var(--sv-space-2); }
.sv-review__tick { padding-inline-start: 1.75rem; color: var(--sv-color-text-muted); }

/* Attachments. */
.sv-attachments { display: flex; flex-direction: column; gap: var(--sv-space-3); }
.sv-attachments__upload { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sv-space-1); }
.sv-attachments__pick { cursor: pointer; }
.sv-attachments__upload input[type="file"]:focus-visible + .sv-field__hint,
.sv-attachments__upload:focus-within .sv-attachments__pick { box-shadow: var(--sv-focus-ring); }
.sv-attachments__status { min-height: 1.25rem; margin: 0; font-size: var(--sv-text-sm); color: var(--sv-color-text-muted); }
.sv-attachments__status.is-error { color: var(--sv-error-fg); }
.sv-attachments__errors { margin: 0; padding-inline-start: var(--sv-space-6); }

/* Section headers with actions (inspections, samples). */
.sv-inspections > .sv-card__header,
.sv-samples > .sv-card__header { flex-wrap: wrap; gap: var(--sv-space-2); }
.sv-samples .sv-card__actions { display: flex; flex-wrap: wrap; gap: var(--sv-space-2); margin-inline-start: auto; }

/* Inspections (Site:InspectionList / Site:InspectionRow): one card per inspection. */
.sv-insp-list,
.sv-trap-list,
.sv-sample-list { display: flex; flex-direction: column; gap: var(--sv-space-3); }
.sv-insp,
.sv-trap,
.sv-sample {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-3);
  padding: var(--sv-space-3) var(--sv-space-4);
  border: 1px solid var(--sv-color-border);
  border-radius: var(--sv-radius-md);
  background: var(--sv-color-surface);
}
.sv-insp--co-examined { background: var(--sv-color-surface-muted); }
.sv-insp__head,
.sv-trap__head,
.sv-sample__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sv-space-2) var(--sv-space-3); }
.sv-insp__organism,
.sv-trap__title,
.sv-sample__number { margin: 0; font-size: var(--sv-text-md); font-weight: var(--sv-weight-semibold); }
.sv-sample__number { font-family: var(--sv-font-mono, monospace); }
.sv-insp__organism .sv-tag { margin-inline-start: var(--sv-space-1); vertical-align: middle; }
.sv-insp__result { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sv-space-1) var(--sv-space-2); margin-inline-start: auto; }
.sv-insp__source,
.sv-sample__sent { color: var(--sv-color-text-muted); font-size: var(--sv-text-sm); }
.sv-insp__override summary { cursor: pointer; font-size: var(--sv-text-sm); }
.sv-insp__override p { margin: var(--sv-space-1) 0 0; font-size: var(--sv-text-sm); }
.sv-insp__fields,
.sv-trap__fields,
.sv-sample__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--sv-space-3) var(--sv-space-4); }
.sv-insp__value { display: block; min-height: var(--sv-control-height-sm, 2rem); padding-block: var(--sv-space-1); }
.sv-insp__observe { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sv-space-2); }
.sv-insp__observe .sv-inline__lock,
.sv-insp__observe .sv-inline__error { flex-basis: 100%; }
.sv-insp__files summary { cursor: pointer; color: var(--sv-color-text-muted); font-size: var(--sv-text-sm); }
.sv-insp__files[open] summary { margin-block-end: var(--sv-space-2); }
.sv-insp__files .sv-icon,
.sv-sample__files-title .sv-icon { margin-inline-end: var(--sv-space-1); }

/* Traps (Site:TrapCard): checks newest first, the new-check row in the table footer. The table
   scrolls sideways in its sv-table-wrap--scroll wrapper when the card is narrower (phones). */
.sv-trap__checks thead th { padding-inline: var(--sv-space-3); }
.sv-trap__checks td { vertical-align: top; }
.sv-trap__checks .sv-input { min-width: 7rem; }
.sv-trap__checks .sv-input--num { width: 5rem; min-width: 0; }
/* The compact inline controls of tables (inline-edit.css) get no 7rem minimum here: the catch
   input and the checkbox stay narrow, so the table fits the card on desktop. */
.sv-trap__checks .sv-inline :is(.sv-input--num, input[type="checkbox"]) { min-width: 0; }
.sv-trap__new td { padding-block-start: var(--sv-space-2); border-block-start: 1px dashed var(--sv-color-border); }

/* Samples (Site:SampleCard). */
.sv-sample--draft { border-inline-start: 3px solid var(--sv-color-primary); }
.sv-sample__wide,
.sv-sample__coords { grid-column: 1 / -1; }
.sv-sample__analyses { display: flex; flex-direction: column; gap: var(--sv-space-1); margin: 0; padding: 0; list-style: none; font-size: var(--sv-text-sm); }
.sv-sample__analysis { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sv-space-1) var(--sv-space-2); }
.sv-sample__lab-state { color: var(--sv-color-text-muted); }
.sv-sample__readiness { display: flex; align-items: center; gap: var(--sv-space-1); margin: 0; font-size: var(--sv-text-sm); color: var(--sv-warning-fg, var(--sv-color-text-muted)); }
.sv-sample__readiness.is-ready { color: var(--sv-success-fg, var(--sv-color-text)); }
.sv-sample__files-title { margin: 0 0 var(--sv-space-2); font-size: var(--sv-text-sm); font-weight: var(--sv-weight-semibold); }
.sv-sample__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sv-space-2); }
.sv-sample__actions .sv-dropdown { margin-inline-start: auto; }

/* Live dialogs (forms inside the Dialog component). */
.sv-live-dialog { display: flex; flex-direction: column; gap: var(--sv-space-3); }
.sv-live-dialog__subject { margin: 0; color: var(--sv-color-text-muted); }
.sv-dialog-form { display: flex; flex-direction: column; gap: var(--sv-space-4); }
.sv-dialog-form__fields { display: flex; flex-direction: column; gap: var(--sv-space-3); }
.sv-dialog-form__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sv-space-2); }
.sv-site-search .sv-options { display: flex; flex-direction: column; gap: var(--sv-space-1); max-height: 14rem; overflow-y: auto; }
.sv-map-pick { display: flex; flex-direction: column; gap: var(--sv-space-3); }
.sv-map-pick .sv-map-panel { min-height: 20rem; }

/* Review actions (FA/TA). */
.sv-review__actions { display: flex; flex-wrap: wrap; gap: var(--sv-space-2); }
