/* ── Canvassing (FB-197) — the stylesheet every canvassing page and sheet shares (home, street, map, the door
   and bulk sheets). Global rather than scoped because several components draw the same .cv-* parts; every
   class is cv- prefixed. Linked from TradeYoke.Web's App.razor and the MAUI head's index.html (a <HeadContent>
   link is a no-op inside a BlazorWebView). Mobile first: 44px targets everywhere a thumb goes, --ty-* tokens
   only. ── */
/* Full width like Jobs and Customers (.cl / .jl): no centred column, the content area is the page. */
.cv { max-width: none; margin: 0; padding: .75rem .75rem 1.5rem; display: flex; flex-direction: column; gap: .75rem; color: var(--ty-color-text); }
@media (min-width: 48rem) {
    .cv { padding: 1.5rem 1.25rem 4rem; }
    .cv--map { padding: 0; }
}
.cv-head { display: flex; flex-direction: column; gap: .25rem; }
.cv-back { display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; align-self: flex-start; color: var(--ty-color-primary); text-decoration: none; font-weight: 600; font-size: .9rem; }
.cv-title { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: .5rem; }
.cv-title-icon { color: var(--ty-color-primary); }
.cv-lede { margin: 0; color: var(--ty-color-text-muted); font-size: .95rem; }
.cv-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.cv-area { color: var(--ty-color-text-muted); font-weight: 600; margin-right: .25rem; }
.cv-muted { color: var(--ty-color-text-muted); font-size: .85rem; }
.cv-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: var(--ty-color-surface-sunken); color: var(--ty-color-text); border: 1px solid var(--ty-color-border); white-space: nowrap; }
.cv-chip--ref { background: var(--ty-color-primary-soft); color: var(--ty-color-primary-ink); border-color: transparent; }
.cv-chip--today { background: var(--ty-color-primary); color: var(--ty-color-primary-contrast); border-color: transparent; }
.cv-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px;
    background: var(--ty-color-danger); color: #fff; font-size: .75rem; font-weight: 700; }
