/* Petrol blue and hi-vis lime on warm white. */
:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --ink: #17282c;
  --muted: #56676b;
  --line: #d3d0c6;
  --petrol: #174a54;
  --petrol-2: #24626d;
  --lime: #c8f031;
  --lime-dark: #9cbf1a;
  --danger: #b3261e;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 var(--body);
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Header: plain white bar so the job photos do the talking */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: #fff; color: var(--petrol); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .mark { display: block; border-radius: 9px; }
.brand .name { font: 800 23px/0.95 var(--head); text-transform: uppercase; letter-spacing: 0.01em; }
.brand .name b { display: block; color: var(--lime-dark); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn, .text-btn { background: none; border: 0; color: var(--petrol); padding: 8px; border-radius: 8px; }
.text-btn { font: 700 15px/1 var(--head); text-transform: uppercase; letter-spacing: 0.05em; padding: 9px 11px; border: 1.5px solid var(--line); }
.icon-btn .waves { opacity: 0.35; }
.icon-btn[aria-pressed="true"] { color: var(--petrol); background: var(--lime); }
.icon-btn[aria-pressed="true"] .waves { opacity: 1; }

.chat {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 16px 8px;
  display: flex; flex-direction: column; gap: 12px;
}
.msg { max-width: 92%; padding: 12px 14px; border-radius: 10px; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--petrol); color: #fff; border-bottom-right-radius: 3px; }
.msg.assistant {
  align-self: flex-start; background: var(--card);
  border: 1px solid var(--line); border-left: 5px solid var(--lime);
  border-radius: 4px 10px 10px 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.msg.error { align-self: stretch; background: #fdecea; color: var(--danger); border: 1px solid #f3c2bd; max-width: none; }
.msg p { margin: 0 0 8px; }
.msg p:last-child, .msg ol:last-child, .msg ul:last-child { margin-bottom: 0; }
.msg ul { margin: 0 0 8px; padding-left: 20px; }
.msg ul li::marker { color: var(--petrol-2); }
.msg li { margin-bottom: 5px; }
.msg strong { font-weight: 700; }
.msg h3 { font: 700 19px/1.2 var(--head); text-transform: uppercase; letter-spacing: 0.03em; margin: 6px 0 6px; color: var(--petrol); }
.msg code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: #eeece5; padding: 1px 4px; border-radius: 4px; }

/* Numbered steps get a chunky badge */
.msg ol { list-style: none; margin: 0 0 8px; padding: 0; counter-reset: step calc(var(--start, 1) - 1); }
.msg ol li { counter-increment: step; position: relative; padding-left: 38px; min-height: 28px; margin-bottom: 8px; }
.msg ol li::before {
  content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 27px; height: 27px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--petrol); color: var(--lime);
  font: 800 16px/1 var(--head);
}

.msg .photos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.msg .photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; display: block; border: 2px solid var(--petrol-2); }
.msg.user .photos:last-child { margin-bottom: 0; }
.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--petrol-2); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* Welcome: a real job photo up top, one big button, then the kinds of job it knows */
.welcome { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 6px 0 16px; }
.hero {
  position: relative; min-height: 268px; border-radius: 18px; overflow: hidden;
  display: flex; align-items: flex-end;
  background-color: var(--petrol); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' viewBox='0 0 132 132' fill='none' stroke='white' stroke-opacity='.07' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(10 12)'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.1L3 17.7 6.3 21l6.3-6.3a4 4 0 0 0 5.1-5.4l-2.5 2.5-2.4-.6-.6-2.4z'/%3E%3C/g%3E%3Cg transform='translate(78 20)'%3E%3Cpath d='M12 3c1 3 5 5.5 5 10a5 5 0 0 1-10 0c0-2.5 1.5-4 2.5-5 .3 1.6 1 2.6 2 3 0-3-.5-5.5.5-8z'/%3E%3C/g%3E%3Cg transform='translate(40 72)'%3E%3Cpath d='M12 3.5s6 6.4 6 10.5a6 6 0 0 1-12 0c0-4.1 6-10.5 6-10.5z'/%3E%3C/g%3E%3Cg transform='translate(96 84)'%3E%3Cpath d='M2 6h8a6 6 0 0 1 6 6v8'/%3E%3Cpath d='M2 10h8a2 2 0 0 1 2 2v8'/%3E%3C/g%3E%3C/svg%3E");
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--lime) 0 22px, transparent 22px 30px); opacity: 0.85; }
.hero-tools { position: absolute; top: 14px; right: 14px; width: 96px; height: 96px; }
.hero-tools .sp { fill: var(--lime); stroke: none; }
.hero-tools .sp-front { stroke: var(--petrol); stroke-width: 4; paint-order: stroke; }
.hero-text { position: relative; padding: 20px 18px 24px; color: #fff; }
.edition-tag {
  display: inline-block; padding: 4px 8px; border-radius: 4px; background: var(--lime); color: var(--petrol);
  font: 800 12px/1 var(--head); text-transform: uppercase; letter-spacing: 0.1em;
}
.hero h1 { margin: 10px 0 4px; font: 800 38px/0.95 var(--head); text-transform: uppercase; letter-spacing: 0.01em; }
.hero p { margin: 0; font-size: 15px; color: #d5e2e3; max-width: 30ch; }
.snap-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 64px; padding: 14px 18px; border: 0; border-radius: 14px;
  background: var(--lime); color: var(--petrol);
  font: 800 22px/1 var(--head); text-transform: uppercase; letter-spacing: 0.03em;
  box-shadow: 0 4px 0 var(--lime-dark);
}
.snap-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--lime-dark); }
.snap-btn svg { width: 30px; height: 30px; stroke-width: 2.2; }
.welcome .link-btn { align-self: center; margin-top: -4px; }
.jobs h2 { margin: 6px 0 8px; font: 800 17px/1 var(--head); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.job-cards {
  list-style: none; margin: 0 -16px; padding: 0 16px 4px;
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.job-cards::-webkit-scrollbar { display: none; }
.job-cards li { flex: none; scroll-snap-align: start; }
.job-cards button {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  width: 128px; height: 132px; padding: 14px 12px 12px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; color: var(--petrol); text-align: left;
}
.job-cards svg { width: 40px; height: 40px; padding: 8px; box-sizing: content-box; border-radius: 12px; background: #e6eeee; stroke-width: 1.7; }
.job-cards span { font: 800 16px/1.05 var(--head); text-transform: uppercase; letter-spacing: 0.02em; }
.job-cards button:active { transform: scale(0.97); }
.link-btn { background: none; border: 0; color: var(--petrol); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: 16px; padding: 6px; }
.demo-note { margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--petrol); background: #eef8cf; border: 1px dashed var(--lime-dark); padding: 6px 10px; border-radius: 6px; }

/* Composer */
.composer { background: var(--bg); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.pending { display: flex; gap: 8px; padding: 4px 2px 8px; overflow-x: auto; }
.pending .thumb { position: relative; flex: none; }
.pending img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; border: 2px solid var(--petrol); }
.pending .remove {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--petrol); color: #fff; border: 2px solid #fff; font-size: 13px; line-height: 1; padding: 0;
}
.bar { display: flex; align-items: flex-end; gap: 8px; }
.bar textarea {
  flex: 1; min-width: 0; resize: none; max-height: 140px;
  border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font: inherit; color: var(--ink); background: #fff; outline: none; overflow-y: hidden;
}
.bar textarea:focus { border-color: var(--petrol-2); }
.round { flex: none; width: 48px; height: 48px; border-radius: 10px; border: 0; display: grid; place-items: center; }
.round.camera { background: var(--petrol); color: var(--lime); }
.round.mic { background: #fff; color: var(--petrol); border: 2px solid var(--line); }
.round.mic.listening { background: var(--danger); color: #fff; border-color: var(--danger); animation: pulse 1.4s infinite; }
.round.send { background: var(--lime); color: var(--petrol); }
.round.send svg { stroke-width: 2.6; }
.round.send:disabled { background: #e4e2da; color: #9aa3a5; cursor: default; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0.5); } 100% { box-shadow: 0 0 0 12px rgba(179, 38, 30, 0); } }

@media (min-width: 720px) {
  .chat { padding-left: max(16px, calc(50% - 360px)); padding-right: max(16px, calc(50% - 360px)); }
  .composer > * { max-width: 720px; margin-left: auto; margin-right: auto; }
}

/* Warning and profile sheets */
.sheet {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto;
  display: flex; align-items: flex-end; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(12, 32, 37, 0.6);
}
.sheet-card {
  width: 100%; max-width: 460px; margin: auto 0 0;
  display: flex; flex-direction: column; gap: 14px;
  background: #fff; border-radius: 20px; padding: 22px 20px 18px;
  border-top: 6px solid var(--lime);
}
.sheet-card h2 { margin: 0; font: 800 28px/1 var(--head); text-transform: uppercase; letter-spacing: 0.01em; color: var(--petrol); }
.sheet-badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #e6eeee; color: var(--petrol); }
.sheet-badge.warn { background: #fff1d6; color: #8a5a00; }
.sheet-badge svg { width: 28px; height: 28px; }
.sheet-sub { margin: -6px 0 0; color: var(--muted); font-size: 15px; }
.terms { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.4; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; padding: 4px 0; }
.check input, .radio input { width: 22px; height: 22px; accent-color: var(--petrol); margin: 0; flex: none; }
.primary {
  min-height: 52px; border: 0; border-radius: 12px; background: var(--lime); color: var(--petrol);
  font: 800 20px/1 var(--head); text-transform: uppercase; letter-spacing: 0.04em; box-shadow: 0 3px 0 var(--lime-dark);
}
.primary:disabled { background: #e4e2da; color: #9aa3a5; box-shadow: none; cursor: default; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field select {
  font: 400 17px/1.3 var(--body); color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--petrol-2); }
fieldset.field { flex-direction: row; flex-wrap: wrap; gap: 8px 22px; }
fieldset.field legend { width: 100%; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 16px; }
.hint { font-weight: 400; font-size: 13px; color: var(--muted); margin: 0; }
.form-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; }
.sheet .link-btn { align-self: center; }
@media (min-width: 720px) { .sheet { align-items: center; } .sheet-card { margin: auto; } }
.check.small { align-items: flex-start; font-weight: 500; font-size: 14px; line-height: 1.4; }
.check.small input { margin-top: 1px; }
.sheet a { color: var(--petrol); font-weight: 700; }
.delete-btn { align-self: center; background: none; border: 0; color: var(--danger); font-weight: 600; font-size: 15px; padding: 4px 8px; }
.job-cards.regs button { height: 112px; background: #f0f5e1; border-color: #dbe8b4; }
.job-cards.regs svg { background: #fff; }

/* Accounts, plans and billing */
.field-group { display: flex; flex-direction: column; gap: 14px; }
.form-note { margin: 0; color: var(--petrol); background: #eef8cf; border-radius: 8px; padding: 8px 10px; font-size: 14px; font-weight: 600; }
.secondary {
  min-height: 48px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--petrol);
  font: 800 18px/1 var(--head); text-transform: uppercase; letter-spacing: 0.04em;
}
.danger { min-height: 48px; border: 0; border-radius: 12px; background: var(--danger); color: #fff; font: 800 18px/1 var(--head); text-transform: uppercase; letter-spacing: 0.04em; }
.delete-box { display: flex; flex-direction: column; gap: 10px; border: 2px solid #f3c2bd; background: #fdecea; border-radius: 12px; padding: 12px; }
.delete-box p { margin: 0; font-size: 14px; }
.plan-box { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: #e6eeee; }
.plan-name { font: 800 22px/1 var(--head); text-transform: uppercase; letter-spacing: 0.02em; color: var(--petrol); }
.plan-usage { font-size: 15px; color: var(--ink); }
.meter { height: 8px; border-radius: 4px; background: #fff; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--petrol); border-radius: 4px; }
.meter span.low { background: var(--danger); }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; text-align: left;
  padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink);
}
.plan-card.best { border-color: var(--petrol); background: #f3f8f8; }
.plan-card .pc-name { font: 800 22px/1 var(--head); text-transform: uppercase; color: var(--petrol); }
.plan-card .pc-price { font: 800 26px/1 var(--head); color: var(--petrol); text-align: right; }
.plan-card .pc-price small { font: 600 13px var(--body); color: var(--muted); }
.plan-card .pc-detail { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.plan-card .pc-tag { justify-self: start; grid-column: 1 / -1; padding: 3px 7px; border-radius: 4px; background: var(--lime); color: var(--petrol); font: 800 11px/1 var(--head); text-transform: uppercase; letter-spacing: 0.08em; }
.plan-card:disabled { opacity: 0.6; }
.status-note { margin: 0; text-align: center; font-size: 14px; color: var(--petrol); background: #e6eeee; padding: 8px 12px; border-radius: 10px; }
.status-note button { background: none; border: 0; padding: 0; color: var(--petrol); font-weight: 700; text-decoration: underline; }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--petrol); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Hands-free button */
#handsFreeBtn[aria-pressed="true"] { color: var(--petrol); background: var(--lime); }
.hf-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: var(--lime); color: var(--petrol); font: 800 15px/1.2 var(--head); text-transform: uppercase; letter-spacing: 0.06em; }
.hf-banner button { background: var(--petrol); color: #fff; border: 0; border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px; }

/* Waiting for signal */
.msg.waiting { align-self: flex-start; background: #fff6d6; border: 1px dashed #c9a24a; color: #6b4e00; font-size: 15px; }
.msg.waiting button { background: none; border: 0; padding: 0; margin-left: 6px; color: var(--petrol); font-weight: 700; text-decoration: underline; }

/* Photo thumbnails: draw button */
.pending .draw { position: absolute; left: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; padding: 0; border: 2px solid #fff; background: var(--lime); color: var(--petrol); display: grid; place-items: center; }
.pending .draw svg { width: 14px; height: 14px; stroke-width: 2.4; }

/* Drawing screen */
.draw-sheet { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; background: #0d1b1e; color: #fff;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.draw-top, .draw-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.draw-tools { justify-content: center; }
.draw-title { font: 800 18px/1 var(--head); text-transform: uppercase; letter-spacing: 0.04em; }
.draw-area { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 10px; }
.draw-area canvas { max-width: 100%; max-height: 100%; touch-action: none; border-radius: 8px; background: #000; }
.draw-btn { background: rgba(255, 255, 255, 0.12); color: #fff; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.draw-btn.done { background: var(--lime); color: var(--petrol); font-weight: 800; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.3); padding: 0; }
.swatch[aria-pressed="true"] { border-color: #fff; transform: scale(1.1); }

/* Parts for this job: merchant links */
.parts-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.parts-links a { font-size: 13px; font-weight: 700; color: var(--petrol); background: #e6eeee; border-radius: 6px; padding: 4px 8px; text-decoration: none; }
.parts-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* Header fits five controls on a small phone */
.top-actions { gap: 2px; }
.top .icon-btn { padding: 6px; }
.top .text-btn { white-space: nowrap; padding: 9px 9px; margin-left: 2px; }
@media (max-width: 380px) { .brand .name { font-size: 21px; } .brand .mark { width: 30px; height: 30px; } }
