/* Walkthroughs: the camera's extra controls, the job page box and the written report. */

/* Camera */
.walk-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.walk-pause { display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; flex: none; }
.walk-pause[hidden] { display: none; }
.walk-pause svg { width: 22px; height: 22px; }
.walk.is-paused .walk-time { background: #b45309; }
.walk.is-paused .walk-rec span { opacity: .55; }
.walk-ai { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--ui-r-sm, 10px); background: var(--ui-accent-soft, #e6f4f1); }
.walk-ai[hidden] { display: none; }
.walk-ai-lede { margin: 0; font-size: 14px; line-height: 1.45; }
.walk-card .check-line.is-needed { outline: 2px solid var(--s-bad, #b42318); outline-offset: 4px; border-radius: 4px; }
.walk-card [hidden] { display: none !important; }
.walk-actions .btn { flex: 1 1 auto; justify-content: center; }
.walk-actions [data-writeup] { flex-basis: 100%; min-height: 48px; font-size: 16px; }
.walk-steps { display: grid; gap: 10px; margin: 4px 0; padding: 0; list-style: none; }
.walk-steps li { display: flex; align-items: center; gap: 10px; color: var(--ui-muted, #667085); font-weight: 600; }
.walk-steps li::before { content: ''; width: 18px; height: 18px; flex: none; border: 2px solid var(--ui-line, #d0d5dd); border-radius: 50%; box-sizing: border-box; }
.walk-steps li.is-active { color: var(--ui-ink, #182230); }
.walk-steps li.is-active::before { border-color: var(--ui-accent, #0f766e); border-right-color: transparent; animation: walk-spin .8s linear infinite; }
.walk-steps li.is-done { color: var(--ui-ink, #182230); }
.walk-steps li.is-done::before { border-color: var(--ui-accent, #0f766e); background: var(--ui-accent, #0f766e) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 11px no-repeat; }
@keyframes walk-spin { to { transform: rotate(360deg); } }
.walk-error { margin: 0; padding: 10px 12px; border-radius: var(--ui-r-sm, 10px); background: var(--s-bad-bg, #fef3f2); color: var(--s-bad, #b42318); font-size: 14px; }
.walk-error[hidden] { display: none; }

/* Job page */
.walk-cta { white-space: nowrap; border-color: var(--ui-accent, #0f766e); color: var(--ui-accent, #0f766e); font-weight: 700; }
.walk-cta svg { width: 18px; height: 18px; }
.drop .walk-drop.is-walk { border-color: var(--ui-accent, #0f766e); color: var(--ui-accent, #0f766e); background: var(--ui-accent-soft, #e6f4f1); }
.walk-box { padding: 18px 20px; }
.walk-box[hidden] { display: none; }
.walk-box.is-empty { background: linear-gradient(135deg, var(--ui-accent-soft, #e6f4f1), var(--ui-surface, #fff) 70%); border-color: color-mix(in srgb, var(--ui-accent, #0f766e) 30%, var(--ui-line, #d0d5dd)); }
.walk-box-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.walk-box-head h2 { margin: 0 0 4px; font-size: 17px; }
.walk-box-head .hint { margin: 0; max-width: 56ch; }
.walk-start { flex: none; min-height: 44px; }
.walk-start svg { width: 18px; height: 18px; }
.walk-list { display: grid; gap: 10px; margin-top: 16px; }
.walk-card-item { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 10px; border: 1px solid var(--ui-line, #d0d5dd); border-radius: var(--ui-r-sm, 10px); background: var(--ui-surface, #fff); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.walk-card-item:hover { border-color: var(--ui-accent, #0f766e); }
.walk-card-item:focus-visible { outline: 2px solid var(--ui-accent, #0f766e); outline-offset: 2px; }
.walk-thumb { display: grid; place-items: center; width: 84px; height: 64px; flex: none; overflow: hidden; border-radius: 8px; background: var(--ui-sunken, #f2f4f7); color: var(--ui-muted, #667085); }
.walk-thumb img { width: 100%; height: 100%; object-fit: cover; }
.walk-card-text { display: grid; gap: 2px; min-width: 0; }
.walk-card-text strong { font-size: 15px; }
.walk-card-text small { color: var(--ui-muted, #667085); font-size: 12.5px; }
.walk-card-text span { color: var(--ui-ink-2, #344054); font-size: 13.5px; line-height: 1.4; }
@media (max-width: 640px) {
  .walk-box-head { flex-direction: column; align-items: stretch; }
  .walk-start { width: 100%; justify-content: center; }
  .job-head-actions .walk-cta { order: 1; flex: 1 1 auto; justify-content: center; }
}

/* Writing up an existing video */
.wr-modal { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: 16px; background: rgb(14 18 23 / .64); }
.wr-modal-card { display: grid; gap: 12px; width: min(100%, 480px); padding: 20px; border-radius: 16px; }
.wr-modal-card h2 { margin: 0; font-size: 18px; }
.wr-modal-card .hint { margin: 0; }

/* The report */
body.wr-open { overflow: hidden; }
.wr { position: fixed; inset: 0; z-index: 1900; overflow: auto; background: var(--ui-bg, #f5f6f8); overscroll-behavior: contain; }
.wr-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--ui-surface, #fff); border-bottom: 1px solid var(--ui-line, #d0d5dd); }
.wr-bar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.wr-doc { box-sizing: border-box; width: min(100% - 32px, 820px); margin: 24px auto 48px; padding: 32px 36px; border: 1px solid var(--ui-line, #d0d5dd); border-radius: var(--ui-r, 12px); background: var(--ui-surface, #fff); color: var(--ui-ink, #182230); }
.wr-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-weight: 700; color: var(--ui-muted, #667085); }
.wr-brand img { max-height: 40px; max-width: 160px; object-fit: contain; }
.wr-kicker { margin: 0 0 4px; color: var(--ui-accent, #0f766e); font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.wr-doc h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.2; }
.wr-meta { margin: 0 0 12px; color: var(--ui-muted, #667085); font-size: 14px; }
.wr-note { display: inline-block; margin: 0 0 18px; padding: 4px 10px; border-radius: 999px; background: var(--s-warn-bg, #fffaeb); color: var(--s-warn, #93370d); font-size: 12.5px; font-weight: 600; }
.wr-summary { padding: 14px 16px; margin-bottom: 20px; border-left: 4px solid var(--ui-accent, #0f766e); background: var(--ui-sunken, #f2f4f7); border-radius: 0 8px 8px 0; font-size: 15.5px; line-height: 1.55; }
.wr-summary p { margin: 0 0 8px; } .wr-summary p:last-child { margin: 0; }
.wr-video { margin-bottom: 20px; }
.wr-video summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--ui-accent, #0f766e); }
.wr-video video { display: block; width: 100%; max-height: 60vh; margin-top: 10px; border-radius: 10px; background: #000; }
.wr-sec { padding: 20px 0; border-top: 1px solid var(--ui-line, #d0d5dd); }
.wr-sec h2 { margin: 0 0 10px; font-size: 19px; }
.wr-sec h3 { margin: 18px 0 8px; font-size: 15px; }
.wr-body { font-size: 15px; line-height: 1.6; }
.wr-body p { margin: 0 0 10px; } .wr-body ul { margin: 0 0 10px; padding-left: 20px; } .wr-body li { margin-bottom: 4px; }
.wr-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.wr-photo { position: relative; margin: 0; overflow: hidden; border-radius: 10px; background: var(--ui-sunken, #f2f4f7); aspect-ratio: 4 / 3; }
.wr-photo a { display: block; height: 100%; }
.wr-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wr-photo figcaption { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wr-photo-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 14px; cursor: pointer; }
.wr-fu { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.wr-fu .check-line { align-items: center; }
.wr-fu .prio { margin-left: auto; }
.wr-quote { display: grid; gap: 8px; margin-bottom: 8px; }
.wr-ql { display: grid; grid-template-columns: auto 1fr 90px 110px; gap: 8px; align-items: center; }
.wr-ql label:not(.check-line) { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ui-muted, #667085); }
.wr-ql input:not([type=checkbox]) { width: 100%; min-width: 0; }
.wr-ql .check-line span { font-size: 12px; color: var(--ui-muted, #667085); white-space: nowrap; }
.wr-transcript { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--ui-line, #d0d5dd); }
.wr-transcript summary { cursor: pointer; font-weight: 600; }
.wr-transcript div { margin-top: 10px; color: var(--ui-ink-2, #344054); font-size: 14px; line-height: 1.6; }
.wr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--ui-line, #d0d5dd); }
.wr-foot .hint { margin: 0; flex: 1 1 240px; }
.wr-delete { margin-left: auto; }
.wr-edit label { display: grid; gap: 6px; margin-bottom: 16px; font-weight: 600; }
.wr-edit input, .wr-edit textarea { width: 100%; box-sizing: border-box; font: inherit; }
.wr-edit fieldset { margin: 0; padding: 16px 0; border: 0; border-top: 1px solid var(--ui-line, #d0d5dd); }
.wr-edit fieldset[hidden], .wr-edit [data-photo][hidden] { display: none; }
.wr-edit-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.wr-edit-head input { font-weight: 700; font-size: 16px; }
.wr-edit .hint { margin: 4px 0 0; }
@media (max-width: 640px) {
  .wr-doc { width: 100%; margin: 0; padding: 20px 16px 40px; border: 0; border-radius: 0; }
  .wr-doc h1 { font-size: 23px; }
  .wr-photos { grid-template-columns: repeat(2, 1fr); }
  .wr-ql { grid-template-columns: 1fr 1fr; }
  .wr-ql .check-line, .wr-ql [data-ql-desc] { grid-column: 1 / -1; }
  .wr-bar .btn { padding-left: 10px; padding-right: 10px; }
  .wr-hide-sm { display: none; }
}

/* Printing a report: only the report, laid out for paper. */
@media print {
  body.wr-print > *:not(.wr) { display: none !important; }
  body.wr-print .wr { position: static; overflow: visible; background: #fff; }
  body.wr-print .wr-bar, body.wr-print .no-print, body.wr-print .wr-ql .check-line { display: none !important; }
  body.wr-print .wr-doc { width: auto; margin: 0; padding: 0; border: 0; }
  body.wr-print .wr-sec { break-inside: auto; }
  body.wr-print .wr-sec h2 { break-after: avoid; }
  body.wr-print .wr-photos { grid-template-columns: repeat(3, 1fr); }
  body.wr-print .wr-photo { break-inside: avoid; }
  body.wr-print .wr-ql { grid-template-columns: 1fr 60px 80px; }
  body.wr-print .wr-ql input { border: 0; padding: 0; background: none; }
}

/* Camera button sheet: Photos or Walkthrough */
.cam-mode { display: flex; margin-bottom: 10px; }
.cam-mode button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cam-mode button svg { width: 16px; height: 16px; }
.cam-walk-hint { margin: 0 0 10px; }
.cam-walk-hint[hidden], .cam-new[hidden] { display: none; }

/* Quote from a walkthrough: a short, Xero-style line list. */
.wr-quote-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.wr-quote-head h2 { margin: 0; }
.wr-chip { padding: 2px 10px; border-radius: 999px; background: var(--ui-accent-soft, #e6f4f1); color: var(--ui-accent, #0f766e); font-size: 12px; font-weight: 600; }
.wr-qt { display: grid; gap: 6px; margin: 12px 0 8px; }
.wr-qt-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 96px 88px 36px; gap: 8px; align-items: center; }
.wr-qt.has-items .wr-qt-row { grid-template-columns: minmax(120px, .8fr) minmax(0, 1.4fr) 72px 96px 88px 36px; }
.wr-qt-cols { font-size: 11.5px; font-weight: 600; color: var(--ui-muted, #667085); }
.wr-qt-cols span:nth-last-child(2) { text-align: right; }
.wr-qt-row label { display: block; margin: 0; }
.wr-qt-row input, .wr-qt-row select { width: 100%; min-width: 0; box-sizing: border-box; }
.wr-cap { display: none; }
.wr-qt-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wr-qt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ui-line, #d0d5dd); }
.wr-qt-foot strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.wr-qt-foot small { color: var(--ui-muted, #667085); }
.wr-qt-go { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .wr-qt-cols { display: none; }
  .wr-qt-row, .wr-qt.has-items .wr-qt-row { grid-template-columns: 1fr 1fr 1fr 36px; padding: 10px; border: 1px solid var(--ui-line, #d0d5dd); border-radius: 10px; align-items: end; }
  .wr-cap { display: block; font-size: 11px; font-weight: 600; color: var(--ui-muted, #667085); margin-bottom: 3px; }
  .wr-qt-item, .wr-qt-desc { grid-column: 1 / -1; }
  .wr-qt-amt { padding-bottom: 9px; }
}

/* Draft quote preview */
.wr-qcard { margin: 12px 0 18px; padding: 18px 20px; border: 1px solid var(--ui-line, #d0d5dd); border-radius: var(--ui-r-sm, 10px); background: var(--ui-sunken, #f8f9fb); }
.wr-qcard h3 { margin: 0 0 8px; font-size: 17px; }
.wr-opt { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-accent, #0f766e); }
.wr-qtable { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.wr-qtable th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ui-muted, #667085); padding: 0 0 6px; border-bottom: 1px solid var(--ui-line, #d0d5dd); }
.wr-qtable td { padding: 8px 0; border-bottom: 1px solid var(--ui-line, #d0d5dd); vertical-align: top; }
.wr-qtable .num { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; }
.wr-need { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--s-warn-bg, #fffaeb); color: var(--s-warn, #93370d); font-size: 11.5px; font-weight: 600; }
.wr-qtotals { display: grid; gap: 4px; margin: 12px 0 0 auto; max-width: 300px; }
.wr-qtotals div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.wr-qtotals strong { font-variant-numeric: tabular-nums; }
.wr-qtotals small { color: var(--ui-muted, #667085); text-align: right; }
.wr-qphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 16px; }
.wr-qphoto { position: relative; padding: 0; aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid transparent; border-radius: 8px; background: var(--ui-sunken, #f2f4f7); cursor: pointer; }
.wr-qphoto img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .55; }
.wr-qphoto.is-on { border-color: var(--ui-accent, #0f766e); }
.wr-qphoto.is-on img { opacity: 1; }
.wr-qphoto.is-on::after { content: '✓'; position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--ui-accent, #0f766e); color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.wr-quote-note { display: grid; gap: 6px; margin: 10px 0 12px; font-weight: 600; max-width: 520px; }
.wr-quote-note input { width: 100%; box-sizing: border-box; }
.wr-quote > .hint:last-child { margin-top: 8px; }
@media (max-width: 640px) { .wr-qcard { padding: 14px; } }

/* Video tiles: the first frame and a play button, not a squashed player */
.ph-vbtn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.ph-vthumb { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #111; border-radius: inherit; }
.ph-vthumb video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ph-play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.ph-play svg { width: 22px; height: 22px; margin-left: 3px; }
.ph-vbtn:hover .ph-play, .ph-vbtn:focus-visible .ph-play { background: var(--ui-accent, #0f766e); }
.ph-len { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Survey or completion */
.walk-kind { position: absolute; top: calc(env(safe-area-inset-top) + 70px); left: 50%; transform: translateX(-50%); display: flex; padding: 4px; border-radius: 999px; background: rgba(0,0,0,.55); }
.walk-kind[hidden] { display: none; }
.walk-kind button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.walk-kind button[aria-pressed="true"] { background: #fff; color: #111; }
.walk-kind.is-light { position: static; transform: none; align-self: start; background: var(--ui-sunken, #f2f4f7); }
.walk-kind.is-light button { color: var(--ui-ink, #182230); font-size: 14px; }
.walk-kind.is-light button[aria-pressed="true"] { background: var(--ui-accent, #0f766e); color: #fff; }
.wr-filled { margin: -8px 0 18px; color: var(--s-done, #067647); font-size: 14px; font-weight: 600; }
.walk-kind-chip { justify-self: start; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.walk-kind-chip.is-survey { background: var(--s-scheduled-bg, #eff8ff); color: var(--s-scheduled, #175cd3); }
.walk-kind-chip.is-done { background: var(--s-done-bg, #ecfdf3); color: var(--s-done, #067647); }