.cv-error { padding: .6rem .8rem; border-radius: var(--ty-radius-control, 8px); background: var(--ty-color-danger-soft); color: var(--ty-color-danger-ink); }
.cv-error-inline { color: var(--ty-color-danger-ink); font-size: .85rem; }
.cv-hint { color: var(--ty-color-text-muted); font-size: .8rem; }
.cv-field-label { font-size: .8rem; font-weight: 700; color: var(--ty-color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.cv-input { min-height: 44px; padding: .5rem .7rem; border-radius: var(--ty-radius-control, 8px); border: 1px solid var(--ty-color-border-strong);
    background: var(--ty-color-surface); color: var(--ty-color-text); font-size: 1rem; width: 100%; min-width: 0; }
.cv-input:focus-visible { outline: 2px solid var(--ty-color-primary); outline-offset: 1px; }
.cv-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .5rem .9rem; border-radius: var(--ty-radius-control, 8px);
    border: 1px solid var(--ty-color-border-strong); background: var(--ty-color-surface); color: var(--ty-color-text); font-weight: 600; text-decoration: none; cursor: pointer; }
.cv-btn:disabled { opacity: .55; cursor: default; }
.cv-btn--primary { background: var(--ty-color-primary); border-color: var(--ty-color-primary); color: var(--ty-color-primary-contrast); }
/* A link styled as a button keeps its label colour under a theme that colours every anchor (Trusty: blue on blue was an empty button). */
a.cv-btn.cv-btn--primary { color: var(--ty-color-primary-contrast); }
a.cv-btn.cv-btn--danger { color: #fff; }
.cv-btn--danger { background: var(--ty-color-danger); border-color: var(--ty-color-danger); color: #fff; }
.cv-btn--ghost { background: transparent; border-style: dashed; }
.cv-btn--sm { min-height: 40px; padding: .35rem .7rem; font-size: .9rem; }
.cv-linkbtn { background: none; border: 0; padding: .5rem 0; min-height: 44px; color: var(--ty-color-danger-ink); text-decoration: underline; cursor: pointer; align-self: flex-start; }
.cv-iconbtn { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--ty-color-surface-sunken); color: var(--ty-color-text); flex: none; }
.cv-empty { text-align: center; padding: 2rem 1rem; color: var(--ty-color-text-muted); border: 1px dashed var(--ty-color-border-strong); border-radius: var(--ty-radius-card, 12px); }
.cv-empty > i { font-size: 2rem; color: var(--ty-color-primary); }
.cv-empty-title { font-weight: 700; color: var(--ty-color-text); margin-top: .35rem; }

/* What a door wears. Colour from tokens only; every tone also carries an icon and a word, never colour alone. */
.cv-tone--customer { background: var(--ty-color-primary); color: var(--ty-color-primary-contrast); border-color: transparent; }
.cv-tone--booked { background: var(--ty-color-primary-soft); color: var(--ty-color-primary-ink); border-color: var(--ty-color-primary); }
.cv-tone--yes { background: var(--ty-color-success-soft); color: var(--ty-color-success-ink); border-color: var(--ty-color-success); }
.cv-tone--callback { background: var(--ty-color-warning-soft); color: var(--ty-color-warning-ink); border-color: var(--ty-color-warning); }
.cv-tone--tried { background: var(--ty-color-surface-sunken); color: var(--ty-color-text); border-color: var(--ty-color-border-strong); }
.cv-tone--no { background: var(--ty-color-danger-soft); color: var(--ty-color-danger-ink); border-color: var(--ty-color-danger-border, var(--ty-color-border)); }
.cv-tone--closed { background: var(--ty-color-surface-sunken); color: var(--ty-color-text-muted); border-color: var(--ty-color-border); }
.cv-tone--void { background: repeating-linear-gradient(135deg, var(--ty-color-surface-sunken) 0 6px, var(--ty-color-surface-muted, #eef1f5) 6px 12px);
    color: var(--ty-color-text-subtle, #8a95a1); border-color: var(--ty-color-border); border-style: dashed; }
.cv-tone--new { background: var(--ty-color-surface); color: var(--ty-color-text-muted); border-color: var(--ty-color-border-strong); border-style: dashed; }

/* ── The street ── */
.cv-referral { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-primary-soft); color: var(--ty-color-primary-ink); font-weight: 600; }
.cv-sides { display: inline-flex; align-self: flex-start; background: var(--ty-color-surface-sunken); border-radius: 999px; padding: 3px; gap: 2px; }
.cv-side { min-height: 40px; min-width: 64px; padding: 0 .9rem; border: 0; border-radius: 999px; background: transparent; color: var(--ty-color-text-muted); font-weight: 700; }
.cv-side.is-on { background: var(--ty-color-surface); color: var(--ty-color-text); box-shadow: var(--ty-shadow-sm, 0 1px 2px rgba(0,0,0,.08)); }

.cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.cv-door { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 84px; padding: .4rem .3rem;
    border-radius: var(--ty-radius-card, 12px); border: 2px solid; cursor: pointer; text-align: center; transition: transform .12s ease; }
.cv-door:active { transform: scale(.96); }
.cv-door:focus-visible { outline: 3px solid var(--ty-color-primary); outline-offset: 2px; }
.cv-door--sk { border: 0; min-height: 84px; }
.cv-door-num { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.cv-door-icon { font-size: 1rem; }
.cv-door-label { font-size: .72rem; font-weight: 600; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-door-ref { position: absolute; top: 4px; right: 6px; font-size: .75rem; }
.cv-door.is-focus { box-shadow: 0 0 0 3px var(--ty-color-primary); }
.cv-door.is-fresh { animation: cv-pop .5s ease; }
@keyframes cv-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

.cv-add { display: flex; flex-direction: column; gap: .35rem; padding: .75rem; border-radius: var(--ty-radius-card, 12px); background: var(--ty-color-surface-sunken); }
.cv-add-label { font-weight: 700; }
.cv-add-row { display: flex; gap: .5rem; }

/* ── The door sheet: a bottom sheet on a phone, a centred card from 700px ── */
.cv-overlay { position: fixed; inset: 0; background: var(--ty-color-overlay, rgba(12,18,28,.55)); z-index: 1080; }
.cv-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1081; max-height: 88vh; overflow-y: auto;
    background: var(--ty-color-surface); border-radius: 18px 18px 0 0; padding: .5rem 1rem calc(1rem + var(--ty-safe-bottom, env(safe-area-inset-bottom, 0px)));
    display: flex; flex-direction: column; gap: .75rem; box-shadow: 0 -8px 30px rgba(0,0,0,.18); animation: cv-up .2s ease-out; }
@keyframes cv-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.cv-sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--ty-color-border-strong); align-self: center; }
.cv-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.cv-sheet-head > div { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.cv-sheet-title { font-size: 1.25rem; font-weight: 800; margin: 0; width: 100%; }
.cv-sheet-text { margin: 0; }
.cv-sheet-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.cv-lead { display: flex; align-items: center; gap: .4rem; padding: .5rem .7rem; border-radius: var(--ty-radius-control, 8px); background: var(--ty-color-success-soft); color: var(--ty-color-success-ink); }

.cv-price { display: flex; flex-direction: column; gap: .35rem; }
.cv-price-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cv-pchip { min-height: 44px; min-width: 52px; padding: 0 .7rem; border-radius: 999px; border: 1px solid var(--ty-color-border-strong); background: var(--ty-color-surface); font-weight: 700; color: var(--ty-color-text); }
.cv-pchip.is-on { background: var(--ty-color-primary); border-color: var(--ty-color-primary); color: var(--ty-color-primary-contrast); }
.cv-pinput { display: inline-flex; align-items: center; gap: .25rem; font-weight: 700; }
.cv-input--price { width: 96px; }

.cv-outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cv-outcome { display: flex; align-items: center; gap: .5rem; min-height: 56px; padding: .5rem .75rem; border-radius: var(--ty-radius-card, 12px);
    border: 2px solid var(--ty-color-border-strong); background: var(--ty-color-surface); color: var(--ty-color-text); font-weight: 700; text-align: left; font-size: .95rem; }
.cv-outcome > i { font-size: 1.25rem; }
.cv-outcome:disabled { opacity: .5; }
.cv-outcome.is-current { box-shadow: inset 0 0 0 2px var(--ty-color-primary); }
.cv-outcome--quotegiven { border-color: var(--ty-color-success); color: var(--ty-color-success-ink); }
.cv-reason.is-on { background: var(--ty-color-primary); border-color: var(--ty-color-primary); color: var(--ty-color-primary-contrast); }
.cv-outcome--interested { grid-column: 1 / -1; min-height: 64px; justify-content: center; font-size: 1.1rem;
    background: var(--ty-color-success); border-color: var(--ty-color-success); color: #fff; }
.cv-outcome--callback { border-color: var(--ty-color-warning); }
.cv-outcome--notinterested, .cv-outcome--nocanvassing { color: var(--ty-color-danger-ink); }
.cv-callback { display: flex; flex-direction: column; gap: .3rem; max-width: 260px; }

.cv-details { border-top: 1px solid var(--ty-color-border); padding-top: .5rem; }
.cv-details > summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.cv-details-body { display: flex; flex-direction: column; gap: .35rem; }
.cv-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; color: var(--ty-color-text-muted); font-size: .85rem; }
.cv-history i { margin-right: .35rem; }

/* The yes. Short, colourful, over in under a second, and absent under reduced motion. */
.cv-yay { position: relative; overflow: hidden; text-align: center; padding: 1rem; border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-success-soft); color: var(--ty-color-success-ink); animation: cv-pop .45s ease;
    /* The sheet is a flex column with a height cap: without this the celebration (overflow:hidden) was the one item allowed to shrink,
       and on a phone it collapsed to a thin strip with its words clipped away. */
    flex: none; }
.cv-yay-icon { font-size: 2rem; }
.cv-yay-title { font-size: 1.3rem; font-weight: 800; }
.cv-yay-burst span { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; border-radius: 2px;
    background: var(--ty-color-primary); opacity: 0; animation: cv-burst .9s ease-out forwards; animation-delay: calc(var(--i) * 20ms);
    --a: calc(var(--i) * 36deg); }
.cv-yay-burst span:nth-child(odd) { background: var(--ty-color-success); }
.cv-yay-burst span:nth-child(3n) { background: var(--ty-color-warning); }
@keyframes cv-burst {
    0% { opacity: 1; transform: rotate(var(--a)) translateX(0); }
    100% { opacity: 0; transform: rotate(var(--a)) translateX(90px); }
}

@media (min-width: 700px) {
    .cv-sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); border-radius: 18px; animation: none; }
    .cv-sheet-grip { display: none; }
    .cv-outcomes { grid-template-columns: 1fr 1fr 1fr; }
    .cv-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .cv-door, .cv-door.is-fresh, .cv-sheet, .cv-yay, .cv-yay-burst span { animation: none !important; transition: none !important; }
    .cv-yay-burst { display: none; }
}

/* ── Canvassing home: tabs, streets and the pipeline ── */
/* Four tabs do not fit a 390px phone: they scroll sideways rather than squeeze, which is what made each icon overlap its label. */
.cv-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--ty-color-border); overflow-x: auto; scrollbar-width: none; }
.cv-tabs::-webkit-scrollbar { display: none; }
.cv-tab { display: inline-flex; align-items: center; gap: .4rem; flex: 0 0 auto; white-space: nowrap; min-height: 48px; padding: 0 .85rem; border: 0; background: transparent;
    color: var(--ty-color-text-muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.cv-tab.is-on { color: var(--ty-color-primary); border-bottom-color: var(--ty-color-primary); }

.cv-find { display: flex; flex-direction: column; gap: .35rem; position: relative; }
.cv-find-row { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.cv-suggest { display: flex; flex-direction: column; border: 1px solid var(--ty-color-border); border-radius: var(--ty-radius-control, 8px); background: var(--ty-color-surface); }
.cv-suggest-item { min-height: 44px; display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; color: var(--ty-color-text); text-decoration: none; border-bottom: 1px solid var(--ty-color-border-soft, var(--ty-color-border)); }

.cv-list { display: flex; flex-direction: column; gap: .5rem; }
/* Streets and areas are short cards: from tablet up they share the extra width instead of stretching one per row. */
@media (min-width: 48rem) {
    .cv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: .6rem; align-items: start; }
}
.cv-street { display: flex; flex-direction: column; gap: .35rem; padding: .8rem .9rem; border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-surface); border: 1px solid var(--ty-color-border); color: var(--ty-color-text); text-decoration: none; min-height: 64px; }
.cv-street:active { background: var(--ty-color-surface-sunken); }
.cv-street--sk { min-height: 64px; }
.cv-street-top { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.cv-street-name { font-weight: 800; font-size: 1.05rem; }
.cv-street-meta { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .85rem; color: var(--ty-color-text-muted); }
.cv-street-meta i { margin-right: .25rem; }
.cv-street-meta .cv-yes { color: var(--ty-color-success-ink); font-weight: 700; }
.cv-street-when { font-size: .78rem; }
.cv-progress { height: 6px; border-radius: 6px; background: var(--ty-color-surface-sunken); overflow: hidden; }
.cv-progress > span { display: block; height: 100%; background: var(--ty-color-primary); border-radius: 6px; }

.cv-h2 { font-size: 1.05rem; font-weight: 800; margin: 0 0 .25rem; display: flex; align-items: center; gap: .4rem; }
.cv-due { display: flex; flex-direction: column; gap: .4rem; padding: .75rem; border-radius: var(--ty-radius-card, 12px); background: var(--ty-color-warning-soft); }
.cv-card { display: flex; flex-direction: column; gap: .3rem; padding: .65rem .8rem; border-radius: var(--ty-radius-control, 10px); min-height: 56px;
    background: var(--ty-color-surface); border: 1px solid var(--ty-color-border); color: var(--ty-color-text); text-decoration: none; }
.cv-card.is-overdue { border-left: 4px solid var(--ty-color-danger); }
.cv-card-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.cv-card-price { font-weight: 800; color: var(--ty-color-success-ink); }
.cv-card-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ty-color-text-muted); }

