﻿/* ============================================================
   FixIt app styles (verbatim)
   styles.css + auth.css + ui-hotfix.css + theme.css + a11y.css
   Copied unchanged so the demo renders exactly like the app.
   ============================================================ */

/* ---------- styles.css ---------- */
:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#10223b;background:#f8fafc;--yellow:#F5A623;--muted:#64748b;--green:#1db87a}*{box-sizing:border-box}body{margin:0;min-width:320px}.app-shell{min-height:100vh;padding-bottom:86px}.topbar{height:82px;background:#fff;border-bottom:1px solid #edf1f5;display:flex;align-items:center;padding:0 28px;gap:24px;position:sticky;top:0;z-index:20}#root { width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 0; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; max-width: 100%; }
img, svg, video, canvas { max-width: 100%; }
button, a, input, textarea, select { max-width: 100%; }
/* Never let a flex/grid child create a page-wide overflow strip. */
.app, .page, main, header, section, .content, .screen { min-width: 0; max-width: 100%; }.role-switch{margin:auto;display:flex;background:#f3f5f8;border-radius:999px;padding:4px}.role-switch button{border:0;background:transparent;padding:9px 14px;border-radius:999px;color:var(--muted);cursor:pointer}.role-switch .active{background:#fff;color:#10223b;box-shadow:0 2px 8px #0001}.top-actions{display:flex;align-items:center;gap:18px}.avatar{width:38px;height:38px;border-radius:50%;background:#fff2c7;display:grid;place-items:center;font-weight:800;color:#b77900;border:2px solid #F5A623}.avatar.large{width:76px;height:76px;font-size:25px}.page{width:min(1080px,calc(100% - 36px));margin:28px auto}.hero-card,.pro-card{border-radius:28px;background:linear-gradient(120deg,#FFF8E1,#FFE082);padding:34px;display:flex;justify-content:space-between;gap:24px}.hero-card h1{font-size:clamp(30px,4vw,48px);line-height:1.03;max-width:700px;margin:14px 0}.hero-card p{max-width:680px;color:#53657e;font-size:17px;line-height:1.6}.hero-icon{width:120px;height:120px;border-radius:35px;background:#F5A623;display:grid;place-items:center;align-self:center}.eyebrow{display:inline-flex;align-items:center;gap:7px;font-weight:800;color:#8a6500}.primary,.secondary{border:0;border-radius:16px;padding:14px 20px;font-weight:800;font-size:15px;cursor:pointer}.primary{background:var(--yellow);color:#17233a;display:inline-flex;align-items:center;gap:9px}.secondary{background:#fff;border:1px solid #e5eaf0;margin-top:10px}.section-head{display:flex;align-items:center;justify-content:space-between;margin:30px 4px 14px}.section-head h1,.section-head h2{margin:0}.section-head span,.muted{color:var(--muted)}.card{background:#fff;border:1px solid #edf1f5;border-radius:22px;box-shadow:0 8px 25px #0f172a08}.job-card{padding:14px;display:grid;grid-template-columns:88px 1fr auto;gap:16px;align-items:center;margin-bottom:12px}.job-card img{width:88px;height:88px;border-radius:16px;object-fit:cover}.job-main h3{margin:5px 0 8px}.job-main p{margin:5px 0;color:#66778e;display:flex;align-items:center;gap:5px}.pill,.job-price span{display:inline-block;background:#fff4c9;color:#966c00;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800}.job-price{font-weight:900;font-size:18px;text-align:right}.job-price span{display:block;margin-top:8px;font-size:11px}.passport{padding:22px;display:flex;gap:18px;align-items:center}.pro-card{align-items:center}.pro-card h2{margin:0 0 4px}.pro-card p{margin:0;color:var(--muted)}.rating{margin-top:8px;display:flex;gap:5px;align-items:center;color:#c68b00;font-weight:800}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:16px}.stat{padding:22px}.stat strong{display:block;font-size:27px}.stat span{color:var(--muted)}.request,.message,.setting{display:flex;align-items:center;gap:15px;padding:18px;margin-bottom:12px}.request div,.message div{flex:1}.request h3,.message h3{margin:0 0 4px}.request p,.message p{margin:0;color:var(--muted)}.scan-box{background:#fff;border:2px dashed #f1c442;border-radius:28px;min-height:370px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:35px}.scan-box svg{color:#e7a900}.scan-box p{max-width:550px;color:var(--muted);line-height:1.6}.notice,.chat-note{margin-top:16px;border-radius:18px;padding:16px;background:#ecfff7;color:#176448;display:flex;gap:10px;align-items:flex-start}.map-placeholder{height:440px;border-radius:26px;background:linear-gradient(135deg,#eef2e9,#e6edf7);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:#52667e;margin-bottom:20px}.map-placeholder svg{color:#e7a900}.history-item{display:flex;gap:18px;padding:16px}.history-item img{width:120px;height:100px;object-fit:cover;border-radius:15px}.history-item h3{margin:5px 0}.link{background:none;border:0;padding:0;color:#9b7100;font-weight:800;display:flex;align-items:center;gap:4px}.bottom-nav{position:fixed;bottom:0;left:0;right:0;height:82px;background:#fff;border-top:1px solid #e8edf2;display:flex;align-items:center;justify-content:center;gap:min(7vw,80px);z-index:30}.nav-item{border:0;background:none;color:#738198;display:flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer;font-size:11px}.nav-item svg{width:23px}.nav-item.active{color:#F5A623}.scan-fab{width:62px;height:62px;border-radius:50%;border:5px solid #fff;background:var(--yellow);display:grid;place-items:center;box-shadow:0 7px 20px rgba(245,166,35,0.35);cursor:pointer}.scan-fab svg{width:28px}@media(max-width:700px){.topbar{padding:0 15px;height:72px}.logo{width:118px;height:40px;object-fit:contain;display:block;flex:0 0 auto}.role-switch{display:none}.page{width:calc(100% - 24px);margin:18px auto}.hero-card{padding:24px;border-radius:22px}.hero-icon{display:none}.hero-card h1{font-size:32px}.job-card{grid-template-columns:70px 1fr}.job-card img{width:70px;height:70px}.job-price{grid-column:2;text-align:left}.stats{grid-template-columns:1fr 1fr}.stat:last-child{grid-column:span 2}.bottom-nav{gap:18px}.nav-item span{font-size:10px}.map-placeholder{height:52vh}.history-item img{width:90px;height:80px}}


/* --- Feature: pro map search + urgent requests --- */
.pro-map-card { margin: 14px 0; }
.map-radios { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.map-radios h2 { font-size: 1.05rem; margin: 0; }
.map-radius { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-muted, #64748b); }
.map-radius select { border: 1px solid rgba(0,0,0,.18); border-radius: 8px; padding: 4px 8px; background: var(--bg-card, #fff); color: inherit; min-height: 34px; }
.map-note { margin: 8px 0 0; font-size: 0.82rem; opacity: .7; }
.urgent-tag { display: inline-flex; align-items: center; gap: 4px; background: #dc2626; color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; }
.urgent-headline { border-color: #dc2626; background: rgba(220,38,38,.06); }
.urgent-headline svg { color: #dc2626; }


/* --- Feature: AI scan upgrade (multi-photo / voice / refine) --- */
.scan-photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.photo-thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: rgba(0,0,0,.06); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-add-wrap { position: relative; min-height: 96px; }
.photo-add { border: 2px dashed rgba(0,0,0,.25); background: none; border-radius: 12px; min-height: 96px; width: 100%; height: 100%; display: grid; place-items: center; color: inherit; opacity: .7; cursor: pointer; }
.voice-box { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.voice-note .scan-desc { margin-top: 4px; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.urgent-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; opacity: .85; }
.urgent-toggle input { width: 18px; height: 18px; accent-color: #dc2626; }
.refine-overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.refine-dialog { width: 100%; max-width: 480px; }
.refine-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.refine-head h3 { margin: 0; }
.refine-actions { display: flex; gap: 10px; margin-top: 12px; }

/* --- Feature: professional verification --- */
.verify-upload { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 14px; border: 1px dashed rgba(0,0,0,.3); border-radius: 10px; cursor: pointer; font-size: 0.88rem; }
.verify-upload:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.verified-row { display: inline-flex; align-items: center; gap: 6px; }
.certified-badge { color: #2563eb; }

/* --- Feature: push notifications (in-app bell) --- */
.notif-wrap { position: relative; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 320px; max-width: calc(100vw - 32px); background: var(--bg-card, #fff); border: 1px solid rgba(0,0,0,.12); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); z-index: 1100; overflow: hidden; }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(0,0,0,.08); font-weight: 700; }
.notif-list { list-style: none; margin: 0; padding: 6px 0; max-height: 360px; overflow-y: auto; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid rgba(0,0,0,.06); }
.notif-item:last-child { border-bottom: none; }
.notif-item.read { opacity: .6; }
.notif-item p { margin: 2px 0 4px; font-size: 0.85rem; opacity: .85; }
.notif-time { font-size: 0.72rem; opacity: .6; }
.notif-empty { padding: 18px 14px; text-align: center; opacity: .6; font-size: 0.88rem; }


/* ---------- auth.css ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  background: #f8fafc;
}
.auth-shell .auth-card {
  margin: auto;
  width: min(460px, 100%);
  background: #fff;
  border-radius: 28px;
  border: 1px solid #edf1f5;
  padding: 34px;
  box-shadow: 0 20px 60px rgb(16 34 59 / 0.07);
}
.auth-card.center {
  display: grid;
  place-items: center;
  margin: auto;
}
.auth-card.center .logo.loading {
  width: 190px;
  height: 64px;
  object-fit: contain;
  display: block;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}
.auth-brand img {
  width: 180px;
  height: 60px;
  object-fit: contain;
  display: block;
}
.auth-ticker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: #8a6500;
  background: #fff6d6;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
}
.auth-tabs {
  display: flex;
  background: #f3f5f8;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 11px 0;
  border-radius: 999px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.auth-tabs button.active {
  background: #fff;
  color: #10223b;
  box-shadow: 0 2px 8px #0001;
}
.auth-notice {
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-notice.error { background: #fdecec; color: #b3271f; }
.auth-notice.ok { background: #e7f7ee; color: #147a46; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 13px; font-weight: 700; color: #10223b; }
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #e5eaf0;
  border-radius: 14px;
  padding: 12px 14px;
  color: #8fa0b4;
}
.input-wrap:focus-within { border-color: var(--yellow); }
.input-wrap input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font-size: 15px;
  color: #10223b;
}
.auth-submit {
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-picker button {
  border: 1.5px solid #e5eaf0;
  background: #fff;
  border-radius: 16px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 800;
  color: #10223b;
  font-size: 14px;
}
.role-picker button span { font-weight: 500; font-size: 12px; color: var(--muted); }
.role-picker button.active {
  border-color: var(--yellow);
  background: #fff8df;
  box-shadow: 0 0 0 3px rgb(255 189 22 / 0.25);
}
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #edf1f5; }
.auth-divider.small { margin: 12px 0; }
.auth-divider.small::before, .auth-divider.small::after { background: #f0f3f7; }
.auth-alternates { display: flex; flex-direction: column; gap: 10px; }
.auth-alt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1.5px solid #e5eaf0;
  background: #fff;
  border-radius: 14px;
  padding: 13px;
  font-weight: 700;
  font-size: 14px;
  color: #10223b;
  cursor: pointer;
}
.auth-alt:hover { background: #fafbfd; }
.auth-alt:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-alt .google-g { width: 19px; height: 19px; }
.auth-back {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
}
.auth-legal {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.auth-legal svg { flex-shrink: 0; margin-top: 2px; color: #1db87a; }
.setup-note {
  color: #53657e;
  font-size: 14.5px;
  line-height: 1.6;
  text-align: center;
}
.setup-note code { background: #f3f5f8; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #edf1f5;
  background: #fff;
  color: #53657e;
  cursor: pointer;
}
.icon-btn:hover { background: #fafbfd; }
.card.setting.danger { border-color: #f3d0cd; color: #b3271f; cursor: pointer; }
.card.setting.danger:hover { background: #fdf5f4; }

@media (max-width: 480px) {
  .auth-shell { padding: 14px; }
  .auth-card { padding: 24px; border-radius: 22px; }
  .role-picker { grid-template-columns: 1fr; }
}

/* --- Map Selection Page --- */
.map-shell { padding: 24px; background: #f8fafc; }
.map-card { width: min(560px, 100%); background: #fff; border-radius: 28px; border: 1px solid #edf1f5; padding: 34px; box-shadow: 0 20px 60px rgb(16 34 59 / 0.07); }
.map-header { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 24px; }
.map-header h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.03; margin: 0; }
.map-header p { font-size: 14px; color: var(--muted); margin: 0; }
.map-container { height: 420px; border-radius: 28px; overflow: hidden; margin-bottom: 20px; position: relative; }
.map-controls { display: flex; flex-direction: column; gap: 12px; }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group label { font-size: 13px; font-weight: 700; color: #10223b; }
.control-group .input-wrap { margin-top: 4px; }
.map-info { font-size: 13px; color: var(--muted); }
.map-info div { margin: 4px 0; }
.map-info .coords { color: #7a8699; }
.control-group .input-wrap { margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.control-group .input-wrap input { flex: 1; min-width: 0; }
@media (max-width: 480px) {
  .map-shell { padding: 14px; }
  .map-card { padding: 20px; border-radius: 22px; }
  .map-container { height: 300px; }
}

.loc-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fdecec;
  color: #b3271f;
  font-size: 13px;
  flex-wrap: wrap;
}
.loc-error svg { flex-shrink: 0; }
.loc-error .link { color: #b3271f; text-decoration: underline; margin-left: auto; }

/* --- AI Scan Page (Phase 5) --- */
.scan-page .notice { margin-top: 0; }
.scan-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 22px; }
@media (min-width: 920px) {
  .scan-grid { grid-template-columns: minmax(0, 460px) 1fr; align-items: start; }
}
.photo-col { display: flex; flex-direction: column; gap: 12px; }
.photo-drop {
  min-height: 420px;
  border: 2px dashed #d8e0ea;
  border-radius: 28px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px;
  color: #10223b;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 8px 25px #0f172a08;
}
.photo-drop:hover { border-color: var(--yellow); background: #fffdf4; }
.photo-drop svg { color: #e7a900; }
.photo-drop h2 { margin: 0; font-weight: 900; font-size: 22px; }
.photo-drop p { color: var(--muted); line-height: 1.6; margin: 0; max-width: 380px; font-size: 14.5px; }
.mini-note { font-size: 13px; color: var(--muted); }
.photo-preview-wrap { position: relative; border-radius: 28px; overflow: hidden; box-shadow: 0 8px 25px #0f172a08; }
.photo-preview { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.photo-preview-wrap .reset { position: absolute; top: 12px; right: 12px; background: #fff; box-shadow: 0 4px 14px #0f172a22; }
.analyze { justify-content: center; }
.center-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 60px 30px; text-align: center; }
.center-state h3 { margin: 6px 0 0; }
.center-state p { margin: 0; color: var(--muted); font-size: 14px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-card { padding: 26px; }
.result-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.field-label { font-size: 13px; font-weight: 800; color: #10223b; display: block; margin: 14px 0 8px; }
.category-select {
  border: 1.5px solid #e5eaf0;
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 14px;
  color: #10223b;
  background: #fff;
}
.saved-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  background: #e7f7ee;
  color: #147a46;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
}
.scan-desc {
  width: 100%;
  border: 1.5px solid #e5eaf0;
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: #10223b;
  resize: vertical;
  line-height: 1.55;
}
.scan-desc:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgb(255 189 22 / 0.25); }
.obs-list { margin: 4px 0 0; padding-left: 20px; }
.obs-list li { line-height: 1.55; margin: 5px 0; font-size: 14.5px; }
.empty-note { color: var(--muted); font-size: 14px; }
.causes { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.cause-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; margin-bottom: 5px; }
.cause-row strong { color: #10223b; }
.cause-track { height: 8px; border-radius: 999px; background: #f0f3f7; overflow: hidden; }
.cause-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--yellow), #ffca2b); }
.result-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.result-actions .primary { justify-content: center; }
.result-actions .primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Service Request + Discovery (Phase 6) --- */
.find-page .scan-list { display: flex; flex-direction: column; gap: 14px; }
.scan-card { padding: 20px; }
.scan-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; margin: 4px 0 10px; display: block; background: #eef2f6; }
.scan-thumb-fallback { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: #eef2f6; }
.scan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.scan-date { font-size: 13px; color: var(--muted); }
.scan-desc-text { color: #33475f; line-height: 1.6; margin: 6px 0 10px; font-size: 15px; }
.scan-loc { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.scan-card .primary { justify-content: center; width: 100%; }
.pros-card { margin-top: 26px; padding: 26px; }
.pro-list { display: flex; flex-direction: column; gap: 14px; }
.pro-item { border: 1px solid #edf1f5; border-radius: 18px; padding: 18px; background: #fff; }
.pro-head { display: flex; gap: 14px; align-items: center; }
.pro-head .avatar { flex-shrink: 0; }
.pro-id { flex: 1; min-width: 0; }
.pro-name { font-weight: 900; font-size: 16px; }
.pro-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 4px; }
.pro-meta span { display: inline-flex; align-items: center; gap: 4px; }
.pro-meta svg { color: #e7a900; }
.pro-distance { font-weight: 800; color: #147a46; font-size: 14px; white-space: nowrap; }
.pro-bio { color: #53657e; line-height: 1.55; font-size: 14.5px; margin: 12px 0 0; }
.req-actions { margin-top: 16px; display: flex; }
.req-actions .primary { justify-content: center; }
.claimed-tag, .pending-tag, .accepted-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 13px;
  padding: 7px 11px;
  border-radius: 999px;
}
.claimed-tag, .accepted-tag { background: #e7f7ee; color: #147a46; }
.pending-tag { background: #fff4c9; color: #966c00; }
.open-reqs .notice { margin-top: 0; }
.req-list { display: flex; flex-direction: column; gap: 16px; }
.req-item { display: flex; gap: 18px; padding: 18px; }
.req-img { width: 150px; object-fit: cover; border-radius: 14px; flex-shrink: 0; max-height: 150px; }
.req-body { flex: 1; min-width: 0; }
.req-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.req-desc { line-height: 1.55; margin: 10px 0 6px; font-size: 15px; }
.req-causes { color: #53657e; font-size: 14px; margin: 4px 0; }
.req-causes svg { color: #e7a900; vertical-align: -2px; margin-right: 4px; }
.req-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; margin: 6px 0 0; }
@media (max-width: 640px) {
  .req-item { flex-direction: column; }
  .req-img { width: 100%; max-height: 220px; }
  .pro-head { flex-wrap: wrap; }
  .pro-distance { width: 100%; }
}

/* --- Job state machine + Price negotiation (Phase 7) --- */
.jobs-section { margin-bottom: 28px; }
.jobs-section .section-head h2 { margin: 0; font-size: 20px; }
.job-card-lg { padding: 22px; margin-bottom: 14px; }
.job-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.job-head-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-head h3 { margin: 0; font-size: 16.5px; }
.status-pill {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill.negotiating, .status-pill.price_change_requested { background: #fff4c9; color: #966c00; }
.status-pill.price_agreed { background: #e7f7ee; color: #147a46; }
.status-pill.in_progress { background: #dbeafe; color: #1e40af; }
.status-pill.requested, .status-pill.completed, .status-pill.paid, .status-pill.repair_record_created { background: #eef2f7; color: #53657e; }
.status-pill.payment_pending { background: #fde8e8; color: #b91c1c; }
.status-pill.disputed, .status-pill.abandoned { background: #fde8e8; color: #b91c1c; }
.job-price-line { color: #53657e; font-size: 14.5px; margin: 12px 0 0; }
.job-price-line strong { color: #10223b; }
.proposal-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.proposal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid #edf1f5;
  border-radius: 14px;
  padding: 12px 14px;
}
.proposal-amount { font-weight: 900; color: #10223b; }
.proposal-reason { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.locked-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #147a46;
  font-weight: 800;
  font-size: 13px;
}
.small-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13.5px; border-radius: 12px; }
.danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  border-radius: 12px;
  border: 1.5px solid #f3c6c6;
  background: #fff;
  color: #b91c1c;
  font-weight: 800;
  cursor: pointer;
}
.danger:hover { background: #fde8e8; }
.danger:disabled { opacity: 0.6; cursor: not-allowed; }
.proposal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.proposal-item .mini-note { display: block; }
.job-actions .secondary { justify-content: center; }
.prop-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.prop-form .num-input { width: 150px; }
.prop-form .text-input { flex: 1; min-width: 170px; }
.num-input, .text-input {
  border: 1.5px solid #e5eaf0;
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  color: #10223b;
  background: #fff;
}
.num-input:focus, .text-input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgb(255 189 22 / 0.25); }
.job-actions { margin-top: 16px; display: flex; }
.job-actions .primary { justify-content: center; }
.job-actions.row2 { flex-wrap: wrap; gap: 10px; }
.job-actions.row2 .primary, .job-actions.row2 .secondary { flex: 1; justify-content: center; }

/* --- Completion + Payment (Phase 9) --- */
.photo-section { margin-top: 18px; }
.photo-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 14px; }
.verify-photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.verify-photo-grid .completion-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid #edf1f5; }
.prop-form .file-input { flex: 1; min-width: 170px; font-size: 13.5px; }
.pay-card {
  margin-top: 18px;
  border: 1.5px solid #d7e6f9;
  background: #f4f9ff;
  border-radius: 16px;
  padding: 14px 16px;
}
.pay-head { display: flex; align-items: center; gap: 8px; font-weight: 900; color: #1e40af; font-size: 14px; }
.pay-line { margin: 8px 0 0; color: #33475f; font-size: 14.5px; }
.pay-line strong { color: #10223b; }

/* --- Messaging (Phase 12) --- */
.chat-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #edf1f5;
  background: #fff;
  color: #10223b;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}
.conv-item.active { border-color: var(--yellow); box-shadow: 0 0 0 3px rgb(255 189 22 / 0.2); }
.conv-item .pill { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-thread-wrap {
  border: 1px solid #edf1f5;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 380px;
}
.chat-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 900;
  border-bottom: 1px solid #edf1f5;
}
.chat-thread-head .back { display: none; }
.chat-thread {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 420px;
  background: #fafbfc;
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  background: #fff;
  border: 1px solid #edf1f5;
  align-self: flex-start;
}
.chat-bubble.mine {
  background: #fff8e1;
  border-color: #ffe189;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-bubble p { margin: 0; line-height: 1.45; font-size: 14.5px; color: #10223b; }
.chat-bubble .time { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.chat-input-row { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid #edf1f5; }
.chat-input-row .chat-input { flex: 1; }
.chat-note { padding: 10px 18px 14px; font-size: 13px; color: var(--muted); border-top: 1px dashed #edf1f5; }
@media (max-width: 640px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.has-active .conv-list { display: none; }
  .chat-thread-head .back { display: inline-flex; }
}

/* --- Repair Passport (Phase 13) --- */
.passport-list { display: flex; flex-direction: column; gap: 16px; }
.passport-card { padding: 22px; }
.passport-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.passport-title { margin: 0; font-size: 16.5px; }
.passport-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin: 6px 0; }
.passport-meta strong { color: #10223b; }
.passport-pro { color: #53657e; font-size: 14px; margin: 4px 0 0; }
.passport-warranty { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.warranty-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.warranty-badge.valid { background: #e7f7ee; color: #147a46; }
.warranty-badge.expired { background: #eef2f7; color: #53657e; }
.link {
  background: none;
  border: none;
  color: var(--yellow);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 13.5px;
  padding: 0;
}
.link:hover { text-decoration: underline; }

/* --- Reviews (Phase 14) --- */
.review-section { margin-top: 18px; }
.review-card {
  border: 1.5px solid #e7f7ee;
  background: #f4faf6;
  border-radius: 16px;
  padding: 14px 16px;
}
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-comment { color: #33475f; font-size: 14.5px; margin: 8px 0 0; line-height: 1.5; }
.review-form { display: flex; flex-direction: column; gap: 8px; }
.star-row { display: flex; gap: 4px; color: #e7a900; }
.star-row.disabled { color: #e7a900; cursor: default; }
.star-btn { cursor: pointer; transition: transform 0.1s; }
.star-btn:hover { transform: scale(1.15); }

/* --- Settings page (Phase 15) --- */
.settings-page .settings-section { margin-bottom: 28px; }
.settings-page .settings-section h2 { margin: 0 0 10px; font-size: 18px; }
.setting-col { display: flex; flex-direction: column; gap: 10px; padding: 20px; margin-bottom: 12px; }
.cat-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-toggle {
  border: 1.5px solid #e5eaf0;
  border-radius: 12px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #53657e;
  background: #fff;
  cursor: pointer;
}
.cat-toggle.on { border-color: var(--yellow); background: #fffbea; color: #966c00; }

/* --- Phase 16: real dashboards --- */
.role-pill {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary, #1351a0);
  border: 1.5px solid var(--primary, #1351a0);
  border-radius: 999px;
  padding: 3px 10px;
}
.home-address { display: flex; align-items: center; gap: 10px; color: #64748b; font-size: 14px; margin: 4px 0 18px; }
.stat strong { color: inherit; }
.stat span { color: #7a8699; font-size: 12.5px; }

/* --- Phase 19: reference UI polish --- */
.proof-card {
  background: linear-gradient(150deg, #fff9e6, #fff3c4);
  border-radius: 26px;
  padding: 26px;
  border: 1px solid #ffedb8;
}
.proof-steps { display: flex; flex-direction: column; gap: 16px; }
.proof-step { display: flex; gap: 14px; align-items: flex-start; }
.proof-step-num {
  font-weight: 900;
  font-size: 15px;
  color: #fff;
  background: var(--yellow);
  border-radius: 12px;
  min-width: 44px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0 8px;
}
.proof-step-body { display: flex; gap: 12px; flex: 1; }
.proof-step-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff;
  color: #c68b00;
  display: grid;
  place-items: center;
  border: 1px solid #ffedb8;
  flex-shrink: 0;
}
.proof-step-body strong { display: block; font-size: 15px; }
.proof-step-body p { margin: 2px 0 0; font-size: 13.5px; color: #6b5a1f; line-height: 1.5; }
.proof-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed #e8cf7f;
  font-weight: 700;
  color: #1f7a46;
  font-size: 14px;
}
.proof-footer svg { color: #1db87a; }

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #176448;
  background: #e3f9ec;
  border-radius: 999px;
  padding: 4px 10px;
}
.online-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1db87a;
}
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stats-4 .stat strong { display: flex; align-items: center; gap: 5px; }
.job-list-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.job-list-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff4c9;
  color: #b77900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.job-list-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-list-top h3 { margin: 0; font-size: 16px; }

@media (max-width: 520px) {
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .proof-card { padding: 18px; }
  .proof-step-body { flex-direction: column; align-items: flex-start; }
}
/* --- UI hotfix: real tappable header/settings controls + feedback --- */
.logo { cursor: pointer; }
.avatar-btn {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn {
  border: 0;
  background: none;
  padding: 6px;
  border-radius: 12px;
  cursor: pointer;
  color: #10223b;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active,
.avatar-btn:active,
.back-btn:active,
.setting-row:active {
  transform: scale(0.94);
  opacity: 0.75;
}
.icon-btn:active { background: #f1f5f9; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #10223b;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}

.setting-row {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.setting-row.is-disabled {
  cursor: default;
  opacity: 0.55;
  justify-content: flex-start;
}
.setting-row.is-disabled:active { transform: none; opacity: 0.55; }
.soon-tag {
  margin-left: auto;
  background: #eef2f7;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
}
.section-head h1 { flex: 1; }

/* --- FixIt toast (Phase 3) --- */
.fixit-toast {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: min(92vw, 420px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e6ebf0;
  box-shadow: 0 16px 45px rgba(16, 34, 59, 0.16);
  animation: toast-in 0.22s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.fixit-toast-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffbd16;
  color: #10223b;
  font-weight: 900;
  font-size: 17px;
}
.fixit-toast-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fixit-toast-copy strong { color: #10223b; font-size: 14px; }
.fixit-toast-copy span { color: #64748b; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.fixit-toast-success .fixit-toast-icon { background: #1db87a; color: #fff; }
.fixit-toast-error .fixit-toast-icon { background: #c83b32; color: #fff; }


/* ---------- ui-hotfix.css ---------- */
/* FixIt UI/layout hotfix — Phase 6: responsive overflow hardening */

/* Global sizing root */
html,
body,
#root,
.app-shell,
main,
.settings-page,
.jobs-section,
.chat-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

main.page {
  width: min(1080px, calc(100% - 36px));
  margin-inline: auto;
}

/* Header must never become a wider-than-screen flex row. */
.topbar {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  padding-inline: clamp(10px, 3vw, 28px);
  gap: clamp(8px, 2vw, 18px);
  overflow: visible;
}

.topbar .logo {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: min(180px, 42vw);
  height: 48px;
  object-fit: contain;
  object-position: left center;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 100;
  -webkit-tap-highlight-color: transparent;
}

.top-actions {
  flex: 0 0 auto;
  min-width: 0;
  gap: clamp(7px, 1.8vw, 12px);
  position: relative;
  z-index: 100;
}

.top-actions button,
.top-actions a,
.top-actions .avatar-btn,
.top-actions .icon-btn {
  pointer-events: auto;
  position: relative;
  z-index: 101;
}

/* No invisible element should ever cover the header controls. */
.topbar::before,
.topbar::after {
  pointer-events: none !important;
}

@media (max-width: 480px) {
  .topbar {
    padding-inline: 10px;
    gap: 7px;
  }

  .topbar .logo {
    max-width: 145px;
    height: 42px;
  }

  .role-pill {
    display: none;
  }
}

/* Flex/grid children must never force a page-wide overflow strip. */
.hero-card,
.pro-card,
.section-head,
.job-card-lg,
.proposal-item,
.job-actions,
.prop-form,
.photo-head,
.setting,
.setting-row,
.chat-layout,
.chat-thread-wrap,
.chat-input-row {
  min-width: 0;
  max-width: 100%;
}

.job-main,
.job-head-main,
.chat-thread-wrap,
.chat-thread,
.chat-input-row,
.chat-input-row .chat-input {
  min-width: 0;
}

/* Customer-home cards have no thumbnail. Do not reserve the generic image column. */
.job-card.home-job-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 700px) {
  .home-job-card .job-price {
    grid-column: auto;
  }
}

/* Job card grid: auto price column must be allowed to shrink/wrap. */
.job-card {
  grid-template-columns: 88px minmax(0, 1fr) minmax(0, auto);
}

@media (max-width: 700px) {
  .job-card {
    grid-template-columns: 70px minmax(0, 1fr);
  }
}

/* Settings rows and forms */
.settings-page .setting-row {
  width: 100%;
  max-width: 100%;
}

.settings-page .setting-col,
.settings-page input,
.settings-page textarea,
.settings-page select {
  max-width: 100%;
}

/* Account row: name and role stack instead of colliding on one line. */
.settings-page .setting > div {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.settings-page .setting > div > span:first-child {
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* The theme switch is its own row, so the account-row stacking rule above must
   not turn it into a centred column on wide screens. */
.settings-page .setting > div.theme-toggle-row {
  flex: 1 1 auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-page .setting .mini-note {
  align-self: flex-start;
  border-radius: 999px;
  padding: 2px 9px;
  background: #fff4c9;
  color: #966c00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Long unbroken text must wrap inside its card. */
.card,
.job-main h3,
.job-main p,
.req-desc,
.passport-meta,
.hero-card h1,
.hero-card p,
.setting span,
.conv-item .pill {
  overflow-wrap: anywhere;
}

/* Form controls must never overflow their cards. */
input,
textarea,
select,
button {
  max-width: 100%;
}

textarea {
  overflow-y: auto;
}

/* --- Map page (Phase 20): a full-height map that fills the shell --- */
:root {
  --topbar-h: 82px;
  --nav-h: 82px;
}

@media (max-width: 700px) {
  :root {
    --topbar-h: 72px;
  }
}

/* The map is the page: drop the 1080px reading column and its margins. */
main.page--map {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* The map already subtracts the fixed nav from its own height, so the shell's
   bottom padding would only add a pointless scrollbar under the map. */
.app-shell:has(> main.page--map) {
  padding-bottom: 0;
}

.map-shell {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(8px, 2vw, 18px);
  padding-bottom: 14px;
  height: calc(100dvh - var(--topbar-h) - var(--nav-h));
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.map-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.map-header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  flex: 0 0 auto;
}

.map-header h1 {
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.1;
  margin: 0;
}

.map-header p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--fi-muted, #64748b);
}

.map-selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  background: #ecfff7;
  color: #176448;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--fi-border, #edf1f5);
  background: #eef2f7;
  box-shadow: 0 18px 45px #0f172a12;
}

.map-stage .map-container,
.map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  min-height: 0;
  max-height: none;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

.map-search {
  position: absolute;
  z-index: 1000;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The search bar floats over the top-left corner, so drop Leaflet's zoom
   buttons down instead of leaving them half-hidden behind it. */
.map-stage .leaflet-top {
  top: 64px;
}

.map-search .input-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 0 4px 0 12px;
  background: #fff;
  border: 1px solid var(--fi-border, #edf1f5);
  border-radius: 14px;
  box-shadow: 0 10px 26px #0f172a26;
}

.map-search .input-wrap > svg {
  flex: 0 0 auto;
  color: #94a3b8;
}

.map-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font: inherit;
  font-size: 14px;
  color: var(--fi-text, #10223b);
}

.map-search .icon-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
}

.map-locate-btn {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--fi-border, #edf1f5);
  background: #fff;
  color: #b77900;
  cursor: pointer;
  box-shadow: 0 10px 26px #0f172a26;
}

.map-locate-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.map-sheet {
  position: absolute;
  z-index: 1000;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--fi-border, #edf1f5);
  background: #fff;
  color: #53657e;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 10px 30px #0f172a26;
}

.map-sheet svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.map-sheet.loc-error {
  flex-direction: column;
  background: #fff6f5;
  border-color: #f3d0cd;
  color: #8f2b22;
}

.map-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.map-info {
  min-width: 0;
  font-size: 13px;
  color: var(--fi-muted, #64748b);
}

.map-info .map-address {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--fi-text, #10223b);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.map-info .coords {
  margin-top: 2px;
  font-size: 12px;
  color: #7a8699;
}

.map-message {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: #b77900;
}

.map-save {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .map-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .map-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .map-save {
    justify-content: center;
    width: 100%;
  }
}

/* Short viewports (landscape phones): keep the map usable, hide the tagline. */
@media (max-height: 640px) {
  .map-header p {
    display: none;
  }

  .map-info .coords {
    display: none;
  }
}

/* On a short stage the zoom buttons would sit on top of the pin. */
@media (max-height: 560px) {
  .map-stage .leaflet-control-zoom {
    display: none;
  }
}

/* Disabled controls must not look clickable. */
.primary:disabled,
.secondary:disabled,
.small-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Payment card: state the truth instead of promising a checkout that is not wired. */
.pay-offline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffaf0;
  border: 1px solid #ffe3a8;
  color: #8a6500;
  font-size: 12.5px;
  line-height: 1.45;
}

.pay-offline svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* --- Dispute reason (Phase 8): label on its own line, controls wrap --- */
.job-actions.small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.job-actions.small .mini-note {
  flex: 0 0 100%;
}

.job-actions.small .text-input,
.job-actions.small .text-input.small {
  flex: 1 1 220px;
  width: 100%;
  min-width: 0;
}

.job-actions.small .small-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .job-actions.small .text-input,
  .job-actions.small .text-input.small,
  .job-actions.small .small-btn {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* --- Chat (Phase 7): fully responsive thread, no fixed 420px cap --- */
.chat-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
}

.chat-thread-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.chat-thread {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: clamp(280px, 50vh, 520px);
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-bubble,
.chat-bubble p {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-input-row {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

.chat-input-row .chat-input {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
}

.chat-input-row .small-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .chat-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-thread-wrap {
    min-height: 0;
  }

  .chat-thread {
    height: min(58vh, 520px);
    min-height: 280px;
  }

  .chat-input-row {
    padding: 10px;
    gap: 8px;
  }

  .chat-input-row .chat-input {
    font-size: 14px;
  }
}

/* Phase 17 — map location error handling */

.loc-error {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.loc-error-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.loc-error-main svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.loc-error-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.loc-error-actions .small-btn {
  flex: 0 0 auto;
}

.loc-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef3fc;
  color: #1d4ed8;
  font-size: 13px;
}

.loc-hint svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.map-info .geo-note {
  color: #b45309;
  margin-top: 2px;
}

@media (max-width: 520px) {
  .loc-error-actions {
    width: 100%;
  }

  .loc-error-actions .small-btn {
    flex: 1 1 100%;
    justify-content: center;
    white-space: nowrap;
  }
}

/* Phase 19 — final responsive pass: bottom-nav must fit 320–412px.
   Base gap:min(7vw,80px) + 4 labels + FAB = ~364–379px total, so it
   overflowed (clipped buttons) below ~380px. Tighten at phone widths. */

@media (max-width: 520px) {
  .bottom-nav {
    gap: clamp(10px, 2.5vw, 20px);
    padding-inline: 4px;
  }

  .nav-item {
    flex: 1 1 0;
    min-width: 0;
    font-size: clamp(11px, 3.6vw, 12px);
    gap: 2px;
    white-space: nowrap;
    padding: 2px 5px;
  }

  .nav-item > span:last-child {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
  }
}

/* Phase 18 — global loading rule: retry affordance inside error notices */

.auth-notice .retry-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  padding: 0;
  margin-left: auto;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

/* Scroll safely above the persistent navigation bar on mobile webviews. */
html,
body,
#root {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-shell {
  min-height: 100dvh;
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

main.page {
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* Keep the sign-out action in Settings, in normal document flow. It must never
   float over the form or compete with the header controls. */
.settings-signout {
  width: 100%;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 0;
}

.settings-signout:active {
  transform: scale(0.98);
}

.bottom-nav {
  height: calc(82px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.settings-page .corner-signout {
  /* Legacy compatibility: older markup remains in normal flow. */
  position: static;
  width: 100%;
  justify-content: center;
  margin-top: 24px;
}

.settings-page .corner-signout:active {
  transform: scale(0.96);
}

/* ============================================================
   Dedicated Professional Search screen (overlays the jobs tab so
   the scan list keeps its state/scroll position underneath).
   ============================================================ */

.pro-search {
  position: fixed;
  /* Header-following: the overlay starts exactly below the top bar instead of
     a hardcoded pixel gap, and clears the bottom nav + safe areas. */
  top: calc(var(--topbar-h, 82px) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  background: #f8fafc;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

:root {
  --topbar-h: 82px;
}

@media (max-width: 700px) {
  :root {
    --topbar-h: 72px;
  }
}

.pro-search-inner {
  width: min(1080px, calc(100% - 36px));
  margin-inline: auto;
  padding: 18px 0 calc(24px + env(safe-area-inset-bottom, 0px));
}

.pro-search-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
  min-width: 0;
}

.pro-search-head h1 {
  margin: 0;
  font-size: clamp(19px, 5vw, 24px);
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 1px solid #e5eaf0;
  background: #fff;
  color: #10223b;
  cursor: pointer;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 8px #0f172a0d;
  -webkit-tap-highlight-color: transparent;
}

.back-btn:active {
  transform: scale(0.97);
}

.pro-summary {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pro-summary .scan-thumb {
  aspect-ratio: 16 / 10;
  margin: 0;
}

.pro-summary-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pro-summary-title {
  margin: 6px 0 0;
  font-size: 17px;
}

.pro-summary-desc {
  margin: 0;
  color: #33475f;
  line-height: 1.6;
  font-size: 15px;
}

.pro-summary-list {
  margin: 0;
  padding-left: 20px;
  color: #53657e;
  font-size: 14px;
  line-height: 1.6;
}

.pro-summary-list li {
  margin-bottom: 2px;
}

.verified-badge {
  color: #1db87a;
  vertical-align: -2px;
  margin-left: 5px;
}

.pro-search-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

/* ============================================================
   Full-audit additions: availability toggle, verification panel,
   scan progress steps, and evidence/photo response hardening.
   ============================================================ */

/* Professional availability toggle */
.availability-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid #e5eaf0;
  background: #fff;
  color: #10223b;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.availability-toggle.on {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.availability-toggle.off {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.availability-toggle:disabled {
  opacity: 0.6;
}

/* Scan progress steps */
.scan-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  text-align: left;
}

.scan-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
}

.scan-step.done {
  color: #047857;
}

.scan-step.active {
  color: #10223b;
}

.scan-step svg {
  flex-shrink: 0;
}

.step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Location summary row shown after a scan is saved */
.loc-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 10px 0 4px;
  border-radius: 12px;
  background: #eef3fc;
  color: #1d4ed8;
  font-size: 13px;
}

.loc-summary svg {
  flex-shrink: 0;
}

/* Customer verification panel (RepairVerification) */
.verify-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5eaf0;
  border-radius: 14px;
  background: #fffbf0;
}

.verify-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #10223b;
}

.verify-panel .mini-note {
  margin: 8px 0 0;
}

.verify-panel .job-actions.row2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.verify-panel .job-actions.small {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.verify-panel .job-actions.small .text-input {
  flex: 1 1 240px;
  min-width: 0;
}

.verify-panel .small-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Evidence photo grids */
.photo-section .verify-photo-grid {
  gap: 8px;
  margin: 4px 0 10px;
}

.verify-photo-grid .completion-thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e5eaf0;
  background: #f1f5f9;
}

.photo-section .file-input {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 13px;
}

/* --- AI scan picker: add-photo menu + big remove hit area --- */
.add-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  z-index: 40;
}

.add-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: #10223b;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.add-menu button:hover {
  background: #fffdf4;
}

[data-theme="dark"] .add-menu {
  background: #121a2b;
  border-color: #243047;
}

[data-theme="dark"] .add-menu button {
  color: #e8eef8;
}

[data-theme="dark"] .add-menu button:hover {
  background: #1a2438;
}

/* Padding the remove button's true hit area out to ~42px while keeping the
   30px visual circle. */
.thumb-remove::before {
  content: "";
  position: absolute;
  inset: -6px;
}

/* --- Bottom nav legibility: labels >= 12px, gaps never below 8px --- */
.nav-item {
  font-size: 12px;
}

/* Status pills for service requests */
.accepted-tag,
.pending-tag,
.claimed-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.accepted-tag {
  color: #047857;
  background: #ecfdf5;
}

.pending-tag {
  color: #b45309;
  background: #fffbeb;
}

.claimed-tag {
  color: #047857;
}

/* Full AI report section inside claimed request cards */
.req-ai-report {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.req-ai-report .obs-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #33475f;
  font-size: 13.5px;
  line-height: 1.55;
}

.req-causes {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #1d4ed8;
  font-size: 13px;
  margin: 4px 0;
}

.req-causes svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Proposed-price change form */
.prop-form.change-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e5eaf0;
}

.proposal-item.superseded {
  opacity: 0.55;
}

.proposal-amount {
  font-weight: 800;
  color: #10223b;
}

.proposal-reason {
  display: block;
  color: #64748b;
  font-size: 12.5px;
  margin-top: 2px;
}

/* Payment card clarity */
.pay-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5eaf0;
}

.pay-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #10223b;
}

.pay-line {
  margin: 8px 0 0;
  font-size: 14px;
}

.dispute-note {
  color: #b91c1c;
}

/* Chat thread while lazily loading */
.chat-thread .card.center-state {
  padding: 18px;
  text-align: center;
  color: #64748b;
}

/* Neutralize nested-anchor highlights and keep tap targets */
.prop-form,
.job-actions,
.photo-section,
.review-section,
.verify-panel {
  min-width: 0;
  max-width: 100%;
}

.result-card.center-state .scan-progress {
  margin-inline: auto;
}

/* Congestion fix: a list of jobs should never re-open a stale thread visually */
.chat-thread-wrap {
  min-height: 0;
}

/* Preserve safe-area breathing on the top for fixed overlays */
@media (max-width: 520px) {
  .verify-panel .job-actions.row2 .small-btn,
  .verify-panel .job-actions.small .text-input,
  .verify-panel .job-actions.small .small-btn {
    width: 100%;
    flex: 1 1 100%;
    justify-content: center;
  }

  .file-input {
    flex: 1 1 100%;
  }
}

/* Keep the app header comfortable once a 5th (sign-out) control is present.
   The role pill is hidden <=480px (rules above), so 4 slim controls remain. */
.top-actions .signout-btn {
  color: #53657e;
}

.top-actions .signout-btn:hover {
  color: #b3271f;
  background: #fdf5f4;
}

/* Task 8: "Change" belongs inside the address card next to the address it edits. */
.home-address .link {
  margin-left: auto;
  font-weight: 700;
  white-space: nowrap;
}

/* --- Smart Quote (pack: decision-support estimate, server-authoritative price) --- */
.smart-quote-card {
  margin-top: 14px;
  border-radius: 20px;
  padding: 18px;
  background: #fff8d8;
  border: 1px solid #f0d95c;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.smart-quote-card__title {
  font-weight: 800;
  font-size: 18px;
}

.smart-quote-card__range {
  margin-top: 12px;
  font-weight: 800;
  font-size: 15px;
}

.smart-quote-card__disclaimer {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.72;
}

.smart-quote-card__no-ref {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

.smart-quote-card__body {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.smart-quote-card__muted {
  font-size: 13px;
  opacity: 0.75;
}

.smart-quote-card__parts {
  margin: 6px 0 0 18px;
}

.smart-quote-card__confidence {
  font-size: 12px;
  opacity: 0.7;
}

.smart-quote-card__book {
  width: 100%;
  margin-top: 16px;
  min-height: 48px;
  cursor: pointer;
  justify-content: center;
}

.smart-quote-card__booked {
  margin-top: 16px;
  min-height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.smart-quote-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.smart-quote-badge--within_range {
  background: #eef8ee;
  color: #166534;
}

.smart-quote-badge--below_range {
  background: #eef8ee;
  color: #166534;
}

.smart-quote-badge--above_range {
  background: #fff0e8;
  color: #9a3412;
}

.smart-quote-badge--no_reference {
  background: #f1f5f9;
  color: #475569;
}

.proposal-sq {
  margin-top: 6px;
}

.proposal-sq-reason {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   FIXIT — Persistent Header Fix
   Keeps the global header visible while the main page scrolls.
   Also keeps both versions of the Find Professionals heading visible.
   Applied to source from fixit-persistent-header-fix.zip.
   ============================================================ */

:root {
  --topbar-h: 82px;
}

/* Global app header: fixed to the viewport instead of depending on the
   browser's sticky-scroll behavior. */
.app-shell > .topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--topbar-h) !important;
  z-index: 1000 !important;
}

/* Reserve exactly the same vertical space so page content never hides
   underneath the fixed header. */
.app-shell {
  padding-top: var(--topbar-h) !important;
}

/* Find Professionals page: this heading belongs to the document/body
   scrolling layer, so it sticks directly underneath the global header. */
.find-page > .section-head {
  position: sticky !important;
  top: var(--topbar-h) !important;
  z-index: 100 !important;
  margin-top: 0 !important;
  padding: 16px 4px 14px !important;
  background: var(--fi-bg, #f8fafc) !important;
  border-bottom: 1px solid var(--fi-border, #edf1f5) !important;
}

/* The detailed professional search is a separate fixed scrolling layer.
   Its own heading therefore sticks to the top of THAT scroll container. */
.pro-search-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  margin-top: 0 !important;
  padding: 12px 0 14px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #edf1f5 !important;
}

/* Prevent the search heading's background from becoming transparent when
   the app theme changes. */
[data-theme="dark"] .pro-search-head,
.dark .pro-search-head {
  background: var(--fi-bg, #0f172a) !important;
  border-bottom-color: var(--fi-border, #263244) !important;
}

@media (max-width: 700px) {
  :root {
    --topbar-h: 72px;
  }

  .app-shell > .topbar {
    height: var(--topbar-h) !important;
  }
}

/* iOS/Android safe-area support. The existing app already accounts for
   safe areas in other fixed UI, so only add the top inset to the header. */
@supports (padding-top: env(safe-area-inset-top)) {
  .app-shell > .topbar {
    height: calc(var(--topbar-h) + env(safe-area-inset-top)) !important;
    padding-top: env(safe-area-inset-top) !important;
  }
}

/* Leaflet panes and its controls use z-index up to 1000, so a map that
   scrolls up the page painted over the fixed bottom nav. Keep the nav above
   map content; modals and the refine overlay stay above both. */
.bottom-nav {
  z-index: 1050;
}

/* Long status labels ("Awaiting customer verification") squeeze the job title
   to a few characters on narrow screens, so stack the head there. */
@media (max-width: 520px) {
  .job-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .job-head h3 {
    font-size: 17px;
  }
}


/* ---------- theme.css ---------- */
/* FixIt theme + polish (Bruce 2026-09-21) */

:root {
  --fi-bg: #f8fafc;
  --fi-surface: #ffffff;
  --fi-text: #10223b;
  --fi-muted: #64748b;
  --fi-border: #edf1f5;
  --fi-yellow: #F5A623;
  --fi-green: #1db87a;
  --fi-danger: #c83b32;
  --fi-hero-from: #FFF8E1;
  --fi-hero-to: #FFE082;
  --fi-input-bg: #ffffff;
  --fi-nav-bg: #ffffff;
  --fi-shadow: #0f172a08;
}

[data-theme="dark"] {
  --fi-bg: #0b1220;
  --fi-surface: #121a2b;
  --fi-text: #e8eef8;
  --fi-muted: #9aa8bc;
  --fi-border: #243047;
  --fi-yellow: #F5A623;
  --fi-green: #2dd4a0;
  --fi-danger: #f07167;
  --fi-hero-from: #2a2110;
  --fi-hero-to: #3d2e12;
  --fi-input-bg: #0f172a;
  --fi-nav-bg: #0f172a;
  --fi-shadow: #00000055;
  color-scheme: dark;
}

html, body {
  background: var(--fi-bg);
  color: var(--fi-text);
}

body {
  padding-top: env(safe-area-inset-top, 0px);
}

.app-shell {
  background: var(--fi-bg);
  color: var(--fi-text);
}

.topbar,
.bottom-nav,
.card,
.hero-card,
.pro-card,
.scan-box,
.settings-page .card,
.auth-card {
  background: var(--fi-surface);
  border-color: var(--fi-border);
  color: var(--fi-text);
}

.topbar, .bottom-nav {
  background: var(--fi-nav-bg);
}

.hero-card, .pro-card {
  background: linear-gradient(120deg, var(--fi-hero-from), var(--fi-hero-to));
}

.muted, .mini-note, .section-head span, .nav-item {
  color: var(--fi-muted);
}

.nav-item.active { color: var(--fi-yellow); }

.text-input, .num-input, .scan-desc, .search-field input, textarea, input[type="text"], input[type="search"], input[type="number"], input[type="email"], input[type="password"] {
  background: var(--fi-input-bg);
  color: var(--fi-text);
  border-color: var(--fi-border);
}

.secondary {
  background: var(--fi-surface);
  border-color: var(--fi-border);
  color: var(--fi-text);
}

.pill, .job-price span {
  background: color-mix(in srgb, var(--fi-yellow) 22%, transparent);
  color: #966c00;
}

[data-theme="dark"] .pill,
[data-theme="dark"] .job-price span {
  color: #ffd57a;
}

/* Search */
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-border);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 0 0 16px;
  box-shadow: 0 6px 18px var(--fi-shadow);
}

.search-field input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--fi-text);
  min-width: 0;
}

.search-field svg { color: var(--fi-muted); flex: 0 0 auto; }

.search-clear {
  border: 0;
  background: transparent;
  color: var(--fi-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Unread badges */
.badge-wrap { position: relative; display: inline-flex; }
.nav-badge, .icon-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--fi-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  border: 2px solid var(--fi-nav-bg);
  pointer-events: none;
}
.nav-item .nav-badge { top: -2px; right: calc(50% - 22px); }
.conv-item.has-unread { position: relative; }
.conv-item .conv-unread {
  margin-left: auto;
  background: var(--fi-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 6px;
}

/* Home location CTA */
.home-location-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-top: 16px;
  cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--fi-yellow) 55%, var(--fi-border));
  background: color-mix(in srgb, var(--fi-yellow) 10%, var(--fi-surface));
}
.home-location-cta strong { display: block; margin-bottom: 2px; }
.home-location-cta p { margin: 0; color: var(--fi-muted); font-size: 14px; }
.home-address {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-top: 14px;
}

/* Toast dismiss */
.fixit-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.fixit-toast-dismiss {
  border: 0;
  background: transparent;
  color: var(--fi-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  margin-left: auto;
}

/* Theme toggle row */
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.theme-switch {
  border: 0;
  background: #e8edf5;
  border-radius: 999px;
  padding: 4px;
  display: inline-flex;
  gap: 4px;
  cursor: pointer;
}
[data-theme="dark"] .theme-switch { background: #1c2740; }
.theme-switch span {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--fi-muted);
}
.theme-switch span.on {
  background: var(--fi-surface);
  color: var(--fi-text);
  box-shadow: 0 2px 8px var(--fi-shadow);
}

[data-theme="dark"] .auth-shell,
[data-theme="dark"] .auth-card {
  background: var(--fi-bg);
}
[data-theme="dark"] .auth-card {
  background: var(--fi-surface);
  border-color: var(--fi-border);
}
[data-theme="dark"] .fixit-toast-copy strong { color: var(--fi-text); }
[data-theme="dark"] .fixit-toast-copy span { color: var(--fi-muted); }
[data-theme="dark"] .notice,
[data-theme="dark"] .chat-note {
  background: #12352a;
  color: #a7f3d0;
}

.empty-filter {
  text-align: center;
  padding: 28px 18px;
  color: var(--fi-muted);
}


/* ---------- a11y.css ---------- */
/* ============================================================
   Accessibility pass (Stanley 2026-09-21)
   Touch targets >= 44px, visible keyboard focus, and resets for
   controls that were converted to focusable elements.
   ============================================================ */

/* --- Touch targets: bring undersized controls up to ~44px --- */

.icon-btn {
  width: 44px;
  height: 44px;
}

.avatar-btn {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

.search-clear {
  width: 40px;
  height: 40px;
}

.small-btn {
  min-height: 42px;
}

.link {
  min-height: 28px;
  padding-block: 4px;
}

.fixit-toast-dismiss {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-left: auto;
  margin-top: -4px;
  margin-right: -8px;
  border-radius: 10px;
}

.fixit-toast-dismiss:hover,
.fixit-toast-dismiss:focus-visible {
  background: #f1f5f9;
}

/* Star rating buttons (now real <button>s) */
.star-btn {
  background: none;
  border: 0;
  padding: 8px;
  margin: -4px;
  cursor: pointer;
  color: #e7a900;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.star-btn svg {
  transition: transform 0.1s;
}

.star-btn:hover svg {
  transform: scale(1.15);
}

/* Gallery picker inside the ScanPage photo drop (now a real button) */
.gallery-link {
  background: none;
  border: 0;
  padding: 10px 14px;
  margin-top: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}

.gallery-link:hover,
.gallery-link:focus-visible {
  background: #fffdf4;
}

/* --- Visible keyboard focus --- */

:focus-visible {
  outline: 3px solid var(--yellow, #f5a623);
  outline-offset: 2px;
}

.photo-drop:focus-visible,
.job-card:focus-visible,
.passport.card:focus-visible,
.job-list-card:focus-visible,
.card.request:focus-visible,
.nav-item:focus-visible,
.scan-fab:focus-visible {
  outline: 3px solid var(--yellow, #f5a623);
  outline-offset: 3px;
}

.topbar .logo:focus-visible {
  outline: 3px solid var(--yellow, #f5a623);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Keyboard users can see which conversation / theme is active */
.conv-item:focus-visible {
  border-color: var(--yellow, #f5a623);
}

/* Underline text links from the keyboard so they read as interactive */
.link:focus-visible {
  text-decoration: underline;
}

