/* Company Cam: shared layout. Colours and fonts come from brand-wyder.css / brand-redison.css. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.4 var(--font-body);
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}
button, label.btn { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Header */
.top {
  background: var(--header-bg); color: var(--header-ink);
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.top picture, .top img { display: block; height: var(--logo-h, 40px); width: auto; max-width: 62vw; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill {
  font: var(--label-weight) 12px/1 var(--font-label); letter-spacing: var(--label-spacing); text-transform: uppercase;
  padding: 6px 8px; border-radius: 999px; background: color-mix(in srgb, var(--header-ink) 14%, transparent);
}
.pill.wait { background: var(--accent); color: var(--accent-ink); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font: var(--label-weight) 13px/1 var(--font-label);
  background: var(--header-ink); color: var(--header-bg);
}

/* Step bar: 1 Job · 2 Photos · 3 Voice note */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-bottom: 1px solid var(--border); }
.steps button {
  border: 0; background: none; padding: 12px 4px 10px; border-bottom: 4px solid transparent; color: var(--muted);
  font: var(--label-style) var(--label-weight) 13px/1.2 var(--font-label); letter-spacing: var(--label-spacing); text-transform: uppercase;
}
.steps button b { font-weight: inherit; }
.steps button[aria-current="step"] { color: var(--text); border-bottom-color: var(--accent); }
.steps button:disabled { opacity: .45; cursor: default; }

/* Screens */
.screen { display: grid; gap: 14px; }
.title {
  margin: 4px 0 0; font: var(--head-style) var(--head-weight) 28px/1.1 var(--font-head);
  letter-spacing: var(--head-spacing); text-transform: uppercase; display: flex; align-items: baseline; gap: 10px;
}
.title .opt { font: 400 15px/1 var(--font-body); text-transform: none; letter-spacing: 0; color: var(--muted); font-style: normal; }
.job-chip { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.job-chip .job-name { font: var(--label-weight) 15px/1.3 var(--font-label); overflow-wrap: anywhere; }
.job-chip .link { margin-left: auto; border: 0; background: none; font-size: 15px; flex: none; }

/* Steps */
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; display: grid; gap: 22px; }
.step { display: grid; gap: 10px; }
.label {
  font: var(--label-style) var(--label-weight) 13px/1.2 var(--font-label);
  letter-spacing: var(--label-spacing); text-transform: uppercase; color: var(--muted);
  display: flex; align-items: baseline; gap: 8px;
}
.label b { color: var(--text); font-weight: inherit; }
.label .opt { margin-left: auto; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 13px; }

.big {
  width: 100%; min-height: 64px; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--surface); color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px;
  font: var(--head-style) var(--head-weight) 20px/1.1 var(--font-head); letter-spacing: var(--head-spacing); text-transform: uppercase;
  user-select: none; -webkit-user-select: none;
}
.big svg { width: 26px; height: 26px; flex: none; }
.big.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.big:disabled { opacity: .5; cursor: not-allowed; }
.big:focus-visible, .thumb button:focus-visible, .link:focus-within, .job-row:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }


.alt { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 15px; }
.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 2px; }

