/* PPE item row: name, serial, expiry (+ optional clear button). Used to be
   an ad-hoc flex row with two 130px-fixed inputs racing a flex:1 label for
   space - on a narrow phone the fixed inputs never yield, so the label
   shrank past readable and the row wrapped wherever it happened to break,
   different every time depending on the name's length. A named grid with
   an explicit narrow-screen stack fixes both: predictable widths at every
   size, and the name gets its own full-width line below ~480px instead of
   fighting the inputs for room. */
.ppe-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 140px;
  gap: 6px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.ppe-item-name {
  min-width: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-main);
}
.ppe-item-serial,
.ppe-item-expiry {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: var(--fs-sm);
}
.ppe-item-expiry-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.ppe-item-clear {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  padding: 0;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1;
}
@media (max-width: 480px) {
  .ppe-item-row {
    grid-template-columns: 1fr 1fr;
  }
  .ppe-item-name {
    grid-column: 1 / -1;
  }
}
.part-used-row .part-description {
  position: relative;
}
.part-suggest-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-dark);
  border: 1px solid var(--primary);
  border-radius: var(--radius-xs);
  margin-top: 4px;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}
.part-suggest-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
button.part-suggest-item {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.part-suggest-item:last-child {
  border-bottom: none;
}
.part-suggest-item:active,
.part-suggest-item:hover,
.part-suggest-item:focus-visible {
  background: #334155;
}
.part-suggest-item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}
.part-suggest-pn {
  font-weight: 800;
  color: var(--primary);
  font-size: var(--fs-xs);
}
.part-suggest-desc {
  font-size: var(--fs-xs);
  color: var(--text-main);
  margin-top: 1px;
}
.part-suggest-model {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.asset-manuals:empty {
  display: none;
}
.asset-manuals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.asset-manuals .btn-manual-link {
  flex: 1 1 140px;
  padding: 10px;
}
.manual-link-models {
  max-height: 40vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
}
.manual-link-models label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-transform: none;
  font-weight: 600;
}
.manual-link-models .suggested {
  font-size: var(--fs-2xs);
  color: var(--warning);
  text-transform: uppercase;
}
.part-suggest-head {
  padding: 6px 12px;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.dar-asset-note {
  margin: 6px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.part-suggest-empty {
  padding: 10px 12px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
}
@media (max-width: 600px) {
  .part-used-row {
    grid-template-columns: 1fr 1fr 62px 42px;
  }
  .part-used-row .part-description {
    grid-column: 1 / -1;
  }
}
.section-title {
  font-size: var(--fs-md);
  color: var(--primary);
  text-transform: uppercase;
  margin: 20px 0 12px 0;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-wrap: balance;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid-2 > *,
.grid-3 > *,
.view-grid > * {
  min-width: 0;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.form-group {
  margin-bottom: 14px;
}
label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  line-height: 1.3;
}
input,
select,
textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  padding: 14px;
  border-radius: var(--radius-xs);
  font-size: 16px;
  outline: none;
  min-height: 48px;
  line-height: 1.3;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1.2 1.3l4.8 4.8 4.8-4.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}
textarea {
  min-height: 96px;
  resize: none;
}
.expand-panel {
  display: none;
  background: #111827;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.expand-panel.fault-border {
  border-left: 4px solid var(--danger);
}
.expand-panel.service-border {
  border-left: 4px solid var(--success);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
/* A pill carrying the tech's own words (a fault's custom "other
   reason") wraps instead of clipping: the note is free text and must
   stay fully readable at phone width (hardening phase 2, P2-1). */
.status-pill-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}
.status-pill.status-ok {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
}
.status-pill.status-due {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}
.status-pill.status-overdue {
  background: rgba(248, 113, 113, 0.14);
  color: var(--danger);
}
.status-pill.status-unknown {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}
.service-due-banner {
  display: none;
  padding: 12px;
  border-radius: var(--radius-xs);
  margin-bottom: 14px;
  font-size: var(--fs-sm);
  font-weight: 700;
  align-items: center;
  gap: 8px;
}
.service-due-banner.status-ok {
  display: flex;
  background: rgba(74, 222, 128, 0.08);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.service-due-banner.status-due {
  display: flex;
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.service-due-banner.status-overdue {
  display: flex;
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.4);
}
.checklist-group {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.checklist-group-header {
  background: #1e293b;
  padding: 10px 12px;
  font-size: var(--fs-2xs);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.4px;
}
.checklist-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  gap: 10px;
  background: #0f172a;
}
.checklist-item-label {
  font-size: var(--fs-xs);
  color: var(--text-main);
}
.checklist-toggle {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #111827;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  min-width: 78px;
  text-align: center;
}
.checklist-toggle.state-ok {
  border-color: var(--success);
  color: var(--success);
  background: rgba(74, 222, 128, 0.08);
}
.checklist-toggle.state-changed {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
}
.checklist-toggle.state-na {
  border-color: var(--text-muted);
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.06);
}
.checklist-toggle.state-fail {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}
.checklist-toggle.state-repaired {
  border-color: var(--success);
  color: var(--success);
  background: rgba(74, 222, 128, 0.1);
}
.checklist-issue-block {
  padding: 8px 12px 12px;
  border-top: 1px dashed var(--border);
  background: rgba(248, 113, 113, 0.04);
}
.checklist-issue-block textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 8px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: var(--fs-xs);
  resize: vertical;
}
.checklist-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  padding: 8px 4px 4px;
}
.view-checklist-group {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.view-checklist-header {
  background: var(--input-bg);
  padding: 8px 10px;
  font-size: var(--fs-2xs);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
}
.view-checklist-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: var(--fs-xs);
  border-top: 1px solid var(--border);
}
.view-checklist-item span:last-child {
  font-weight: 700;
}
.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 280px;
}
.spec-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.spec-table tr:last-child td {
  border-bottom: none;
}
.spec-table td:first-child {
  color: var(--text-muted);
  font-weight: 600;
  width: 55%;
}
.spec-table td:last-child {
  color: var(--text-main);
  font-weight: 700;
  text-align: right;
}
.log-list {
  margin-top: 10px;
}
.log-item {
  background: var(--card-dark);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.log-item.has-fault {
  border-left: 4px solid var(--danger);
}
.log-item.pending {
  border-left: 4px solid var(--warning);
}
.log-item:active {
  background: #334155;
}
/* Today So Far: one big tappable segment per block, so a gloved tap
   opens THAT block's form instead of a tiny pencil or a detail view
   whose Edit button sits at the bottom of the page. */
/* Day-add picker (2.4.51): one uniform big-tile size in a two-column
   grid, icon + bold title (+ an optional sub-line), matching the app's
   tile-grid standard. Every tile carries its accent inline (the tile
   model's colours) — the report tiles from the start, the four block
   tiles since 2.4.67, in the same style. */
.dar-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.dar-picker-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 16px 14px;
  box-sizing: border-box;
  text-align: left;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
}
.dar-picker-icon {
  font-size: 1.7rem;
  line-height: 1;
}
.dar-picker-label {
  font-size: var(--fs-md);
  font-weight: 800;
  line-height: 1.2;
}
.dar-picker-sub {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-muted);
}
.dar-block {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-height: 88px;
  padding: 16px 14px;
  margin-bottom: 12px;
  box-sizing: border-box;
  text-align: left;
  background: var(--card-dark);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.dar-block.pending {
  border-left-color: var(--warning);
}
.dar-block.editing {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}
.dar-block-body {
  flex: 1;
  min-width: 0;
}
.dar-block-times {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-main);
}
.dar-block-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.dar-block-comment {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-top: 8px;
  line-height: 1.35;
}
.dar-block-del {
  width: 48px;
  min-height: 48px;
  flex-shrink: 0;
  align-self: center;
  padding: 0;
  background: var(--input-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-xs);
  font-size: 1.1rem;
  cursor: pointer;
}
.part-suggest-list {
  z-index: 80;
}
/* Day flow (simple day screen): big tap targets throughout - the
   whole flow is built for gloved hands on a phone in the rain. */