.cv-stagepick { display: grid; grid-template-columns: repeat(5, 1fr); gap: .25rem; }
.cv-stagebtn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: .25rem; border-radius: var(--ty-radius-control, 10px);
    border: 1px solid var(--ty-color-border); background: var(--ty-color-surface); color: var(--ty-color-text-muted); font-size: .72rem; font-weight: 700; }
.cv-stagebtn > b { font-size: 1.15rem; color: var(--ty-color-text); }
.cv-stagebtn.is-on { background: var(--ty-color-primary); border-color: var(--ty-color-primary); color: var(--ty-color-primary-contrast); }
.cv-stagebtn.is-on > b { color: var(--ty-color-primary-contrast); }
.cv-pipe-values { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--ty-color-text-muted); font-weight: 600; }

.cv-board { display: block; }
.cv-col { display: none; flex-direction: column; gap: .4rem; }
.cv-col.is-on { display: flex; }
.cv-col-title { display: none; font-size: .9rem; font-weight: 800; margin: 0; align-items: center; gap: .35rem; }
.cv-col-empty { padding: .5rem 0; }

@media (min-width: 640px) {
    .cv-find-row { grid-template-columns: 1fr 160px auto; }
}
@media (min-width: 900px) {
    .cv-stagepick { display: none; }
    .cv-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; align-items: start; }
    .cv-col { display: flex; padding: .5rem; border-radius: var(--ty-radius-card, 12px); background: var(--ty-color-surface-sunken); min-height: 140px; }
    .cv-col-title { display: flex; }
}