/* Photo grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; }
.thumb .pick {
  all: unset; display: block; width: 100%; height: 100%; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--surface-2); outline: 0 solid var(--accent-strong); outline-offset: -4px;
}
.thumb .pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .pick[aria-pressed="true"] { outline-width: 4px; }
.thumb .num, .thumb .has-note {
  position: absolute; left: 6px; top: 6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  display: grid; place-items: center; font: 600 13px/1 var(--font-label);
  background: rgba(0,0,0,.6); color: #fff; pointer-events: none;
}
.thumb .pick[aria-pressed="true"] + .num { background: var(--accent); color: var(--accent-ink); }
.thumb .has-note { left: auto; right: 6px; top: auto; bottom: 6px; padding: 0; width: 28px; }
.thumb .has-note svg { width: 16px; height: 16px; }
.thumb .x {
  position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.6); color: #fff; font-size: 20px; line-height: 1; display: grid; place-items: center;
}
.hint { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }

/* Voice */
.talk { touch-action: none; -webkit-touch-callout: none; }
.talk.live { background: var(--live); border-color: var(--live); color: #fff; }
.talk.live svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.live-text { min-height: 1.4em; margin: 0; font-size: 15px; color: var(--muted); text-align: center; font-style: italic; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.note-head { display: flex; align-items: center; gap: 8px; font: var(--label-weight) 13px/1.2 var(--font-label); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.note-head svg { width: 18px; height: 18px; flex: none; }
.note-head button { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 22px; width: 36px; height: 36px; }
.note audio { width: 100%; height: 40px; }
.note textarea {
  width: 100%; font: 15px/1.4 var(--font-body); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; resize: vertical; min-height: 54px;
}
.note .none { margin: 0; font-size: 14px; color: var(--muted); }

/* Outbox */
.outbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.batch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; gap: 4px; }
.batch-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.batch-top .job { font: var(--label-weight) 14px/1.3 var(--font-label); overflow-wrap: anywhere; }
.status { margin-left: auto; font-size: 14px; font-weight: 600; white-space: nowrap; }
.status.ok { color: var(--ok); }
.status.wait { color: var(--danger); }
.batch .meta { font-size: 14px; color: var(--muted); }
.batch details { font-size: 14px; margin-top: 4px; }
.batch summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.files { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.files li { font: 13px/1.35 var(--font-label); overflow-wrap: anywhere; }
.files .st { display: inline-block; width: 1.4em; }
.files pre { white-space: pre-wrap; font: 12px/1.45 var(--font-label); background: var(--surface-2); padding: 8px; border-radius: var(--radius); margin: 4px 0 0; }

.mock {
  font-size: 13px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 10px 12px; display: grid; gap: 8px;
}
.mock label { display: flex; align-items: center; gap: 8px; color: var(--text); }
.mock input { width: 20px; height: 20px; accent-color: var(--accent-strong); }

/* Send bar */
.send-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.send-bar .big { max-width: 528px; margin: 0 auto; min-height: 68px; font-size: 19px; }

/* Job list (screen 1) */
.job-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.job-row {
  all: unset; box-sizing: border-box; width: 100%; min-height: 72px; padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  font: var(--label-weight) 17px/1.3 var(--font-label); overflow-wrap: anywhere;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.job-row:active { background: var(--surface-2); }
.job-row[aria-current="true"] { border-color: var(--accent-strong); }
.job-row .tick { margin-left: auto; flex: none; font-size: 13px; color: var(--muted); word-break: normal; }
.job-row[aria-current="false"] .tick { font-size: 26px; line-height: 1; }

/* In-app camera */
.cam { position: fixed; inset: 0; z-index: 20; background: #000; display: flex; flex-direction: column; }
.cam video { flex: 1; min-height: 0; width: 100%; object-fit: cover; background: #000; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; color: #fff;
  background: linear-gradient(rgba(0,0,0,.6), transparent); font: 500 14px/1.2 var(--font-label); }
.cam-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); background: #000; color: #fff;
}
.cam-done { justify-self: start; min-height: 56px; padding: 0 18px; border-radius: var(--radius); border: 2px solid #fff; background: none; color: #fff;
  font: var(--head-style) var(--head-weight) 18px/1 var(--font-head); text-transform: uppercase; letter-spacing: var(--head-spacing); }
.shutter { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; background: var(--accent); padding: 0; }
.shutter:active { transform: scale(.94); }
.shutter:disabled { opacity: .5; }
.cam-last { justify-self: end; width: 56px; height: 56px; border-radius: var(--radius); overflow: hidden; border: 2px solid #fff; position: relative; background: #222; }
.cam-last img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-last span { position: absolute; right: 2px; bottom: 2px; background: rgba(0,0,0,.7); font: 600 12px/1 var(--font-label); padding: 3px 5px; border-radius: 8px; }
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 21; transition: opacity .25s; }
.flash.on { opacity: .8; transition: none; }
body.cam-open { overflow: hidden; }

.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translateX(-50%) translateY(16px); opacity: 0; transition: .25s; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px; font-size: 15px; font-weight: 500;
  width: max-content; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--danger); color: #fff; }

/* Site photos / Receipts switch (job screen) */
.kind { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind button {
  min-height: 60px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px;
  font: var(--head-style) var(--head-weight) 17px/1.1 var(--font-head); letter-spacing: var(--head-spacing); text-transform: uppercase;
}
.kind button svg { width: 22px; height: 22px; flex: none; }
.kind button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kind button:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.job-row.no-job { border-style: dashed; font-family: var(--font-body); }

/* Add-to-home-screen banner (job screen) */
.install {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--surface); border: 2px solid var(--accent-strong); border-radius: var(--radius);
}
.install img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.install div { display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.install b { color: var(--text); font-size: 15px; }
.install-btn {
  margin-left: auto; flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font: var(--head-style) var(--head-weight) 16px/1 var(--font-head); text-transform: uppercase; letter-spacing: var(--head-spacing);
}
.install-x { flex: none; border: 0; background: none; color: var(--muted); font-size: 24px; width: 40px; height: 44px; margin-left: auto; }
.install-btn:not([hidden]) + .install-x { margin-left: 0; }

/* Sign-in screen */
.hint.left { text-align: left; }
.login { display: grid; gap: 10px; }
.login input {
  width: 100%; min-height: 64px; padding: 12px 16px; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--surface); color: var(--text); text-transform: uppercase; letter-spacing: .12em;
  font: var(--label-weight) 24px/1.2 var(--font-label);
}
.login input:focus { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.login-err { margin: 0; min-height: 1.4em; color: var(--danger); font-weight: 600; font-size: 15px; }
button.avatar { border: 0; padding: 0; cursor: pointer; }
.login input.code { letter-spacing: .2em; }
.login input[type="email"] { text-transform: none; letter-spacing: 0; font: 400 20px/1.2 var(--font-body); }
.login .alt .link { border: 0; background: none; font-size: 15px; }

/* New job form (job screen) */
.newjob input { text-transform: none; letter-spacing: 0; font: 400 20px/1.2 var(--font-body); }
.newjob { padding: 14px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); }
.newjob .alt .link { border: 0; background: none; font-size: 15px; }

/* Logo, band and step bar stay put while the screen scrolls under them */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--header-bg); }
