/* Guided condition walkthrough — phone-first capture cockpit.
   Visual language matches the approved prototype: teal primary, navy
   accents, chips carry state, exceptions carry the effort. */
:root {
  --wt-bg: #f6faf9;
  --wt-card: #ffffff;
  --wt-ink: #1e293b;
  --wt-muted: #64748b;
  --wt-line: #e3ebe9;
  --wt-navy: #211747;
  --wt-teal: #259591;
  --wt-teal-soft: #e7f4f3;
  --wt-good-bg: #e1f5ee;
  --wt-good-fg: #0f6e56;
  --wt-worn-bg: #faeeda;
  --wt-worn-fg: #854f0b;
  --wt-bad-bg: #fcebeb;
  --wt-bad-fg: #a32d2d;
}

* { box-sizing: border-box; }

html, body.wt-body {
  margin: 0;
  background: var(--wt-bg);
  color: var(--wt-ink);
  /* Same stack as the portal and the guest/email pages so the cockpit reads
     as one product with the desk view it hands off to. */
  font-family: Nunito, -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
.wt-appbar .wt-room, .wt-roombtn, .wt-sumcard .v, .wt-sheet-title {
  font-family: Montserrat, Nunito, "Segoe UI", system-ui, sans-serif;
}

#wtApp { max-width: 520px; margin: 0 auto; }

.wt-screen { display: none; min-height: 100dvh; flex-direction: column; }
.wt-screen.on { display: flex; }

.wt-appbar { padding: 14px 16px 10px; background: var(--wt-card); border-bottom: 1px solid var(--wt-line); }
.wt-appbar .wt-room { font-size: 19px; font-weight: 800; color: var(--wt-navy); }
.wt-appbar .wt-sub { font-size: 12.5px; color: var(--wt-muted); margin-top: 2px; }
.wt-rail { display: flex; gap: 3px; margin-top: 10px; }
.wt-rail span { height: 4px; flex: 1; border-radius: 2px; background: #dfe8e6; }
.wt-rail .done { background: var(--wt-teal); }
.wt-rail .cur { background: var(--wt-navy); }

.wt-bodyarea { flex: 1; overflow-y: auto; }
.wt-pad { padding: 14px 16px; }

.wt-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; min-height: 52px; padding: 12px 16px;
  font: inherit; font-weight: 700; font-size: 16px; width: 100%;
  cursor: pointer; -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.wt-btn:active { transform: scale(.985); }
.wt-btn.primary { background: var(--wt-teal); color: #fff; }
.wt-btn.dark { background: var(--wt-navy); color: #fff; }
.wt-btn.ghost { background: var(--wt-card); border: 1px solid #cfdad8; color: var(--wt-ink); font-weight: 600; }
.wt-btn.sm { min-height: 44px; font-size: 14.5px; }
.wt-btn[disabled] { opacity: .45; pointer-events: none; }

.wt-actionbar {
  position: sticky; bottom: 0; background: var(--wt-card); border-top: 1px solid var(--wt-line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px;
}
.wt-actionbar .wt-btn { flex: 1; width: auto; min-width: 0; }

.wt-chip {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 700; border: none; font-family: inherit;
  cursor: pointer; -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.wt-chip.good { background: var(--wt-good-bg); color: var(--wt-good-fg); }
.wt-chip.worn { background: var(--wt-worn-bg); color: var(--wt-worn-fg); }
.wt-chip.bad { background: var(--wt-bad-bg); color: var(--wt-bad-fg); }
.wt-chip.np { background: #eef1f6; color: #3d4f6b; }
.wt-chip.idle { background: #eef2f1; color: var(--wt-muted); font-weight: 600; }
.wt-chip.draft { border: 1.5px dashed currentColor; background: transparent; }

.wt-rows { background: var(--wt-card); }
.wt-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid #eef2f1;
}
.wt-row .wt-nm { font-size: 15px; }
.wt-row .wt-nm button { all: unset; cursor: pointer; padding: 4px 0; }
.wt-row .wt-quote { font-size: 12.5px; color: var(--wt-muted); margin-top: 2px; font-style: italic; }
.wt-row.hl { background: #fffdf6; }

.wt-shotchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wt-shotchip {
  display: inline-flex; border-radius: 999px; padding: 4px 12px; font-size: 12px;
  background: #eef2f1; color: var(--wt-muted); font-weight: 600;
}
.wt-shotchip.done { background: var(--wt-good-bg); color: var(--wt-good-fg); }

.wt-banner { padding: 11px 16px; background: var(--wt-teal-soft); color: #0f5a52; font-size: 13.5px; font-weight: 600; }
.wt-hint { text-align: center; font-size: 12.5px; color: var(--wt-muted); margin: 10px 0; }
.wt-label { font-size: 11.5px; font-weight: 700; color: var(--wt-muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }

.wt-card {
  background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 14px; padding: 14px 16px;
}
.wt-condrow { display: flex; gap: 8px; margin: 12px 0; }
.wt-condrow .wt-btn { min-height: 46px; font-size: 15px; }
.wt-evrow { display: flex; gap: 8px; }
.wt-evrow .wt-btn { min-height: 44px; font-size: 13.5px; font-weight: 600; }
.wt-quotebox { font-size: 13.5px; background: var(--wt-bg); border-radius: 9px; padding: 9px 12px; font-style: italic; color: var(--wt-muted); }
.wt-thumbs { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.wt-thumb {
  width: 62px; height: 48px; border-radius: 7px; overflow: hidden; flex-shrink: 0;
  background: #d8e2e0; display: flex; align-items: center; justify-content: center;
  color: var(--wt-muted); font-size: 11px;
}
.wt-thumb img { width: 100%; height: 100%; object-fit: cover; }

.wt-input {
  width: 100%; border: 1px solid #cfdad8; border-radius: 10px;
  padding: 13px 14px; font: inherit; font-size: 16px; margin-top: 10px;
  background: var(--wt-card); color: var(--wt-ink);
}
.wt-input:focus { outline: 2px solid var(--wt-teal); outline-offset: 1px; }

.wt-status { font-size: 12.5px; color: var(--wt-muted); }

/* Viewfinder */
.wt-vf { position: relative; flex: 1; background: #14181a; color: #fff; overflow: hidden; display: flex; }
.wt-vf video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wt-vf-top {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center; z-index: 3;
}
.wt-rec { display: inline-flex; align-items: center; gap: 7px; background: rgba(0,0,0,.5); border-radius: 999px; padding: 5px 13px; font-size: 14px; font-weight: 700; }
.wt-rec i { width: 9px; height: 9px; border-radius: 50%; background: #ff5b4d; }
.wt-roomtag { font-size: 13px; background: rgba(0,0,0,.5); border-radius: 999px; padding: 5px 13px; }
.wt-vshots { position: absolute; top: calc(54px + env(safe-area-inset-top)); left: 14px; display: grid; gap: 6px; z-index: 3; }
.wt-vshot { font-size: 12px; background: rgba(0,0,0,.45); border-radius: 999px; padding: 3px 11px; color: #cfe8e2; }
.wt-vshot.done { color: #7ce0c3; }
.wt-vcap {
  position: absolute; left: 14px; right: 14px; bottom: 132px; z-index: 3;
  background: rgba(0,0,0,.58); border-radius: 10px; padding: 9px 12px; font-size: 14px; color: #eafaf5;
}
.wt-vctrl {
  position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); left: 0; right: 0;
  display: flex; justify-content: center; align-items: center; gap: 34px; z-index: 3;
}
.wt-snap { width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; background: transparent; cursor: pointer; }
.wt-snap:active { background: rgba(255,255,255,.35); }
.wt-stop { width: 76px; height: 76px; border-radius: 50%; background: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.wt-stop i { width: 26px; height: 26px; border-radius: 6px; background: #e0443a; display: block; }
.wt-spacer { width: 56px; height: 56px; }
.wt-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 4; }
.wt-flash.go { animation: wtflash .25s ease-out; }
@keyframes wtflash { 0% { opacity: .8; } 100% { opacity: 0; } }
.wt-framecount { position: absolute; right: 14px; bottom: 132px; z-index: 3; font-size: 12.5px; background: rgba(0,0,0,.5); border-radius: 999px; padding: 4px 11px; color: #cfe8e2; }

/* Summary */
.wt-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt-sumcard { background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 12px; padding: 12px 14px; }
.wt-sumcard .v { font-size: 24px; font-weight: 800; color: var(--wt-navy); }
.wt-sumcard .k { font-size: 12px; color: var(--wt-muted); }
.wt-okline { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--wt-good-fg); font-weight: 600; margin-top: 10px; }
.wt-okline .dot { width: 9px; height: 9px; border-radius: 50%; background: #1d9e75; flex-shrink: 0; }
.wt-warnline { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--wt-worn-fg); font-weight: 600; margin-top: 8px; }
.wt-warnline .dot { width: 9px; height: 9px; border-radius: 50%; background: #ef9f27; flex-shrink: 0; }

.wt-toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(8px);
  background: var(--wt-navy); color: #fff; border-radius: 999px; padding: 9px 18px;
  font-size: 13.5px; font-weight: 600; opacity: 0; transition: all .25s; pointer-events: none; z-index: 60;
  max-width: calc(100vw - 40px); text-align: center;
}
.wt-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.wt-diffline { font-size: 13px; color: var(--wt-muted); background: var(--wt-bg); border-left: 3px solid var(--wt-teal); border-radius: 0; padding: 8px 12px; margin-top: 10px; }
.wt-diffbtns { display: flex; gap: 8px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .wt-btn:active { transform: none; }
  .wt-flash.go { animation: none; }
}

/* Room navigation + video upload line (iteration 2) */
.wt-roombtn {
  all: unset; cursor: pointer; font-size: 19px; font-weight: 800; color: var(--wt-navy);
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}
.wt-roombtn span { font-size: 13px; color: var(--wt-muted); }

.wt-videoline { margin-top: 10px; }
.wt-videoline .wt-btn { margin-top: 8px; }

/* Silence warning in the viewfinder caption strip */
.wt-vcap.warn { background: rgba(186, 117, 23, .92); color: #fff7ea; font-weight: 600; }

/* Narration block on the checklist */
.wt-narr {
  background: var(--wt-card);
  border: 1px solid var(--wt-line);
  border-radius: 12px;
  padding: 10px 14px;
}
.wt-narr summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--wt-navy);
  -webkit-tap-highlight-color: transparent;
}
.wt-narr p {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--wt-muted);
  font-style: italic;
  white-space: pre-line;
}

.wt-narr.fail { border-color: #efc27f; background: #fffdf6; }
.wt-narr.fail > span { color: var(--wt-worn-fg); }
/* The service's own reason for the failure — the difference between "try
   again forever" and knowing the resource is misconfigured. */
.wt-narr .wt-narr-why {
  font-style: normal; font-size: 12.5px; color: var(--wt-muted);
  overflow-wrap: anywhere;
}

/* Iteration 3: in-page decisions, drafts banner button, inline link buttons,
   and the "Sent" landing screen. */
.wt-linkbtn {
  all: unset; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--wt-teal); text-decoration: underline; text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent; padding: 4px 0;
}
.wt-bannerbtn {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--wt-teal-soft); color: #0f5a52; font-size: 14px; font-weight: 700;
  border: 1px solid #bfe3df; -webkit-tap-highlight-color: transparent;
}
.wt-bannerbtn:active { transform: scale(.99); }

/* Decisions land next to the thing being decided about, not pinned to the
   bottom edge of a tall phone screen where the tap that opened them is a
   whole screen away. */
.wt-sheet-host {
  position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  overflow-y: auto;
}
.wt-sheet {
  width: 100%; max-width: 420px; background: var(--wt-card);
  border-radius: 18px; padding: 18px 16px 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .28);
}
.wt-sheet-title { font-size: 17px; font-weight: 800; color: var(--wt-navy); }
.wt-sheet-body { font-size: 14px; color: var(--wt-muted); margin: 6px 0 0; }
.wt-sheet-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.wt-sent { text-align: center; padding: 34px 16px 10px; }
.wt-sent .wt-tick {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--wt-good-bg); color: var(--wt-good-fg); font-size: 32px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.wt-sent h1 { font-family: Montserrat, Nunito, "Segoe UI", sans-serif; font-size: 22px; color: var(--wt-navy); margin: 0 0 6px; }
.wt-sent p { color: var(--wt-muted); margin: 0; }
.wt-sent-facts { list-style: none; padding: 0; margin: 18px 0 0; text-align: left; }
.wt-sent-facts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--wt-line); font-size: 14px; }
.wt-sent-facts li:last-child { border-bottom: 0; }
.wt-sent-facts .k { color: var(--wt-muted); }
.wt-sent-facts .v { font-weight: 700; text-align: right; }

/* Review and send + Full report */
.wt-sumof { font-size: 14px; color: var(--wt-muted); font-weight: 600; }
.wt-rows-card { border: 1px solid var(--wt-line); border-radius: 12px; overflow: hidden; }
.wt-rows-card .wt-row:last-child { border-bottom: 0; }
.wt-rowbtn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #eef2f1; cursor: pointer; -webkit-tap-highlight-color: transparent; font: inherit; color: inherit; }
.wt-rowbtn:active { background: var(--wt-bg); }
.wt-rowbtn .wt-nm { font-size: 15px; }
.wt-quote.warn, .wt-status.warn { color: var(--wt-worn-fg); font-style: normal; }
.wt-spots { display: flex; flex-direction: column; gap: 6px; }
.wt-spotbtn { all: unset; cursor: pointer; flex: 1; font: inherit; font-size: 14px; font-weight: 600; color: var(--wt-worn-fg); -webkit-tap-highlight-color: transparent; }
.wt-spots .wt-warnline { align-items: center; }
.wt-mode { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; background: #eef2f1; color: var(--wt-muted); white-space: nowrap; }
.wt-mode.walked { background: var(--wt-good-bg); color: var(--wt-good-fg); }

.wt-appbar-sticky { position: sticky; top: 0; z-index: 5; }
.wt-pills { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; scrollbar-width: none; }
.wt-pills::-webkit-scrollbar { display: none; }
.wt-pill { all: unset; cursor: pointer; flex-shrink: 0; border: 1px solid #cfdad8; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700; color: var(--wt-ink); background: var(--wt-card); -webkit-tap-highlight-color: transparent; }
.wt-pill.active { background: var(--wt-navy); border-color: var(--wt-navy); color: #fff; }

.wt-frbody { padding-bottom: 12px; }
.wt-frroom { padding: 16px 16px 4px; border-bottom: 1px solid var(--wt-line); scroll-margin-top: 130px; }
.wt-frroom:last-of-type { border-bottom: 0; }
.wt-frroom .wt-rows-card { margin-top: 10px; }
.wt-narrblock { margin-top: 10px; border: 1px solid var(--wt-line); border-left: 3px solid var(--wt-teal); border-radius: 0 10px 10px 0; padding: 10px 12px; background: var(--wt-card); }
.wt-narrblock p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--wt-ink); font-family: Georgia, "Times New Roman", serif; }
.wt-narrblock .wt-status { margin-top: 6px; }
.wt-narrblock.fail { border-left-color: #efc27f; background: #fffdf6; }
.wt-media { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.wt-mediavideo { width: 100%; max-height: 220px; border-radius: 10px; background: #14181a; }
.wt-thumb a, .wt-thumb { text-decoration: none; }

/* "Which rooms are here?" — tick rows, items as chips */
.wt-setuprow { border-bottom: 1px solid #eef2f1; background: var(--wt-card); }
.wt-setuprow.open { background: var(--wt-bg); }
.wt-setuprow.off .wt-setupname { color: var(--wt-muted); }
.wt-setuprow-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.wt-tick {
  all: unset; box-sizing: border-box; width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  border: 1.5px solid #cfdad8; background: var(--wt-card); color: #fff; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.wt-tick.on { background: var(--wt-teal); border-color: var(--wt-teal); }
.wt-setupname {
  all: unset; box-sizing: border-box; flex: 1; display: flex; align-items: center; gap: 10px; min-height: 30px;
  font-size: 15px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.wt-setupname > span:first-child { flex: 1; }
.wt-setupname[disabled] { cursor: default; }
.wt-setupname[disabled] .wt-setupchev { opacity: .35; }
.wt-setupchev { color: var(--wt-muted); font-size: 12px; }
.wt-setupchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px 52px; }
.wt-setupchip {
  all: unset; box-sizing: border-box; cursor: pointer; border: 1px solid #cfdad8; border-radius: 999px;
  padding: 6px 11px; font-size: 12.5px; background: var(--wt-card); color: var(--wt-ink);
  -webkit-tap-highlight-color: transparent;
}
.wt-setupchip.dropped { border-style: dashed; color: var(--wt-muted); text-decoration: line-through; background: transparent; }
.wt-setupchip.add { border-color: var(--wt-teal); color: var(--wt-good-fg); font-weight: 700; }