/* ── Header row, road state, session bar ── */
.cv-head-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.cv-spacer { flex: 1; }
.cv-roadstate { display: flex; align-items: center; gap: .45rem; padding: .5rem .75rem; border-radius: var(--ty-radius-control, 8px); font-weight: 600; margin-top: .35rem; }
.cv-roadstate--done { background: var(--ty-color-success-soft); color: var(--ty-color-success-ink); }
.cv-roadstate--void { background: repeating-linear-gradient(135deg, var(--ty-color-surface-sunken) 0 8px, var(--ty-color-surface-muted, #eef1f5) 8px 16px);
    color: var(--ty-color-text-muted); }

.cv-session { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-surface-sunken); border: 1px solid var(--ty-color-border); }
.cv-session.is-on { background: var(--ty-color-success-soft); border-color: var(--ty-color-success-border, var(--ty-color-success)); }
.cv-session-dot { width: 12px; height: 12px; border-radius: 999px; background: var(--ty-color-success); flex: none;
    box-shadow: 0 0 0 0 rgba(38,176,80,.5); animation: cv-live 1.8s infinite; }
@keyframes cv-live { 70% { box-shadow: 0 0 0 10px rgba(38,176,80,0); } 100% { box-shadow: 0 0 0 0 rgba(38,176,80,0); } }
.cv-session-text { flex: 1; display: flex; flex-direction: column; font-size: .85rem; line-height: 1.25; min-width: 0; }
.cv-session-text b { font-size: .95rem; }
.cv-session-share { color: var(--ty-color-text-muted); font-size: .78rem; }

/* ── Bulk sheet ── */
.cv-bulk-actions { display: flex; flex-direction: column; gap: .4rem; }
.cv-reasons { display: flex; flex-wrap: wrap; gap: .4rem; }
.cv-reason { min-height: 44px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--ty-color-border-strong);
    background: var(--ty-color-surface); color: var(--ty-color-text); font-weight: 600; }

