/* Site Visits: list, visit page, forms and the customer report (A4). Look follows Home: navy text, amber next step, white cards with a 1px border. */
.tag.sv-open { background: #FFF4DC; color: #8A5A00; }
.sv-section { margin: 16px 0 8px; }
.sv-section h2 { font: 600 16px/1.2 "Barlow Semi Condensed", Barlow, sans-serif; margin: 0 0 8px; }
.sv-section h2 small { font: 400 13px Barlow, sans-serif; margin-left: 6px; }
.sv-branch { background: #fff; border: 1px solid #E1E6EC; border-radius: 10px; padding: 10px 12px; margin: 4px 0 8px; }
.sv-branch summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.sv-branch-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; max-height: 45vh; overflow: auto; }
.sv-branch-list li { border-top: 1px solid #E1E6EC; padding-top: 8px; }
.sv-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-choice { position: relative; flex: 1 1 auto; }
.sv-choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sv-choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 8px 14px; border: 1px solid #E1E6EC; border-radius: 999px; background: #fff; font-weight: 600; color: #0D1B2A; }
.sv-choice input:checked + span { background: #0D1B2A; border-color: #0D1B2A; color: #fff; }
.sv-choice input:focus-visible + span { outline: 2px solid #1F5FD1; outline-offset: 2px; }
/* Compact while typing (Ali, 5 Nov 2026): with the keyboard open (fit.js sets html.kb-open) the pop-up's title row, its information box and the photo area
   hide, so the field being typed in and the next ones get the room above the keyboard. The open-point warning always stays. */
html.kb-open dialog.sv-form > form > header,
html.kb-open dialog.sv-form .sv-history:not(:has(.sv-warn)),
html.kb-open dialog.sv-form .photo-picker { display: none; }
.sv-found { margin: 6px 0; }
.case-actions .btn { flex: 0 1 auto; }
@media (max-width: 700px) { .case-actions .next-btn { min-width: 0; flex: 1 1 auto; } }
.sv-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sv-photo { width: 64px; height: 64px; border-radius: 6px; overflow: hidden; border: 1px solid #E1E6EC; background: #F3F5F8; }
.sv-photo img { width: 100%; height: 100%; object-fit: cover; }
.sv-summary { width: 100%; max-width: 720px; border: 1px solid #E1E6EC; border-radius: 8px; padding: 10px; font: inherit; }
.sv-history { background: #F3F5F8; border: 1px solid #E1E6EC; border-radius: 8px; padding: 10px; margin: 10px 0; }
.sv-hist { margin: 6px 0 0; padding-left: 18px; }
.sv-warn { background: #FFF7E8; border: 1px solid #F5A524; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.danger-text { color: #E1251B; }
/* customer report overlay */
#sv-report { position: fixed; inset: 0; z-index: 90; background: rgba(13, 27, 42, 0.55); overflow: auto; padding: 24px 16px; }
.sv-panel { max-width: 900px; margin: 0 auto; background: #E8ECF1; border-radius: 14px; overflow: clip; box-shadow: 0 12px 40px rgba(13, 27, 42, 0.35); padding-bottom: 24px; }
#sv-report.sv-weekly .sv-panel { max-width: 1180px; }
@media (max-width: 700px) { #sv-report { padding: 0; } .sv-panel { border-radius: 0; min-height: 100%; box-shadow: none; } }
.sv-report-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; padding: 10px 12px; background: #F3F5F8; border-bottom: 1px solid #E1E6EC; }
.sv-sheet { page: svreport; width: 210mm; max-width: 100%; margin: 12px auto; background: #fff; color: #0D1B2A; font: 400 9pt/1.4 Barlow, Arial, sans-serif; }
.rp-p1 { position: relative; min-height: 288mm; padding: 8mm 14mm 34mm; }
.rp-logo { display: block; height: 15mm; margin: 0 auto; }
.sv-sheet h1 { font: 600 21pt/1.1 "Barlow Semi Condensed", Barlow, sans-serif; margin: 6mm 0 3mm; padding-bottom: 2mm; border-bottom: 1.2pt solid #0D1B2A; }
.sv-sheet h2 { font: 600 11.5pt/1.2 "Barlow Semi Condensed", Barlow, sans-serif; margin: 6mm 0 2mm; }
.rp-det { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm 6mm; padding: 3mm 0; border-bottom: .5pt solid #E1E6EC; }
.rp-det small { display: block; font-size: 8pt; color: #5A6677; } .rp-det b { font-weight: 500; font-size: 10pt; }
.rp-sum { margin: 4mm 0 0; font-size: 9.5pt; line-height: 1.5; } .rp-ov { margin: 2.5mm 0 0; font-weight: 600; font-size: 9.5pt; }
.sv-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8.5pt; }
.sv-sheet th { text-align: left; font-weight: 600; color: #5A6677; font-size: 8pt; padding: 0 4px 2px; border-bottom: 1.2pt solid #0D1B2A; }
.sv-sheet td { padding: 4px; border-bottom: .5pt solid #E1E6EC; vertical-align: top; } .sv-sheet tr { break-inside: avoid; }
.sv-sheet td:last-child { white-space: nowrap; }
.sv-sheet th:first-child, .sv-sheet td:first-child { padding-left: 0; width: 5mm; }
.rp-mut { color: #5A6677; } .rp-b { font-weight: 600; } .nw { white-space: nowrap; } .rp-hl td { background: #FFF7E8; }
.rp-plain { min-height: 0; padding-bottom: 10mm; } .rp-h2s { font: 400 8.5pt Barlow, sans-serif; margin-left: 6px; }
.rp-hl td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-st { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 8pt; font-weight: 600; white-space: nowrap; background: #E8ECF1; color: #0D1B2A; }
.rp-s-a { background: #FFF4DC; color: #7A4A06; } .rp-s-b { background: #E6EEFC; color: #163F8C; } .rp-s-ok { background: #E3F4EB; color: #14663F; }
.rp-st { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-foot { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; }
.rp-photos { break-before: page; padding: 9mm 14mm 0; }
.rp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5mm; margin-top: 3mm; }
.rp-grid figure { margin: 0; break-inside: avoid; } .rp-grid img { width: 100%; height: 60mm; object-fit: cover; border-radius: 2px; background: #E8ECF1; }
.rp-grid figcaption { margin-top: 1.5mm; font-size: 8pt; color: #5A6677; } .rp-grid figcaption b { color: #0D1B2A; font-weight: 600; }
@page svreport { size: A4; margin: 0 0 9mm; @bottom-center { content: "Page " counter(page) " of " counter(pages); font: 8px Arial, sans-serif; color: #5A6677; } }
@media print {
  body > *:not(#sv-report) { display: none !important; }
  #sv-report { position: static; background: #fff; overflow: visible; padding: 0; } .sv-panel { max-width: none !important; border-radius: 0; box-shadow: none; background: #fff; padding: 0; overflow: visible; }
  .sv-report-bar { display: none; } .sv-sheet { margin: 0; width: auto; }
}

/* the visit page: checklist, rows grouped by who acts, the tapped point's sheet, the list's report button */
.sv-todo { background: #fff; border: 1px solid #E1E6EC; border-radius: 12px; padding: 2px 12px; margin: 0 0 8px; }
.sv-todo > div { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #E1E6EC; }
.sv-todo > div:last-of-type { border-bottom: 0; }
.sv-todo > div > i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #9AA6B5; flex: none; }
.sv-todo > div.ok > i { background: #1E8E5A; border-color: #1E8E5A; } .sv-todo > div > span { flex: 1; }
.sv-todo .link { color: #1F5FD1; font-weight: 700; background: none; border: 0; min-height: 40px; padding: 0 4px; }
.sv-why { margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: #FDECEA; color: #8C1610; border: 1px solid #F3B9B4; font-weight: 700; }
.sv-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sv-cc { margin-top: 18px; }
.sv-photo.big { width: 96px; height: 96px; }
.sv-sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- layout pass with a busy visit (Ali, 5 Nov 2026): long names, long text, many photos, phone and computer ---- */
.sv-back { display: inline-flex; align-items: center; min-height: 44px; padding-right: 12px; }
/* the points: one row each; the status sits under the text on a phone and at the right on a computer */
.sv-rows { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.sv-row2 { display: grid; grid-template-columns: 44px minmax(0, 1fr) 14px; grid-template-areas: "th tx go" "th st go"; column-gap: 10px; row-gap: 4px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid #E1E6EC; border-radius: 12px; padding: 8px 10px; min-height: 60px; font: inherit; color: inherit; cursor: pointer; transition: transform 120ms ease-out; }
.sv-row2:active { transform: scale(0.985); }
@media (hover: hover) and (pointer: fine) { .sv-row2:hover { border-color: #B9C2CF; } }
.sv-row2.need { background: #FFF7E8; border-color: #F5D9A0; }
.sv-th { grid-area: th; align-self: start; width: 44px; height: 44px; border-radius: 8px; background: repeating-linear-gradient(45deg, #C9D1DB, #C9D1DB 5px, #E3E8EE 5px, #E3E8EE 10px) center / cover; }
.sv-tx { grid-area: tx; min-width: 0; display: flex; flex-direction: column; }
.sv-tx b, .sv-tx > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sv-tx b { font-size: 14px; line-height: 1.25; }
.sv-st { grid-area: st; justify-self: start; max-width: 100%; display: flex; align-items: center; gap: 6px; min-width: 0; }
.sv-st .tag, .sv-st .status-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-go { grid-area: go; color: #9AA6B5; font-size: 20px; }
@media (min-width: 701px) { .sv-row2 { grid-template-columns: 44px minmax(0, 1fr) auto 14px; grid-template-areas: "th tx st go"; } .sv-st { justify-self: end; max-width: 240px; } .sv-todo, .sv-why { max-width: 720px; } }
.sv-bc { display: grid; gap: 2px; color: inherit; text-decoration: none; padding: 8px 0; min-height: 44px; }
.sv-bc .sv-bc-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.sv-clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-weight: 500; }
.sv-sheet .sv-found { overflow-wrap: anywhere; }
/* the reports on a phone: the sheet is the width of the screen and each table row becomes a small card */
.sv-report-bar { flex-wrap: wrap; align-items: center; }
@media screen and (max-width: 700px) {
  .rp-p1 { padding: 14px 12px 24px; min-height: 0; } .sv-sheet { width: 100%; margin: 0; } .rp-photos { padding: 14px 12px; } .rp-grid { grid-template-columns: 1fr; } .rp-grid img { height: auto; max-height: 260px; }
  .rp-foot { position: static; margin-top: 16px; } .sv-report-bar .btn { min-height: 44px; }
  .sv-sheet table, .sv-sheet tbody, .sv-sheet tr, .sv-sheet td { display: block; width: 100%; } .sv-sheet thead { display: none; }
  .sv-sheet tr { border: 1px solid #E1E6EC; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; break-inside: avoid; } .sv-sheet td { border: 0; padding: 3px 0; display: flex; gap: 10px; font-size: 13px; } .sv-sheet td:first-child { width: 100%; padding-left: 0; font-weight: 700; } .sv-sheet td:first-child::before { display: none; }
  .sv-sheet td::before { content: attr(data-label); flex: 0 0 34%; color: #5A6677; font-size: 11px; padding-top: 2px; } .sv-sheet td.rp-empty { display: none; }
  .rp-det { grid-template-columns: repeat(2, 1fr); } .rp-p1 h1 { font-size: 20pt; } .sv-sheet .rp-st { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .sv-row2 { transition: none; } }
