/* The Job Address & Contacts screen (View.JobAddressContacts.js) - see
   Scheduler-JobAddressContactsScreen-Design.md. Three columns inside the workbench frame
   (SettingsWorkbench.css gives the header, Apply and the example bar): the Infusion Elite "Manage
   Job" drawing, the rules, and what Tradie will show.

   Colours come from Modern.css's --totm-* tokens where there is one, so Chrome-Neutral and a dark
   chrome follow. The Elite drawing is deliberately NOT themed: it is a picture of another program
   and stays Windows-grey everywhere. */

.JacScreen {
    --jac-site: #1976d2;
    --jac-site-tint: #e8f1fb;
    --jac-site-ink: #0c447c;
    --jac-con: #5e35b1;
    --jac-con-tint: #ede7f6;
    --jac-con-ink: #4527a0;
    --jac-cust: #00796b;
    --jac-cust-tint: #e0f2ef;
    --jac-cust-ink: #00574d;
    --jac-warn: #a15c00;
    --jac-warn-tint: #fef3c7;
    --jac-line: var(--totm-border, #e3e5e9);
    --jac-line-strong: var(--totm-border-strong, #c9ccd1);
    --jac-quiet: var(--totm-text-muted, #5f6368);
    --jac-text: var(--totm-text, #1a1a1a);
    --jac-brand: var(--totm-brand, #1976d2);
    --jac-brand-tint: var(--totm-brand-tint, #e8f1fb);
}

/* ---- the layout: Tradie will show on the left (its two panes side by side), In Infusion Elite on
   the right, each scrolling on its own (design section 12.13) */

.JacLayout {
    display: grid;
    /* The Elite window wants 556px; the two previews share the rest - about 330px each in the
       ~1290px dialog at 1440. */
    grid-template-columns: minmax(0, 1fr) minmax(520px, 572px);
    gap: 16px;
    align-items: start;
}

@media (max-width: 1180px) {
    .JacLayout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.JacColumn {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.JacColumn > h2 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    color: var(--jac-text);
}

.JacColumn > h2 small {
    color: var(--jac-quiet);
    font-weight: 400;
    font-size: 12px;
    text-align: right;
}

.JacScroll {
    min-height: 0;
    flex: 1 1 auto;
}

@media (min-width: 1101px) and (min-height: 620px) {
    @supports selector(:has(*)) {
        #SettingsDialogContent:has(> .JacScreen > .JacLayout) {
            display: flex;
            flex-direction: column;
            height: 95vh;
            max-height: none;
            overflow: hidden;
        }

        #SettingsDialogContent > .JacScreen:has(> .JacLayout) {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
        }

        #SettingsDialogContent > .JacScreen:has(> .JacLayout) > * {
            flex: 0 0 auto;
        }

        #SettingsDialogContent > .JacScreen > .JacLayout {
            flex: 1 1 auto;
            min-height: 0;
            grid-template-rows: minmax(0, 1fr);
            align-items: stretch;
        }

        #SettingsDialogContent .JacScreen .JacScroll {
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-width: thin;
            scrollbar-color: var(--totm-scrollbar, #c1c4c9) transparent;
            padding-right: 6px;
        }
    }
}

/* ---- the example bar's own controls */

.JacExampleRight {
    margin-left: auto;
    color: var(--jac-quiet);
    font-size: 12px;
    text-align: right;
    line-height: 1.3;
}

.JacStatus b {
    font-weight: 600;
}

.JacStatus a {
    color: var(--jac-brand);
}

.JacApplyChange b {
    font-weight: 600;
}

.JacApplyNote {
    margin-top: 6px;
    color: var(--jac-warn);
    font-size: 12px;
}

/* ---- the Infusion Elite "Manage Job" window. Windows-grey on purpose. */

.JacElite {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.3;
    color: #000;
    background: #f0f0f0;
    border: 1px solid #7a95b8;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    /* border-box: the 1px border counts inside the width, so a column narrowed by its own vertical
       scroll bar (572px less ~15px) still holds the window without a horizontal one. */
    box-sizing: border-box;
    width: 100%;
    max-width: 556px;
    text-align: left;
}

/* The drawing is laid out to fit its column; it never scrolls sideways. */
#JacElite.JacScroll {
    overflow-x: hidden;
}

.JacEliteTitle {
    height: 28px;
    background: linear-gradient(#dfe9f5, #c4d5ea);
    border-bottom: 1px solid #9fb4cf;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 8px;
    border-radius: 6px 6px 0 0;
}

.JacEliteTitle .JacEliteIcon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(#5c9bd6, #2a6bb5);
    border: 1px solid #1f4f87;
}

.JacEliteTitle .JacEliteButtons {
    margin-left: auto;
    display: flex;
    gap: 2px;
}

.JacEliteTitle .JacEliteButtons i {
    width: 26px;
    height: 16px;
    border: 1px solid #8ea4c2;
    background: linear-gradient(#fff, #d9e3f0);
    border-radius: 3px;
    display: inline-grid;
    place-items: center;
    font-style: normal;
    font-size: 9px;
}

.JacEliteTitle .JacEliteButtons i.JacEliteClose {
    background: linear-gradient(#e38b7a, #c0392b);
    border-color: #8f2a1f;
    color: #fff;
}

.JacEliteBody {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 6px;
    padding: 6px;
}

.JacEliteTabs {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.JacEliteTab {
    font: inherit;
    font-size: 11.5px;
    border: 1px solid #3a7bd5;
    background: linear-gradient(#ffffff, #e6eef9);
    border-radius: 4px;
    padding: 4px 2px;
    text-align: center;
    cursor: pointer;
    color: #000;
}

.JacEliteTab[aria-selected="true"] {
    background: linear-gradient(#c8dcf6, #9ec1ee);
    font-weight: 600;
}

.JacEliteTab:disabled {
    cursor: default;
    color: #000;
    opacity: 1;
}

.JacEliteTab.JacEliteTabBold {
    font-weight: 700;
    text-decoration: underline;
}

.JacElitePane {
    background: #f0f0f0;
    min-height: 262px;
    padding: 2px 4px;
    position: relative;
}

.JacElitePane[hidden] {
    display: none;
}

.JacEliteLabel {
    color: #000;
}

/* A field. A <button> when it is a source the mapping can use, a <span> otherwise. */
.JacFld {
    position: relative;
    display: block;
    box-sizing: border-box;
    height: 21px;
    min-width: 0;
    width: 100%;
    border: 1px solid #a9a9a9;
    background: #fff;
    padding: 2px 5px;
    margin: 0;
    font: inherit;
    font-size: 12px;
    text-align: left;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0;
}

.JacFld.JacFldRo {
    background: #e9e9e9;
    color: #333;
}

.JacFld.JacFldDrop::after {
    content: "\25BE";
    position: absolute;
    right: 4px;
    top: 2px;
    font-size: 10px;
    color: #333;
}

.JacFld.JacFldRed {
    color: #d2322d;
    border: 0;
    background: none;
}

.JacFld.JacFldBlank {
    color: #9a9a9a;
}

.JacFld.JacFldNotSent {
    background: repeating-linear-gradient(45deg, #f4f4f4 0 4px, #e6e6e6 4px 8px);
    color: #777;
}

button.JacFld {
    cursor: pointer;
}

button.JacFld:hover,
button.JacFld:focus-visible {
    outline: 2px solid #ffb300;
    outline-offset: -1px;
}

.JacFld.JacUsedSite {
    box-shadow: inset 0 0 0 2px var(--jac-site);
}

.JacFld.JacUsedCon {
    box-shadow: inset 0 0 0 2px var(--jac-con);
}

.JacFld.JacUsedCust {
    box-shadow: inset 0 0 0 2px var(--jac-cust);
}

.JacFld.JacUsedSite.JacUsedCon {
    box-shadow: inset 0 0 0 2px var(--jac-site), inset 0 0 0 4px var(--jac-con);
}

/* Which choice a field is: a numeral in its top-right corner, coloured for the target (blue
   Site Address, purple Job Contact, green Customer Details). A tinted numeral is a choice not
   used on this job; amber means it was used as a fallback. The words are on hover and in the
   Use as... menu. */
/* Inside the field, centred on its height: the field clips its overflow (for the text
   ellipsis), so a chip poking above the top edge was cut in half. Several chips overlap a little,
   like a stack, so two still fit in the Details tab's 30px postcode box; each chip's white ring
   keeps them apart. The field reserves room on the right for its chips, so the ellipsis stops
   short of them. */
.JacChips {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    pointer-events: none;
}

.JacChips .JacChip + .JacChip {
    margin-left: -4px;
}

.JacFld:has(.JacChips) {
    padding-right: calc(8px + var(--jac-chip-count, 1) * 9px);
}

.JacFld.JacFldDrop .JacChips {
    right: 16px;
}

.JacChip {
    display: inline-grid;
    place-items: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    font-size: 9.5px;
    font-weight: 700;
    font-family: var(--totm-font, "Segoe UI", Arial, sans-serif);
    line-height: 1;
    color: #fff;
    border: 1.5px solid transparent;
    box-shadow: 0 0 0 1px #fff;
}

.JacChip.JacChipSite { background: var(--jac-site); border-color: var(--jac-site); }
.JacChip.JacChipCon { background: var(--jac-con); border-color: var(--jac-con); }
.JacChip.JacChipCust { background: var(--jac-cust); border-color: var(--jac-cust); }
.JacChip.JacChipUnused.JacChipSite { background: var(--jac-site-tint); color: var(--jac-site-ink); }
.JacChip.JacChipUnused.JacChipCon { background: var(--jac-con-tint); color: var(--jac-con-ink); }
.JacChip.JacChipUnused.JacChipCust { background: var(--jac-cust-tint); color: var(--jac-cust-ink); }
.JacChip.JacChipFallback { background: var(--jac-warn); border-color: var(--jac-warn); color: #fff; }
.JacChip.JacChipHit { outline: 2px solid var(--jac-warn); outline-offset: 1px; }

/* Details tab. The two field columns share what the pane has, in Elite's 196:150 proportion, and
   never more: fixed at 196px and 150px they came to 508px with the gaps, inside a pane that has
   448px at the window's 556px, so Opened By and its column ran out of the window. The label
   columns stay fixed so the labels do not wrap. */
.JacDet {
    display: grid;
    grid-template-columns: 78px minmax(0, 196fr) 66px minmax(0, 150fr);
    column-gap: 6px;
    row-gap: 3px;
    align-items: center;
    margin-top: 4px;
}

.JacDet .JacR { grid-column: 3; text-align: left; }
.JacDet .JacRv { grid-column: 4; }
.JacDet .JacAb { display: grid; grid-template-columns: minmax(0, 140fr) minmax(0, 52fr); gap: 0 4px; min-width: 0; }
.JacDet .JacSmall { display: grid; grid-template-columns: minmax(0, 1fr) 30px 24px; gap: 0 4px; align-items: center; min-width: 0; }

.JacDet .JacSms {
    height: 18px;
    width: 22px;
    border: 1px solid #8ea4c2;
    background: linear-gradient(#fff, #d9e3f0);
    border-radius: 3px;
    font-size: 7px;
    display: grid;
    place-items: center;
}

/* Site Details tab */
.JacSiteWrap { display: flex; gap: 12px; margin-top: 4px; align-items: flex-start; }
.JacSgrid { display: grid; grid-template-columns: 70px 200px; column-gap: 6px; row-gap: 3px; align-items: center; }
.JacSgrid .JacPc { display: grid; grid-template-columns: 140px 54px; gap: 4px; }
.JacSgrid .JacW140 { width: 140px; }
.JacSright { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.JacSright .JacDv { display: grid; grid-template-columns: 62px 1fr; gap: 4px; align-items: center; }
.JacSright .JacInst { border: 1px solid #a9a9a9; background: #fff; height: 96px; }

.JacMapButton,
.JacLabelButton {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #8ea4c2;
    background: linear-gradient(#fff, #d9e3f0);
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 11px;
    margin-right: 6px;
}

/* Contacts tab */
.JacContacts {
    display: grid;
    grid-template-columns: 50px repeat(3, 1fr);
    column-gap: 8px;
    row-gap: 3px;
    align-items: center;
    margin-top: 2px;
    font-size: 11.5px;
}

.JacContacts .JacH { font-size: 11px; color: #000; }
.JacContacts .JacTwo { display: grid; grid-template-columns: 1.6fr 50px 1fr; gap: 3px; align-items: center; min-width: 0; }
.JacContacts .JacTwo .JacEliteLabel { font-size: 10px; text-align: center; white-space: nowrap; }

/* Custom fields tab (Phase 2) */
.JacCustom {
    display: grid;
    grid-template-columns: 60px 1fr;
    column-gap: 6px;
    row-gap: 3px;
    align-items: center;
    margin-top: 4px;
}

/* The customer account, drawn as Elite's own Customer window would show the account's details */
.JacCustomerPane {
    display: grid;
    grid-template-columns: 70px 1fr;
    column-gap: 6px;
    row-gap: 3px;
    align-items: center;
    margin-top: 4px;
}

.JacEliteNote {
    margin-top: 8px;
    color: var(--jac-quiet);
    font-size: 11px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.JacEliteNotice {
    margin: 0 0 8px;
    padding: 6px 8px;
    border-radius: 4px;
    background: var(--jac-warn-tint);
    color: var(--jac-warn);
    font-size: 12px;
}

/* ---- the rules */

.JacCard {
    border: 1px solid var(--jac-line);
    border-radius: 6px;
    background: var(--totm-surface, #fff);
    margin-bottom: 10px;
}

.JacCard h3 {
    margin: 0;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--jac-line);
    display: flex;
    align-items: center;
    gap: 8px;
}

.JacCard h3 small {
    font-weight: 400;
    color: var(--jac-quiet);
    margin-left: auto;
    font-size: 11.5px;
    text-align: right;
}

.JacDot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    flex: none;
}

.JacDot.JacDotSite { background: var(--jac-site); }
.JacDot.JacDotCon { background: var(--jac-con); }
.JacDot.JacDotCust { background: var(--jac-cust); }

.JacPreview h4 {
    margin: 8px 0 4px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--jac-quiet);
}

.JacPreview h4:first-child {
    margin-top: 0;
}

.JacPreviewEmpty {
    padding: 14px;
    background: var(--jac-warn-tint);
    color: var(--jac-warn);
    border-radius: 6px;
    font-size: 12px;
}

/* Scheduler job details pane */
.JacSched {
    border: 1px solid var(--jac-line);
    border-radius: 6px;
    background: var(--totm-surface, #fff);
    overflow: hidden;
}

.JacSched .JacSchedHead {
    background: #e9eef5;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 12.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #27364b;
}

.JacSched .JacSchedHead i {
    width: 16px;
    height: 16px;
    border: 1px solid #b7c2d2;
    border-radius: 3px;
    background: #fff;
    display: inline-block;
}

.JacSched .JacEl {
    padding: 5px 10px;
    border-top: 1px solid var(--jac-line);
}

.JacSched .JacEt {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--jac-quiet);
    margin-bottom: 1px;
}

.JacSched .JacEv {
    font-size: 12.5px;
}

.JacLn {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: baseline;
}

.JacLn > span:first-child {
    overflow-wrap: anywhere;
}

.JacBlank {
    color: var(--jac-quiet);
    font-style: italic;
}

/* Mobile phone - Tradie Classic */
.JacPhone {
    width: 300px;
    max-width: 100%;
    margin: 10px auto 0;
    background: #111;
    border-radius: 26px;
    padding: 10px 8px 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.JacPhone .JacScr {
    background: #f4f4f4;
    border-radius: 16px;
    overflow: hidden;
    color: #1a1a1a;
}

.JacPhone .JacMhd {
    background: #1976d2;
    color: #fff;
    padding: 9px 10px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.JacPhone .JacMhd .JacBack {
    font-size: 16px;
}

.JacPhone .JacMtabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.JacPhone .JacMtabs span {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    color: #555;
}

.JacPhone .JacMtabs span.JacOn {
    color: #1976d2;
    border-bottom: 2px solid #1976d2;
    font-weight: 600;
}

.JacPhone .JacMcard {
    background: #fff;
    margin: 8px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    padding: 8px 10px;
}

.JacPhone .JacMt {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.JacPhone .JacMrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: baseline;
    font-size: 12.5px;
    padding: 1px 0;
}

.JacPhone .JacMrow > :first-child {
    overflow-wrap: anywhere;
}

.JacPhone .JacMrow .JacTel {
    color: #1976d2;
    text-decoration: none;
}

.JacPhone .JacMbtn {
    display: inline-block;
    margin-top: 6px;
    background: #e8f1fb;
    color: #0c447c;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
}

/* source tags beside each affected line */
.JacTag {
    font-size: 10px;
    color: var(--jac-quiet);
    white-space: nowrap;
    font-family: var(--totm-font, inherit);
}

.JacTag::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    margin-right: 3px;
    vertical-align: middle;
    background: #c9ccd1;
}

.JacTag.JacTagSite::before { background: var(--jac-site); }
.JacTag.JacTagCon::before { background: var(--jac-con); }
.JacTag.JacTagCust::before { background: var(--jac-cust); }

.JacLegend {
    margin-top: 8px;
    color: var(--jac-quiet);
    font-size: 11px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.JacBusy {
    opacity: 0.6;
}

/* ---- the buttons that are not buttons

   Scheduler.css's global "button, input[type=button]" rule paints EVERY button solid brand blue,
   with !important on background, colour, padding, weight and radius - so the Elite window's fields
   (real <button>s, for the keyboard), its tabs, the ordinal pills in the Use as... menu and the
   Both / Scheduler / Mobile switch all need !important of their own, as .CreateBookingWeekday
   does. The gradient tabs lose their gradient to the global "background-image: none" and keep a
   flat Windows blue-grey instead. */

.JacElite button.JacFld {
    background-color: #fff !important;
    color: #000 !important;
    padding: 2px 5px !important;
    margin: 0 !important;
    font-weight: 400 !important;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
    border-radius: 0 !important;
    border: 1px solid #a9a9a9;
    text-align: left;
}

.JacElite button.JacFld.JacFldRo {
    background-color: #e9e9e9 !important;
    color: #333 !important;
}

.JacElite button.JacFld.JacFldBlank {
    color: #9a9a9a !important;
}

.JacElite button.JacFld.JacFldNotSent {
    background-color: #ececec !important;
    color: #777 !important;
}

.JacElite button.JacFld:hover {
    background-color: #fff !important;
}

.JacElite button.JacFld.JacFldRo:hover {
    background-color: #e9e9e9 !important;
}

.JacElite button.JacEliteTab {
    background-color: #eaf1fa !important;
    color: #000 !important;
    padding: 4px 2px !important;
    margin: 0 !important;
    font-weight: 400 !important;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
    border-radius: 4px !important;
    border: 1px solid #3a7bd5;
    font-size: 11.5px;
}

.JacElite button.JacEliteTab:hover {
    background-color: #dde9f7 !important;
}

.JacElite button.JacEliteTab[aria-selected="true"] {
    background-color: #a9c8ef !important;
    font-weight: 600 !important;
}

.JacElite button.JacEliteTab.JacEliteTabBold {
    font-weight: 700 !important;
}

.JacElite button.JacEliteTab:disabled {
    background-color: #f3f6fa !important;
    color: #000 !important;
    opacity: 1;
}

.JacSwitch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding-bottom: 3px;
    font-size: 12px;
    color: var(--jac-text);
}

/* ---- the two settings that shape the rules: the preset card and the Split card, at the top of
   the rules column. Each says what its setting does; renderSetup fills in where it stands. */

/* The column is narrow and the Split heading is long, so the note goes under the heading here
   rather than beside it. */
.JacSetupCard h3 {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.JacSetupCard h3 small {
    margin-left: 0;
    text-align: left;
}

.JacSetupCard h3 label {
    font-weight: 600;
}

.JacSetupCard h3 .JacSwitch {
    padding-bottom: 0;
    font-size: 13px;
    font-weight: 600;
}

.JacSetupBody {
    padding: 8px 12px 10px;
    font-size: 12px;
    color: var(--jac-text);
}

.JacSetupBody select {
    font: inherit;
    font-size: 12px;
    height: 26px;
    border: 1px solid var(--jac-line-strong);
    border-radius: 4px;
    background: var(--totm-surface, #fff);
    color: var(--jac-text);
    padding: 0 4px;
    min-width: 200px;
}

.JacSetupAbout {
    margin: 6px 0 0;
    color: var(--jac-quiet);
}

.JacSetupStatus {
    margin: 8px 0 0;
    padding: 6px 8px;
    border-radius: 4px;
    background: var(--jac-brand-tint);
    color: var(--jac-text);
}

.JacSetupStatus b {
    font-weight: 600;
}

.JacSplitSteps {
    margin: 6px 0 0;
    padding-left: 18px;
    color: var(--jac-quiet);
}

.JacSplitSteps li {
    margin: 2px 0;
}

.JacSplitSteps b {
    color: var(--jac-text);
    font-weight: 600;
}

.JacSetupLinks {
    margin: 6px 0 0;
    color: var(--jac-quiet);
}

.JacSettingsLink {
    color: var(--jac-brand);
    white-space: nowrap;
}

/* Split off: the steps read as what WOULD happen, so they are quietened; the status says it is off. */
.JacSetupCard.JacSetupCardOff .JacSplitSteps {
    opacity: 0.7;
}

.JacSetupCard.JacSetupCardOff .JacSetupStatus {
    background: transparent;
    border: 1px dashed var(--jac-line-strong);
}

/* ---- kept simple by default (design section 12.12): "More" links, the Customise switch, the
   "Try a job where it matters" menu, numerals for the line pointed at, and what the changes do.
   Every <button> here needs its own !important look: Scheduler.css paints all of them brand blue. */

.JacScreen [hidden] {
    display: none !important;
}

.JacIntroLinks {
    margin-top: 2px;
    font-size: 12px;
}

.JacIntroLinks a,
.JacMoreLink,
.JacJobLink {
    color: var(--jac-brand);
}

.JacMoreLink {
    font-size: 11.5px;
    white-space: nowrap;
}

.JacSetupMore {
    margin: 6px 0 0;
    color: var(--jac-quiet);
    font-size: 12px;
}

.JacSetupMore p {
    margin: 0 0 4px;
}

#JacElite.JacEliteFocus button.JacFld:not(.JacFldInRule) {
    box-shadow: none;
}

#JacPreview [data-key].JacLnActive {
    background: var(--jac-brand-tint);
    box-shadow: 0 0 0 1px var(--jac-brand);
    border-radius: 3px;
}

/* The bar sits in padding the negative margin gives back, so the text stays in line with its
   neighbours and the bar never runs over its first letter. */
#JacPreview [data-key].JacLnChanged {
    background: var(--jac-warn-tint);
    box-shadow: inset 3px 0 0 var(--jac-warn);
    border-radius: 2px;
    padding-left: 6px;
    margin-left: -6px;
}

#JacPreview [data-key].JacLnChanged.JacLnActive {
    box-shadow: inset 3px 0 0 var(--jac-warn), 0 0 0 1px var(--jac-brand);
}

/* What the changes do to this job */
.JacDiff {
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px solid var(--jac-warn);
    border-radius: 6px;
    background: var(--jac-warn-tint);
    color: #3d2a00;
    font-size: 12px;
}

.JacDiff ul {
    margin: 4px 0 0;
    padding-left: 16px;
}

.JacDiffWhat {
    font-weight: 600;
}

.JacDiffBefore {
    text-decoration: line-through;
    opacity: .75;
}

.JacDiffAfter {
    font-weight: 600;
}

.JacDiff.JacDiffNone {
    border-color: var(--jac-line-strong);
    background: transparent;
    color: var(--jac-text);
}

/* ---- two sides, linked (design section 12.13): the setup row, the two preview panes, clickable
   lines, the link bar, and the x that removes a link on either side */

.JacSetupRow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    margin: 0 0 12px;
}

.JacSetupRow .JacCard {
    margin: 0;
}

@media (max-width: 1000px) {
    .JacSetupRow {
        grid-template-columns: minmax(0, 1fr);
    }
}

.JacPanes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

@media (max-width: 760px) {
    .JacPanes {
        grid-template-columns: minmax(0, 1fr);
    }
}

.JacPane > h4 {
    margin-top: 0;
}

.JacPane .JacPhone {
    margin-top: 0;
}

#JacPreview .JacLnLink {
    cursor: pointer;
    border-radius: 3px;
}

#JacPreview .JacLnLink:hover {
    background: var(--jac-brand-tint);
}

#JacPreview .JacLnLink:focus-visible {
    outline: 2px solid var(--jac-brand);
    outline-offset: 1px;
}

button.JacLnUnlink,
button.JacLinkUnlink,
button.JacLinkClose {
    background-color: transparent !important;
    color: var(--jac-quiet) !important;
    border: 0 !important;
    border-radius: 3px !important;
    padding: 0 4px !important;
    margin: 0 0 0 4px !important;
    min-width: 0 !important;
    height: auto !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer;
}

button.JacLnUnlink:hover,
button.JacLinkUnlink:hover {
    background-color: var(--jac-warn-tint) !important;
    color: var(--jac-warn) !important;
}

button.JacLinkClose:hover {
    background-color: var(--jac-line) !important;
    color: var(--jac-text) !important;
}

#JacPreview .JacLnActive > button.JacLnUnlink {
    justify-self: end;
}

/* The link bar above the Infusion drawing */
.JacLink {
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px dashed var(--jac-line-strong);
    border-radius: 6px;
    color: var(--jac-quiet);
    font-size: 12px;
}

.JacLink.JacLinkActive {
    border: 1px solid var(--jac-brand);
    background: var(--jac-brand-tint);
    color: var(--jac-text);
}

.JacLinkHead {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.JacLinkHead button.JacLinkClose {
    margin-left: auto !important;
}

.JacLinkChain {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin: 6px 0 4px;
}

.JacLinkThen {
    color: var(--jac-quiet);
    font-size: 11.5px;
}

.JacLinkChip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 2px 2px 3px;
    background: var(--totm-surface, #fff);
    border: 1px solid var(--jac-line-strong);
    border-radius: 12px;
}

.JacLinkChip.JacLinkChipUsed {
    border-color: var(--jac-brand);
    box-shadow: 0 0 0 1px var(--jac-brand);
}

.JacLinkNum {
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: var(--jac-brand);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.JacLinkGo {
    color: var(--jac-text);
    text-decoration: none;
}

.JacLinkGo:hover {
    text-decoration: underline;
}

.JacLinkNote {
    margin-top: 2px;
}

/* The selected line's fields on the Infusion drawing: tinted, numbered, with an x. The drawing is
   a picture of another program, so these colours are fixed rather than themed. */
/* !important: the drawing's own .JacElite button.JacFld paints every field white with it. */
#JacElite.JacEliteFocus button.JacFld.JacFldInRule {
    background-color: #fff6cc !important;
}

.JacChips .JacUnlink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-right: 1px;
    border: 1px solid #a15c00;
    border-radius: 7px;
    background: #fff;
    color: #a15c00;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
}

.JacChips .JacUnlink:hover {
    background: #a15c00;
    color: #fff;
}

@keyframes jacFieldFlash {
    0% { box-shadow: 0 0 0 0 rgba(25, 118, 210, .75); }
    100% { box-shadow: 0 0 0 9px rgba(25, 118, 210, 0); }
}

#JacElite button.JacFld.JacFldFlash {
    animation: jacFieldFlash .6s ease-out 2;
}

/* A field drawn so the window looks like Infusion's but not one Tradie can link: the cursor and its
   tooltip say so before a click, and a click puts the reason in the link bar. */
.JacElite .JacFld.JacFldInert {
    cursor: help;
}

.JacElite .JacFld.JacFldInert:focus-visible {
    outline: 2px dotted #5f6368;
    outline-offset: -1px;
}

/* ---- the job picker (design section 12.14): one search over the job list, ‹ › to step, the job on
   show named under it, and the "where it matters" suggestions at the top of its list */

.JacJobPick {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 420px;
    min-width: 0;
}

.JacJobPickLabel {
    font-size: 12px;
    color: var(--jac-quiet);
}

.JacJobPickRow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.JacJobSearchWrap {
    position: relative;
    flex: 1 1 260px;
    max-width: 420px;
}

.JacJobSearchWrap input.JacJobSearch {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid var(--jac-line-strong);
    border-radius: 4px;
    font-size: 13px;
}

.JacJobSearchWrap input.JacJobSearch:focus {
    outline: 2px solid var(--jac-brand);
    outline-offset: -1px;
}

button.JacJobStep,
button.JacJobMatters {
    background-color: var(--totm-surface, #fff) !important;
    color: var(--jac-brand) !important;
    border: 1px solid var(--jac-line-strong) !important;
    border-radius: 4px !important;
    margin: 0 !important;
    cursor: pointer;
}

button.JacJobStep {
    width: 30px;
    height: 30px;
    padding: 0 !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

button.JacJobMatters {
    padding: 5px 10px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    border-color: var(--jac-brand) !important;
}

button.JacJobStep:hover,
button.JacJobMatters:hover {
    background-color: var(--jac-brand-tint) !important;
}

button.JacJobStep:disabled {
    color: var(--jac-quiet) !important;
    cursor: default;
}

.JacJobNow {
    font-size: 12.5px;
    color: var(--jac-text);
}

.JacJobNowLabel,
.JacJobNowBusy {
    color: var(--jac-quiet);
}

.JacJobList {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    min-width: 360px;
    z-index: 60;
    max-height: 380px;
    overflow: auto;
    padding: 4px 0;
    background: var(--totm-surface, #fff);
    color: var(--jac-text);
    border: 1px solid var(--jac-line-strong);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}

.JacJobHead {
    padding: 8px 12px 2px;
    color: var(--jac-quiet);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.JacJobOpt {
    padding: 5px 12px;
    font-size: 12.5px;
    cursor: pointer;
}

.JacJobOpt small {
    display: block;
    color: var(--jac-quiet);
    font-size: 11.5px;
}

.JacJobOpt:hover,
.JacJobOpt.JacJobOptActive {
    background: var(--jac-brand-tint);
}

.JacJobOpt.JacJobOptCurrent b::after {
    content: " (on show)";
    font-weight: 400;
    color: var(--jac-quiet);
}

.JacJobNote {
    padding: 8px 12px;
    color: var(--jac-quiet);
    font-size: 12px;
}

/* ---- where each preview line comes from (design section 12.15): the Infusion field, then its
   fallbacks, under the line - the one this job used in bold, a passed-over one marked blank */

.JacSrc {
    grid-column: 1 / -1;
    margin: 0 0 4px;
    color: var(--jac-quiet);
    font-size: 11px;
    line-height: 1.35;
}

.JacSrcFallbacks {
    padding-left: 10px;
}

.JacSrcItem.JacSrcUsed {
    color: var(--jac-text);
    font-weight: 600;
}

.JacSrcItem.JacSrcBlank {
    opacity: .8;
}

.JacSrcNone {
    font-style: italic;
}

/* On the phone's dark-on-light card the quiet colour is fixed, like the rest of the drawing. */
.JacPhone .JacSrc {
    color: #666;
}

.JacPhone .JacSrcItem.JacSrcUsed {
    color: #1a1a1a;
}