/* ── Lists: areas, returns ── */
.cv-street--void { opacity: .65; background: repeating-linear-gradient(135deg, var(--ty-color-surface) 0 8px, var(--ty-color-surface-sunken) 8px 16px); }
.cv-street--done .cv-street-name::after { content: " ✓"; color: var(--ty-color-success-ink); }
.cv-street-more { position: absolute; top: .35rem; right: .35rem; width: 44px; height: 44px; border: 0; border-radius: 999px;
    background: transparent; color: var(--ty-color-text-muted); }
.cv-streetwrap { position: relative; }
/* The ⋮ button sits over the card's top-right corner: keep the first line clear of it, and let a long chip
   ("On today's round" at 412px) wrap inside the card rather than run under the button or off the edge. */
.cv-streetwrap { min-width: 0; }
.cv-streetwrap .cv-street { min-width: 0; }
.cv-streetwrap .cv-street-top { padding-right: 2.5rem; min-width: 0; }
.cv-streetwrap .cv-street-top .cv-chip { white-space: normal; max-width: 100%; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.cv-return-reason { font-weight: 700; }
.cv-return-reason--forquote { color: var(--ty-color-success-ink); }
.cv-return-reason--callback, .cv-return-reason--nothome { color: var(--ty-color-warning-ink); }

/* ── The map page: full-screen canvas on a phone, map + side panel from 900px ── */
.cv--map { padding: 0; max-width: none; gap: 0; }
.cv-mapwrap { position: relative; --ty-areamap-h: calc(100dvh - var(--ty-content-clear, 60px) - 128px); --ty-areamap-radius: 0; }
.cv-maptop { position: absolute; z-index: 6; top: .5rem; left: 3.5rem; right: 7rem; display: flex; gap: .4rem; flex-wrap: wrap; pointer-events: none; }
.cv-maptop > * { pointer-events: auto; }
.cv-mapchip { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .75rem; font-size: .9rem; border-radius: 999px; border: 0;
    background: var(--ty-color-surface); color: var(--ty-color-text); font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.18); text-decoration: none; }