.df-head {
  margin-bottom: 14px;
}
.df-head-date {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}
.df-head-proj {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 2px;
}
.df-start,
.df-kinds,
.df-compose,
.df-finish,
.df-now {
  background: var(--card-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  margin-bottom: 14px;
}
.df-start-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px;
}
.df-start-sub,
.df-hint,
.df-opt {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.df-big-start {
  background: var(--success);
  color: #000;
  width: 100%;
  padding: 20px;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 12px 0 8px;
}
.df-secondary {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
}
.df-addrow {
  margin-bottom: 14px;
}
.df-add {
  background: var(--primary);
  color: #000;
  width: 100%;
  padding: 18px;
  font-size: 1.05rem;
  font-weight: 800;
}
.df-kinds-title,
.df-compose-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}
.df-kind,
.df-set {
  display: block;
  width: 100%;
  text-align: left;
  padding: 15px 14px;
  margin-bottom: 8px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
}
.df-kind-custom {
  border-style: dashed;
  color: var(--primary);
}
.df-set-on {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}
.df-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.df-chip {
  padding: 12px 14px;
  min-height: 48px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.df-chip-on {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
}
.df-crew-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.df-assign {
  margin-top: 10px;
}
.df-assign-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.df-crew-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  font-size: var(--fs-md, 1rem);
  color: var(--text-main);
  cursor: pointer;
}
.df-crew-row input {
  width: 22px;
  height: 22px;
}
.df-point-row,
.df-note-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.df-point-row input[type='text'],
.df-note-row input[type='text'] {
  flex: 1;
  min-width: 160px;
}
.df-mic {
  padding: 10px 12px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-main);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.df-compose-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.df-compose-actions .btn-secondary {
  flex: 0 0 auto;
  padding: 12px 16px;
}
.df-start-btn {
  background: var(--success);
  color: #000;
  flex: 1;
  padding: 16px;
  font-weight: 800;
}
.df-now {
  border-left: 5px solid var(--success);
}
.df-now-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.df-now-tag {
  background: var(--success);
  color: #000;
  font-weight: 800;
  font-size: var(--fs-xs);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.df-now-kind {
  font-weight: 800;
  color: var(--text-main);
}
.df-now-meta {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-top: 6px;
}
.df-now-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.df-finish {
  background: var(--success);
  color: #000;
  flex: 1;
  padding: 16px;
  font-weight: 800;
}
.df-autoclosed-note {
  font-size: var(--fs-sm);
  color: var(--warning);
  margin: 0 0 10px;
}
.df-points {
  margin-top: 8px;
}
.df-point {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.df-point-text {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-sm);
  color: var(--text-main);
}
.df-point-asset {
  color: var(--text-muted);
}
.df-tag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.df-tag-fault {
  color: var(--danger);
  border-color: var(--danger);
}
.df-tag-row {
  margin-top: 6px;
}
.df-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.df-mini-btn {
  padding: 10px 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-main);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.df-mini-finish {
  background: var(--success);
  color: #000;
  border-color: var(--success);
}
.df-mini-save {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}
.df-inline-point {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.df-inline-point input[type='text'] {
  flex: 1;
  min-width: 150px;
}
.log-info h4 {
  font-size: var(--fs-sm);
  margin-bottom: 2px;
}
.log-info p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.note-item {
  background: var(--card-dark);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border-left: 4px solid var(--notes-accent);
}
.view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.view-data-point {
  background: var(--input-bg);
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  min-height: 58px;
}
.view-lbl {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.view-val {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.btn-folder-toggle {
  width: 100%;
  background: #111827;
  border: 1px dashed var(--success);
  color: var(--success);
  padding: 14px;
  font-size: var(--fs-sm);
  font-weight: 800;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.btn-folder-toggle.folder-open {
  background: rgba(74, 222, 128, 0.05);
  border-style: solid;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}
.folder-content {
  display: none;
  background: #111827;
  border: 1px solid var(--success);
  border-top: none;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  padding: 14px;
  margin-bottom: 20px;
}
/* One-line explainer under a dashboard button's label, so a box like
   "ASSET LIST" or "WORK ORDERS" says what it's for instead of
   just naming itself - added after techs said they weren't sure which
   of several similar-sounding screens to use for a given change. */
.btn-label-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.btn-sub {
  font-size: var(--fs-sm);
  font-weight: 500;
  opacity: 0.85;
}
/* A button carrying a subtitle needs room for the folder arrow to sit
   pinned to the right edge instead of floating inline - float doesn't
   do anything useful once the label wraps to two centred lines, and was
   leaving a lopsided gap between the text and the arrow. */
.btn {
  position: relative;
}
.btn > [id$='FolderArrow'],
.btn > #folderArrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  float: none;
}

/* Manager-facing fault report: the same header on the phone, on a
   desktop and on the printed page. */
.report-letterhead {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
}
.report-letterhead-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: #0f172a;
  color: #fff;
  padding: 12px 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
/* The workspace logo FILLs its slot edge-to-edge (owner,
   2026-11-10): a fixed slot, cropped to fill with object-fit:cover
   so no white letterboxing shows around it, and no background -
   the letterhead's own navy shows at the rounded corners instead.
   Aspect is never distorted: cover scales and crops, it does not
   stretch. The default Muir PowerSync mark only ever appears when
   a workspace has no logo of its own, and this rule does not change
   that behaviour. */
.report-letterhead-logo {
  height: 32px;
  width: 120px;
  max-width: 120px;
  object-fit: cover;
  background: transparent;
  border-radius: 4px;
  display: block;
}
/* The app's own logo slots (.app-logo: the sign-in / landing marks
   applyBranding_ paints) fill the same way - a fixed square slot,
   cover-cropped, no white showing around the mark. */
.app-logo {
  width: 64px;
  height: 64px;
  object-fit: cover;
}
.report-letterhead-logo[hidden] {
  display: none !important;
}
.company-logo-preview {
  display: block;
  height: 64px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}
.company-logo-preview[hidden] {
  display: none !important;
}
.report-powered {
  margin: 16px 0 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.report-letterhead-title {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
/* The SAMPLE pill paintReportMasthead_ adds to a seeded sample
   report's letterhead brand (amber on the navy header, bordered so
   the word still reads when a print drops backgrounds). */
.report-sample-pill {
  background: #f59e0b;
  color: #0f172a;
  border: 1px solid #fbbf24;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.report-letterhead-brand .app-brand-name-emoji {
  color: #38bdf8;
}
.report-letterhead-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding: 10px 14px;
  background: var(--bg-card, #f8fafc);
}
.report-letterhead-meta span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.report-letterhead-meta strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
}
.report-severity {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: var(--radius-sm);
  border-left: 4px solid #0284c7;
  background: #eff6ff;
  color: #075985;
}
.report-severity[data-level='stopped'] {
  background: #fef2f2;
  color: #991b1b;
  border-left-color: #b91c1c;
}
.report-severity[data-level='restricted'] {
  background: #fffbeb;
  color: #92400e;
  border-left-color: #d97706;
}
.report-summary {
  margin: 0 0 14px;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-main);
}
.report-photo-status {
  margin: 6px 0 0;
  font-size: var(--fs-sm);
  color: var(--warning, #b45309);
}
.report-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.report-photo {
  margin: 0;
}
.report-photo img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}
.report-photo figcaption {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.signoff-pad {
  width: 100%;
  height: 140px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  touch-action: none;
  display: block;
  cursor: crosshair;
}
.signoff-preview[hidden] {
  display: none;
}
.signoff-preview {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}
.signoff-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}
.signoff-when {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.view-data-point[hidden] {
  display: none !important;
}
.view-grid:not(:has(.view-data-point:not([hidden]))) {
  display: none;
}
.signoff-view {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card, #f8fafc);
}
.signoff-view:empty {
  display: none;
}
.signoff-view-meta {
  margin-top: 8px;
  font-size: var(--fs-sm);
}
/* Related faults on a DAR block. The whole row is the tap target.
   A ticked row is one already linked to this visit. */
.dar-fault-hint {
  margin: -2px 0 8px;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text-muted);
}
.dar-fault-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 8px;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card, var(--input-bg));
  color: var(--text-main);
  font-weight: 400;
  text-transform: none;
  cursor: pointer;
}
.dar-fault-row:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.dar-fault-row input[type='checkbox'] {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 1px 0 0;
  padding: 0;
  flex: 0 0 22px;
}
.dar-fault-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dar-fault-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dar-fault-job {
  font-weight: 700;
  color: var(--text-main);
}
.dar-fault-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-main);
  line-height: 1.35;
}
.dar-fault-meta {
  color: var(--text-muted);
}
.dar-fault-badge[data-level='stopped'] {
  background: rgba(248, 113, 113, 0.14);
  color: var(--danger);
}
.dar-fault-badge[data-level='restricted'] {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warning);
}
.dar-fault-badge[data-level='monitor'] {
  background: rgba(56, 189, 248, 0.14);
  color: var(--primary);
}
.dar-fault-badge[data-level='repaired'] {
  background: rgba(74, 222, 128, 0.14);
  color: var(--success);
}
.dar-fault-badge[data-level='open'] {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}
button.fl-pill {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}
.fr-repeat {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}
.fr-repeat.fr-repeat-focus {
  outline: 2px solid var(--warning);
}
.fr-repeat-heading {
  margin: 0 0 8px;
  font-weight: 800;
  color: var(--text-main);
}
.fr-repeat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card, var(--input-bg));
  color: var(--text-main);
  cursor: pointer;
}
.fr-repeat-job {
  font-weight: 800;
  color: var(--primary);
}
.fr-repeat-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.35;
}