.cv-mapchip.is-on { background: var(--ty-color-primary); color: var(--ty-color-primary-contrast); }
.cv-mapchip--draw.is-on { animation: cv-pop .5s ease; }
.cv-mapbottom { position: absolute; z-index: 6; left: .5rem; right: .5rem; bottom: .75rem; display: flex; flex-direction: column; gap: .4rem; pointer-events: none; }
.cv-mapbottom > * { pointer-events: auto; }
.cv-maphint { align-self: center; padding: .45rem .9rem; border-radius: 999px; background: var(--ty-color-ink, #1b2733); color: var(--ty-color-text-onink, #fff);
    font-weight: 700; font-size: .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.cv-legend { display: flex; flex-wrap: wrap; gap: .5rem .9rem; font-size: .8rem; color: var(--ty-color-text-muted); }
.cv-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: .3rem; }
.cv-nomap { padding: 1rem; }
.cv-mappanel { display: flex; flex-direction: column; gap: .6rem; padding: .75rem; }
.cv-layer { display: flex; align-items: center; gap: .6rem; min-height: 48px; border-bottom: 1px solid var(--ty-color-border); }
.cv-layer input { width: 22px; height: 22px; }
.cv-area-row { display: flex; flex-direction: column; gap: .3rem; padding: .65rem .8rem; border-radius: var(--ty-radius-control, 10px);
    border: 1px solid var(--ty-color-border); background: var(--ty-color-surface); color: var(--ty-color-text); text-align: left; width: 100%; min-height: 56px; }
.cv-area-row.is-void { opacity: .7; background: repeating-linear-gradient(135deg, var(--ty-color-surface) 0 8px, var(--ty-color-surface-sunken) 8px 16px); }
.cv-area-top { display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
.cv-area-name { font-weight: 800; }
.cv-assign { display: flex; flex-wrap: wrap; gap: .4rem; }
.cv-roadlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.cv-roadlist li { display: flex; align-items: center; gap: .5rem; min-height: 40px; }
.cv-roadswatch { width: 22px; height: 6px; border-radius: 3px; flex: none; }

@media (min-width: 900px) {
    .cv--map { display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
    .cv-mapwrap { --ty-areamap-h: calc(100vh - var(--ty-content-clear, 60px) - 70px); }
    .cv-mappanel { max-height: calc(100vh - var(--ty-content-clear, 60px) - 70px); overflow-y: auto; border-left: 1px solid var(--ty-color-border); }
}

@media (prefers-reduced-motion: reduce) {
    .cv-session-dot, .cv-mapchip--draw.is-on { animation: none !important; }
}

/* The new-area sheet sits at the foot of the map, never over the border being adjusted. */
.cv-sheet--draft { top: auto !important; bottom: .75rem; transform: translateX(-50%) !important; left: 50%; right: auto;
    width: min(520px, 94vw); border-radius: 18px; max-height: 50vh; z-index: 1081; }
@media (min-width: 900px) {
    .cv--map .cv-sheet--draft { left: calc(250px + (100vw - 250px - 360px) / 2); }
    .cv-maptop { right: 12rem; }
}

/* Phone: Google's map-type switch is hidden there (the Layers list carries it), so the chips can use the width. */
@media (max-width: 47.99rem) {
    .cv-maptop { right: .5rem; left: 3.75rem; }
}

/* Roads search came back partial: say so, and offer the retry beside it. */
.cv-partial { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; justify-content: space-between; padding: .5rem .75rem; border-radius: var(--ty-radius-control, 8px); background: var(--ty-color-warning-soft, #fdf1dd); color: var(--ty-color-warning-ink, #9a5b00); font-size: .85rem; }
.cv-partial i { margin-right: .4rem; }
.cv-partial-flag { color: var(--ty-color-warning, #b36b00); }

/* ── FB-206: the doorstep quote, the Quotes view, progress and the team summary ── */
.cvq-entry { display: grid; grid-template-columns: 1.4fr 1fr; gap: .5rem; }
.cvq-entry-now { font-size: 1.05rem; font-weight: 800; min-height: 52px; }
.cvq { display: flex; flex-direction: column; gap: .55rem; }
.cvq-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .25rem; border-radius: 999px; background: var(--ty-color-surface-2); }
.cvq-mode { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; color: var(--ty-color-text-muted); }
.cvq-mode.is-on { background: var(--ty-color-primary); color: var(--ty-color-primary-contrast); box-shadow: var(--ty-shadow-sm); }
.cvq-hint { margin: 0; font-size: .85rem; color: var(--ty-color-text-muted); }
.cvq-where-row { display: flex; align-items: center; gap: .5rem; }
.cvq-number { width: 5.5rem; font-weight: 800; text-align: center; }
.cvq-street { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.cvq-two { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cvq-two > div, .cvq-prices > div { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.cvq-two .cv-input { width: 100%; min-width: 0; }
/* On a phone the phone row (number + type button) needs the full width, or a whole mobile number is clipped. */
@media (max-width: 480px) { .cvq-two { grid-template-columns: 1fr; } }
.cvq-prices { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cvq-every, .cvq-via { display: flex; flex-wrap: wrap; gap: .4rem; }
.cvq-actions { display: flex; gap: .5rem; }
.cvq-save { flex: 1; font-size: 1.05rem; font-weight: 800; min-height: 52px; }
.cvq-send { display: flex; flex-direction: column; gap: .4rem; }
.cvq-sms { border: 1px solid var(--ty-color-border); border-radius: var(--ty-radius-card, 12px); padding: .6rem; display: flex; flex-direction: column; gap: .4rem; background: var(--ty-color-surface-2); }
.cvq-sms-to { font-size: .8rem; color: var(--ty-color-text-muted); display: flex; gap: .3rem; align-items: center; }
.cvq-sms-bubble { align-self: flex-start; max-width: 92%; padding: .55rem .75rem; border-radius: 16px 16px 16px 4px; background: var(--ty-color-success-soft); color: var(--ty-color-text); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.cvq-sms-meta { font-size: .75rem; color: var(--ty-color-text-muted); }
.cvq-sent { margin: 0; font-weight: 700; color: var(--ty-color-success-ink); }
/* Offline (7 Nov 2026): work waiting on this phone for the office — calm, never an error. */
.cvq-queued, .cvq-waiting { display: flex; align-items: center; gap: .4rem; margin: .25rem 0 0; font-size: .85rem; color: var(--ty-color-text-muted); }
.cvq-queued .bi, .cvq-waiting .bi { color: var(--ty-color-primary); }
.cv-offline-list { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; padding: .6rem .75rem; border-radius: var(--ty-radius-card, 12px); background: var(--ty-color-surface-sunken); border: 1px solid var(--ty-color-border); }
/* On the map: over it, under the chips, so the street-list button is the first thing a thumb finds with no signal. */
.cv-offline-list--map { position: absolute; z-index: 7; top: 7.25rem; left: .75rem; right: .75rem; margin: 0; box-shadow: 0 2px 8px rgba(0,0,0,.18); background: var(--ty-color-surface); }
.cvq-media { display: flex; flex-direction: column; gap: .4rem; }
.cvq-summary { flex-wrap: wrap; }
.cvq-filters { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; padding: .25rem 0; }
.cvq-filter { display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto; min-height: 40px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--ty-color-border-strong); background: var(--ty-color-surface); font-weight: 700; color: var(--ty-color-text); }
.cvq-filter.is-on { background: var(--ty-color-primary); border-color: var(--ty-color-primary); color: var(--ty-color-primary-contrast); }
.cvq-row { display: flex; flex-direction: column; gap: .35rem; padding: .7rem .8rem; border-radius: var(--ty-radius-card, 12px); border: 1px solid var(--ty-color-border); background: var(--ty-color-surface); }
.cvq-row--waiting { border-left: 4px solid var(--ty-color-warning); }
.cvq-row--toquote { border-left: 4px solid var(--ty-color-info); }
.cvq-row--accepted { border-left: 4px solid var(--ty-color-success); }
.cvq-row--declined { opacity: .75; }
.cvq-row-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cvq-row-addr { color: inherit; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.cvq-row-sub, .cvq-row-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .9rem; }
.cvq-row-sub i, .cvq-row-meta i { margin-right: .25rem; }
.cvq-row-meta { color: var(--ty-color-text-muted); font-size: .82rem; }
.cvq-row-price { font-weight: 800; }
.cvq-reply { padding: .4rem .6rem; border-radius: 10px; background: var(--ty-color-info-soft); color: var(--ty-color-info-ink); font-size: .88rem; overflow-wrap: anywhere; }
.cvq-reply i, .cvq-media-count i { margin-right: .35rem; }
.cvq-media-count { font-size: .82rem; color: var(--ty-color-text-muted); display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.cvq-media-cap { padding: .05rem .45rem; border-radius: 999px; background: var(--ty-color-surface-2); }
.cvq-row-acts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cvq-yes { font-weight: 800; flex: 1 1 100%; min-height: 50px; font-size: 1.05rem; }
/* WC-F032: a real (secondary) button, not an underlined word that reads as a link; it sits at the far end of the row, away from the yes. */
.cvq-no { margin-left: auto; color: var(--ty-color-text-muted); }
.cvq-state--waiting { background: var(--ty-color-warning-soft); color: var(--ty-color-warning-ink); }
.cvq-state--toquote { background: var(--ty-color-info-soft); color: var(--ty-color-info-ink); }
.cvq-state--accepted { background: var(--ty-color-success-soft); color: var(--ty-color-success-ink); }
.cvq-state--declined { background: var(--ty-color-surface-2); color: var(--ty-color-text-muted); }
.cvq-tally { margin-top: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.cvq-tally-row { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; padding: .45rem .6rem; border-radius: 10px; background: var(--ty-color-surface-2); }
.cvq-onround .cv-yay-title { font-size: 1.4rem; }
.cvp { display: flex; flex-direction: column; gap: .5rem; padding: .7rem .8rem; border-radius: var(--ty-radius-card, 12px); border: 1px solid var(--ty-color-border); background: linear-gradient(135deg, var(--ty-color-primary-soft), var(--ty-color-surface) 60%); }
.cvp-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cvp-head .cv-h2 { margin: 0; }
.cvp-clock.is-on { background: var(--ty-color-success-soft); color: var(--ty-color-success-ink); border-color: var(--ty-color-success); font-weight: 700; }
.cvp-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ty-color-success); box-shadow: 0 0 0 0 rgba(38,176,80,.5); animation: cv-live 1.6s ease-out infinite; }
.cvp-periods { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cvp-period { display: flex; flex-direction: column; gap: .3rem; padding: .5rem; border-radius: 10px; background: var(--ty-color-surface); min-width: 0; }
.cvp-period-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ty-color-text-muted); }
.cvp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(3.2rem, 1fr)); gap: .25rem; font-size: .72rem; color: var(--ty-color-text-muted); }
.cvp-stats span { display: flex; flex-direction: column; align-items: flex-start; }
.cvp-stats b { font-size: 1.1rem; color: var(--ty-color-text); line-height: 1.1; }
.cvp-money { display: flex; flex-direction: column; }
.cvp-total { font-size: 1.35rem; font-weight: 900; color: var(--ty-color-primary-ink, var(--ty-color-primary)); }
.cvp-split { font-size: .75rem; color: var(--ty-color-text-muted); }
.cvp-lines { list-style: none; margin: 0; padding: 0; font-size: .78rem; display: flex; flex-direction: column; gap: .15rem; }
.cvp-lines li { display: flex; gap: .35rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cvp-lines li.is-provisional { color: var(--ty-color-text-muted); }
.cvt { display: flex; flex-direction: column; gap: .6rem; }
.cvt-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cvt-table-wrap { overflow-x: auto; }
.cvt-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cvt-table th, .cvt-table td { padding: .45rem .5rem; text-align: right; border-bottom: 1px solid var(--ty-color-border); white-space: nowrap; }
.cvt-table th:first-child, .cvt-table td:first-child { text-align: left; }
.cvt-noscheme { display: block; font-size: .72rem; }
@media (prefers-reduced-motion: reduce) { .cvp-dot { animation: none; } }

/* Before the page is interactive a tap would be lost silently (FB-420): nothing can be pressed and it reads as not ready. */
.cv[inert] { opacity: .7; }
