/* Mechanics Schedule page only — 4 columns: Job Name | Start Date | Site Manager | Mechanics */

.mechanic-page{
    margin: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.mechanic-page .pannel{
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mechanic-page .pTop{
    flex-shrink: 0;
    border-bottom: 2px solid #000000;
    padding: 1%;
    padding-top: max(1%, env(safe-area-inset-top));
}

.mechanic-page .pBottom{
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 5%;
    padding-top: 24px;
}

.mechanic-page .scroll-area{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.mechanic-page .scroll-area::-webkit-scrollbar{
    display: none;
}

.mechanic-page .columns-wrap{
    display: flex;
    gap: 32px;
}

.mechanic-page .col{
    flex: 1;
    min-width: 0;
}

/* Table */
.mechanic-page .row-head,
.mechanic-page .job-row{
    display: grid;
    grid-template-columns: 2.2fr 0.8fr 1.1fr 0.6fr 1.4fr; /* name, start, manager, hoist, GC */
    align-items: center;
}

.mechanic-page .row-head{
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #f2f2f2;
    border-bottom: 2px solid #000000;
    font-weight: bold;
}

.mechanic-page .row-head > div,
.mechanic-page .job-row > div{
    padding: 10px 12px;
    text-align: left;
    min-width: 0;
}

.mechanic-page .job-row{
    border-bottom: 1px solid #ececec;
    background: #fff;
}

.mechanic-page .rows-container .job-row:nth-child(even){
    background: #f7f7f7;
}

.mechanic-page .rows-container .job-row.highlight{
    background-color: #e4e4e3;
}

.mechanic-page .job-row .name{
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #111;
}

.mechanic-page .name-text{
    flex: 1;
    min-width: 0;
}

.mechanic-page .job-gc{
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #777;
    margin-top: 2px;
}

.mechanic-page .job-row .startdate{
    color: #222;
    white-space: nowrap;
}

/* Site Manager: one name */
.mechanic-page .job-row .site-manager{
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Manager dropdown (Moishy / Yoely / David) */
.mechanic-page .manager-select{
    width: 100%;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 28px 6px 10px;
    font-family: inherit;
    font-size: 13px;
    color: #111;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
}

.mechanic-page .manager-select:focus{
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(245, 168, 0, 0.2);
}

/* nothing picked yet — gray "Manager" */
.mechanic-page .manager-select:has(option[value=""]:checked){
    color: #999;
}

.mechanic-page .mech-chip{
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f2f2f2;
    border: 1px solid #e2e2e2;
    color: #222;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Tap a job → its elevators drop down under it */
.mechanic-page .job-row{
    cursor: pointer;
}

.mechanic-page .expand-icon{
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s;
}

.mechanic-page .job-row.open .expand-icon{
    transform: rotate(-135deg) translateY(-2px);
}

.mechanic-page .rows-container .job-row.open,
.mechanic-page .rows-container .job-row.open:nth-child(even){
    background: #fff6d6;
}

.mechanic-page .job-details{
    grid-column: 1 / -1;
    min-width: 0;
    padding: 0 0 10px !important;
    font-size: 13px;
    cursor: default;
}

.mechanic-page .job-details[hidden]{
    display: none;
}

/* GC — double-tap to edit */
.mechanic-page .job-row .gc-value{
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: text;
}

.mechanic-page .gc-value:empty::before{
    content: 'Add GC';
    font-weight: 400;
    color: #aaa;
}

.mechanic-page .job-row .gc-value input{
    width: 100%;
    min-height: 0;
    padding: 2px 6px;
    font-size: inherit;
    font-weight: 600;
}

/* Elevators — under a line:
   Elev 1   [Type ▾]   Stops   🗑
            Mechanic…
   then + Add elevator */
.mechanic-page .elevators{
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 12px 0;
    border-top: 1px solid #e3e3e3;
}

.mechanic-page .elevator{
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 72px 28px;
    grid-template-areas:
        'name type     stops    remove'
        '.    mechanic mechanic .';
    align-items: center;
    column-gap: 14px;
    row-gap: 6px;
    font-size: 13px;
}

.mechanic-page .elevator-name{
    grid-area: name;
    font-weight: 700;
    color: #111;
}

.mechanic-page .elevator-type{ grid-area: type; }
.mechanic-page .elevator-stops{ grid-area: stops; }
.mechanic-page .elevator-mechanic{ grid-area: mechanic; }
.mechanic-page .elevator-remove{ grid-area: remove; }

.mechanic-page .elevator-type,
.mechanic-page .elevator-stops,
.mechanic-page .elevator-mechanic{
    min-width: 0;
    min-height: 24px;
    padding: 2px 0;
    border-bottom: 1px solid #e3e3e3;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: text;
}

/* Type dropdown — same underline as Stops / Mechanic, with a small arrow */
.mechanic-page .elevator-type{
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 18px;
    border: none;
    border-bottom: 1px solid #e3e3e3;
    border-radius: 0;
    font-family: inherit;
    font-size: inherit;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 2px center;
    outline: none;
    cursor: pointer;
}

.mechanic-page .elevator-type:focus{
    border-bottom-color: #111;
}

/* nothing picked yet — gray "Type" */
.mechanic-page .elevator-type:has(option[value=""]:checked){
    color: #aaa;
}

.mechanic-page .elevator-stops:empty::before,
.mechanic-page .elevator-mechanic:empty::before{
    content: attr(data-placeholder);
    color: #aaa;
}

.mechanic-page .elevator-stops:has(input),
.mechanic-page .elevator-mechanic:has(input){
    border-bottom: none;
    padding: 0;
}

.mechanic-page .job-row .elevator input{
    width: 100%;
    min-height: 0;
    padding: 2px 0;
    border: none;
    border-bottom: 2px solid #111;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: inherit;
}

.mechanic-page .add-elevator{
    align-self: flex-start;
    margin-top: 2px;
    padding: 6px 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #b37800;
    cursor: pointer;
}

.mechanic-page .add-elevator:disabled{
    color: #ccc;
    cursor: default;
}

/* Plans (Drafting page) — same as the Start Date page: teal check = has plans, soft red dot = no plans.
   The "Plans" word only shows on phones (the desktop column header says it) */
.mechanic-page .plans-switch{
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    touch-action: manipulation;
}

.mechanic-page .plans-label{
    display: none;
    color: #888;
}

.mechanic-page .plans-switch input{
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.mechanic-page .plans-icon{
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f4c7c7;
    transition: background 0.2s;
}

.mechanic-page .plans-icon::after{
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e07a7a;
    transform: translate(-50%, -50%);
}

.mechanic-page .plans-switch input:checked + .plans-icon{
    background: #5b8a86;
}

.mechanic-page .plans-switch input:checked + .plans-icon::after{
    width: 5px;
    height: 10px;
    border-radius: 0;
    background: none;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: translate(-50%, -62%) rotate(45deg);
}

.mechanic-page .plans-switch input:focus-visible + .plans-icon{
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Hoist: a pill (below); the real checkbox is hidden */
.mechanic-page .hoist-switch{
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.mechanic-page .hoist-switch input{
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

/* Hoist pill, same as the Drafting pills: light red "Hoist" = no hoist, teal "✓ Hoist" = hoist */
.mechanic-page .hoist-pill{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 60px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #fdecea;
    color: #b5524a;
    font-size: 11px;
    font-weight: 600;
    line-height: 14px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.mechanic-page .hoist-switch input:checked + .hoist-pill{
    background: #5b8a86;
    color: #fff;
}

.mechanic-page .hoist-switch input:checked + .hoist-pill::before{
    content: '✓';
}

.mechanic-page .hoist-switch input:focus-visible + .hoist-pill{
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Empty cell placeholder — <span class="unassigned">Unassigned</span> */
.mechanic-page .unassigned{
    color: #aaa;
    font-style: italic;
    font-size: 13px;
}

/* Edit box shown when a cell is double-clicked — fits the cell instead of the browser default */
.mechanic-page .job-row input{
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px 10px;
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    color: #111;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mechanic-page .job-row input:focus{
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(245, 168, 0, 0.2);
}

/* "Started more than 4 weeks ago" — collapsible section under the right column,
   soft gray panel like the Purchasing page */
.mechanic-page .past-section{
    width: 100%;
    margin-top: 10px;
    background: #f4f4f4;
    border-radius: 12px;
    overflow: hidden;
}

.mechanic-page .past-toggle{
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    color: #555;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mechanic-page .past-toggle:hover{
    color: #000;
}

.mechanic-page .past-count{
    margin-left: auto;
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e2e2;
    color: #555;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.mechanic-page .past-chevron{
    flex-shrink: 0;
    color: #999;
    transition: transform 0.2s;
}

/* open: the old jobs as white cards inside the panel */
.mechanic-page .past-body .rows-container{
    padding: 0 8px 8px;
}

.mechanic-page .past-toggle[aria-expanded="true"] .past-chevron{
    transform: rotate(180deg);
}

@media (max-width: 1024px) {
    .mechanic-page .pBottom {
        padding: 0 8px 76px;
    }

    /* Header — row 1: logo | icons, row 2: search fills up to the filter button.
       Each row sizes on its own (a grid would make the button's column as wide as the icons). */
    .mechanic-page .pTop {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 12px;
        row-gap: 0;
        padding-bottom: 16px;
    }

    /* invisible full-width item that forces the line break between the two rows */
    .mechanic-page .pTop::before {
        content: '';
        order: 2;
        flex-basis: 100%;
        height: 0;
    }

    .mechanic-page .pTop > a {
        order: 1;
    }

    .mechanic-page .pTop .ections {
        order: 1;
        margin-left: auto;
    }

    .mechanic-page .search {
        order: 3;
        flex: 1 1 0;
        min-width: 0;
        margin-top: 12px;
        padding: 5px 10px;
        gap: 6px;
    }

    .mechanic-page .search-icon {
        width: 14px;
        height: 14px;
    }

    .mechanic-page .search input {
        min-width: 0;
        width: 100%;
        font-size: 13px;
    }

    .mechanic-page .pTop .filters {
        order: 3;
        flex: none;
        margin-top: 12px;
        gap: 6px;
        overflow: visible;
    }

    .mechanic-page .filter-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* One table: the right column continues the left, without a second header */
    .mechanic-page .columns-wrap {
        flex-direction: column;
        gap: 0;
    }

    .mechanic-page .col + .col .row-head {
        display: none;
    }

    .mechanic-page .row-head,
    .mechanic-page .job-row {
        grid-template-columns: 1.8fr 0.7fr 1fr 0.5fr 1.2fr;
        font-size: 13px;
    }

    .mechanic-page .row-head > div,
    .mechanic-page .job-row > div {
        padding: 8px 6px;
    }

    .mechanic-page .mech-chip {
        padding: 1px 6px;
        font-size: 11px;
    }

    /* Smaller header so all 4 names fit on one line */
    .mechanic-page .row-head {
        font-size: 11px;
    }

    .mechanic-page .row-head > div {
        padding: 6px 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Each job is a card:
       Address ................. [Oct 29]
       [Manager]  Hoist ☐  [GC          ]
       (tap → elevators, each with its mechanic) */
    .mechanic-page .row-head {
        display: none;
    }

    .mechanic-page .rows-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-top: 8px;
    }

    .mechanic-page .job-row,
    .mechanic-page .rows-container .job-row:nth-child(even) {
        grid-template-columns: 64px minmax(0, 1fr) auto; /* manager names are short */
        grid-template-areas:
            'name    name date'
            'manager gc   hoist';
        column-gap: 14px;
        row-gap: 10px;
        padding: 12px;
        background: #fff;
        border: 1px solid #dcdcdc;
        border-radius: 4px;
    }

    .mechanic-page .rows-container .job-row.highlight {
        background: #fffbef;
        border-color: #111;
    }

    .mechanic-page .job-row > div {
        padding: 0;
    }

    .mechanic-page .job-details {
        padding: 0 !important;
    }

    /* Drafting page has Plans in the same spot as Hoist */
    .mechanic-page .job-row .hoist-cell,
    .mechanic-page .job-row .plans-cell {
        grid-area: hoist;
        display: flex;
        align-items: center;
        min-height: 32px;
        font-size: 13px;
    }

    .mechanic-page .plans-label {
        display: inline;
    }

    .mechanic-page .job-row .name {
        grid-area: name;
        align-self: start;
        min-width: 0;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.3;
        color: #111;
    }

    /* address always on one line — cut with … if it's too long */
    .mechanic-page .job-row .name-text {
        overflow: hidden;
    }

    .mechanic-page .job-row .name-text,
    .mechanic-page .job-row .job-gc {
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mechanic-page .job-row .job-gc {
        overflow: hidden;
        font-size: 12px;
        font-weight: 500;
        color: #888;
        margin-top: 3px;
    }

    /* start date as a small yellow tag */
    .mechanic-page .job-row .startdate {
        grid-area: date;
        align-self: start;
        padding: 3px 10px;
        border-radius: 4px;
        background: #fff6d6;
        color: #7a5d00;
        font-size: 12px;
        font-weight: 600;
    }

    .mechanic-page .job-row .startdate:empty {
        display: none;
    }

    .mechanic-page .job-row .site-manager {
        grid-area: manager;
    }

    /* Manager + GC: simple underlined fields */
    .mechanic-page .manager-select,
    .mechanic-page .job-row .gc-value {
        min-height: 32px;
        border: none;
        border-bottom: 1px solid #cfcfcf;
        border-radius: 0;
        background-color: transparent;
        box-shadow: none;
        font-size: 14px;
    }

    .mechanic-page .manager-select {
        padding: 0 16px 0 0;
        font-size: 13px;
        font-weight: 600;
        background-position: right 0 center;
    }

    /* GC — double-tap to edit */
    .mechanic-page .job-row .gc-value {
        grid-area: gc;
        display: flex;
        align-items: center;
        padding: 0;
        color: #111;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mechanic-page .job-row .gc-value:empty::before {
        content: 'GC…';
    }

    /* Mechanics: Manager | GC */
    body:not(.drafting-page) .job-row .gc-value {
        position: relative;
        margin-left: -6px;
        padding-left: 16px;
    }

    body:not(.drafting-page) .job-row .gc-value::after {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        height: 16px;
        border-left: 1px solid #ccc;
        transform: translateY(-50%);
    }

    .mechanic-page .manager-select:focus,
    .mechanic-page .job-row .gc-value:active {
        border-bottom-color: #000;
        box-shadow: none;
    }

    /* while editing, the input keeps the same underline, in yellow */
    .mechanic-page .job-row .gc-value:has(input) {
        border-bottom: none;
    }

    /* the right-hand list continues the left with no gap */
    .mechanic-page .col + .col .rows-container {
        padding-top: 10px;
    }

    /* GC edit box on phones: yellow underline */
    .mechanic-page .job-row .gc-value input {
        min-height: 32px;
        padding: 0;
        border: none;
        border-bottom: 2px solid #111;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        font-size: 16px; /* 16px stops iPhones zooming in while typing */
    }

    /* elevators line up with the card's left edge on phones */
    .mechanic-page .elevators {
        padding: 10px 0 0;
    }

    .mechanic-page .elevator,
    .mechanic-page .add-elevator {
        font-size: 14px;
    }

    .mechanic-page .job-row .elevator input {
        font-size: 16px; /* 16px stops iPhones zooming in while typing */
    }

    /* open card: yellow, also on every second card */
    .mechanic-page .rows-container .job-row.open,
    .mechanic-page .rows-container .job-row.open:nth-child(even) {
        background: #fff6d6;
        border-color: #111;
    }

    /* "Start Date" → "Start", "Site Manager" → "Manager" */
    .mechanic-page .desktop-only {
        display: none;
    }
}

/* gray hint inside the edit boxes (Type, Stops, Mechanic…, Add GC) — same gray as when not editing */
.mechanic-page .job-row input::placeholder{
    color: #aaa;
    font-weight: 400;
    opacity: 1;
}

/* Manager is double-tap to edit: no zoom or text selection on the double tap */
.mechanic-page .job-row .site-manager{
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
}

.mechanic-page .job-row .site-manager:empty::before{
    content: 'Manager';
    color: #aaa;
    font-weight: 400;
}

@media (max-width: 1024px) {
    /* manager name shown with the same underline as the dropdown / Mechanic */
    .mechanic-page .job-row .site-manager {
        display: flex;
        align-items: center;
        min-height: 32px;
        border-bottom: 1px solid #cfcfcf;
        font-size: 13px;
        font-weight: 600;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mechanic-page .job-row .site-manager:has(select) {
        border-bottom: none;
    }

    .mechanic-page .job-row .site-manager select {
        width: 100%;
    }
}

/* GC + Hoist are double-tap too: no zoom or text selection on the double tap */
.mechanic-page .gc-value,
.mechanic-page .hoist-switch{
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* Trash can at the end of each elevator line — double-tap to remove */
.mechanic-page .elevator-remove{
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: -4px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: none;
    color: #aaa;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.15s, background 0.15s;
}

.mechanic-page .elevator-remove:hover{
    color: #c62828;
    background: #fdecea;
}

.mechanic-page .elevator-remove:disabled{
    opacity: 0.4;
    cursor: default;
}

/* Drafting Team page: same layout, but rows don't open (no elevators), and Drafter instead of Manager */
.drafting-page .job-row,
.drafting-page .rows-container .job-row.open{
    cursor: default;
}

/* Dropbox number before the GC, small, e.g. "#134 - Skanska" */
.drafting-page .dropbox-num{
    font-size: 11px;
    color: #888;
    font-variant-numeric: tabular-nums;
}

.drafting-page .gc-missing{
    font-weight: 400;
    color: #aaa;
}

.drafting-page .job-row .drafter:empty::before{
    content: 'Drafter';
}

/* Drafting Team: "Sort by" dropdown — same as the Purchasing page, styled like the filter pills */
.drafting-page .pTop .sort-select{
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    background-color: #f5f5f5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 8px 36px 8px 16px;
    font-family: inherit;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.drafting-page .pTop .sort-select:hover,
.drafting-page .pTop .sort-select:focus{
    background-color: #fff;
    border-color: #000;
    color: #000;
}

.drafting-page .pTop .sort-select option{
    color: #000;
}

@media (max-width: 1024px) {
    /* Sort by → a small round icon button next to search and Running Late (the options still open as normal) */
    .drafting-page .pTop .sort-select{
        order: 3;
        flex: none;
        align-self: stretch; /* same height as the search box */
        width: 34px;
        margin-top: 12px;
        padding: 0;
        color: transparent; /* hide the "Sort by" text; the icon says it */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4v16M3 8l4-4 4 4M17 20V4M13 16l4 4 4-4'/%3E%3C/svg%3E");
        background-position: center;
    }

    .drafting-page .pTop .sort-select:hover,
    .drafting-page .pTop .sort-select:focus{
        color: transparent;
    }
}

/* Drafting Team: Shop Drawings, Approved Plans, Steel columns */
.drafting-page .row-head,
.drafting-page .job-row{
    grid-template-columns: 2fr 0.8fr 1fr 130px 135px 80px 1.3fr; /* name, start, drafter, shop drawings, approved plans, steel, GC — pill columns fit the pills */
}

/* pills and their headings on one line */
.drafting-page .pill-switch .pill,
.drafting-page .row-head > div{
    white-space: nowrap;
}

/* on a computer the three pills are each their own column */
.drafting-page .drafting-pills{
    display: contents;
}

@media (max-width: 1024px) {
    /* card: Drafter | GC on the second line, the three pills on the third */
    .drafting-page .rows-container .job-row,
    .drafting-page .rows-container .job-row:nth-child(even){
        grid-template-columns: 84px minmax(0, 1fr) auto;
        grid-template-areas:
            'name    name  date'
            'manager gc    gc'
            'pills   pills pills';
    }

    .drafting-page .drafting-pills{
        grid-area: pills;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .drafting-page .drafting-pills .plans-cell{
        min-height: 0;
    }
}

/* Drafting Team: Plans / Steel as small pills (same look as the Start Date page) — tap to switch.
   teal ✓ = done, light red = not yet */
.drafting-page .pill-switch{
    position: relative;
    display: inline-flex;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.drafting-page .pill-switch input{
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.drafting-page .pill-switch .pill{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 60px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #fdecea;
    color: #b5524a;
    font-size: 11px;
    font-weight: 600;
    line-height: 14px;
    transition: background 0.2s, color 0.2s;
}

.drafting-page .pill-switch input:checked + .pill{
    background: #5b8a86;
    color: #fff;
}

.drafting-page .pill-switch input:checked + .pill::before{
    content: '✓';
}

.drafting-page .job-row .plans-cell{
    display: flex;
    justify-content: center;
}

.drafting-page .row-head > div:nth-child(4),
.drafting-page .row-head > div:nth-child(5),
.drafting-page .row-head > div:nth-child(6){
    text-align: center;
}

.drafting-page .pill-switch input:focus-visible + .pill{
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* No underlines on fields that are just showing a value — the underline only shows while editing
   (dropdown open, or the yellow line under a typing box). Mechanics + Drafting pages. */
.mechanic-page .elevator-stops,
.mechanic-page .elevator-mechanic,
.mechanic-page .elevator-type{
    border-bottom-color: transparent;
}

.mechanic-page .elevator-type:focus{
    border-bottom-color: #111;
}

@media (max-width: 1024px) {
    .mechanic-page .job-row .site-manager,
    .mechanic-page .job-row .gc-value{
        border-bottom-color: transparent;
    }
}

@media (max-width: 1024px) {
    /* GC too long → ends with "…" (a flex box can't show the "…", so a plain block with the same height) */
    .mechanic-page .job-row .gc-value{
        display: block;
        line-height: 32px;
    }

    .mechanic-page .job-row .gc-value:has(input){
        line-height: normal;
    }
}

/* Start date: plain, unless the job is late (starts within 6 weeks, or already started, and
   Mechanics: still no mechanic / Drafting: Plans or Steel not done) → red tag */
.mechanic-page .job-row .startdate.late{
    justify-self: start;
    padding: 3px 10px;
    border-radius: 4px;
    background: #fdecea;
    color: #b5524a;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .mechanic-page .job-row .startdate{
        background: transparent;
        color: #666;
        font-weight: 500;
    }

    .mechanic-page .job-row .startdate.late{
        background: #fdecea;
        color: #b5524a;
        font-weight: 600;
    }
}

/* Wiring Team: the 4 team buttons on top, each with its number of jobs in a bubble */
.mechanic-page .tech-btn{
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mechanic-page .tech-count{
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* button on: black, so the bubble turns white */
.mechanic-page .tech-btn.active .tech-count{
    background: #fff;
    color: #111;
}

/* ── Wiring Team: gray page, one white card per job ──
   Tablet / computer: a row per job — [address · buttons] [start] [one line per elevator]
   Phone: the card design further down. */
.wiring-page .pBottom{
    background: #f7f7f7;
}

/* the gray goes right up to the black line under the top bar, and down to the bottom */
.wiring-page .pTop{
    margin-bottom: 0;
}

.wiring-page .pannel{
    padding-bottom: 0;
}

.wiring-page .rows-active{
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 12px;
}

.wiring-page .wire-card{
    min-width: 0;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    color: #111;
}

/* completed: grayed out, ✓ after the date */
.wiring-page .wire-card.completed{
    opacity: 0.55;
}

.wiring-page .wire-card.completed .wire-start b::after{
    content: ' ✓';
}

.wiring-page .wire-job{
    min-width: 0;
}

.wiring-page .wire-name{
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wiring-page .wire-sub{
    margin-top: 2px;
    font-size: 13px;
    color: #777;
}

/* double-tap the start date to mark the job completed */
.wiring-page .wire-start{
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
}

.wiring-page .wire-elevs:empty{
    display: none;
}

.wiring-page .elev-name{
    font-weight: 700;
}

/* Type and Floors: double-tap to edit */
.wiring-page .elev-type,
.wiring-page .elev-floors,
.wiring-page .elev-date,
.wiring-page .elev-team{
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.wiring-page .elev-type,
.wiring-page .elev-floors,
.wiring-page .elev-date{
    position: relative;
    white-space: nowrap;
    cursor: pointer;
}

.wiring-page .elev-type.empty,
.wiring-page .elev-floors.empty,
.wiring-page .elev-date.empty{
    color: #aaa;
}

.wiring-page .elev-date-label{
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #555; /* dark even when there is no date yet */
}

.wiring-page .elev-phase[hidden]{
    display: none;
}

.wiring-page .elev-phase-label{
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #666;
}

.wiring-page .team-chip{
    cursor: pointer;
}

.wiring-page .wire-add-elev:disabled{
    opacity: 0.5;
    cursor: default;
}

/* the Temp switch: off = pale, on = solid yellow */
.wiring-page .elev-temp-switch{
    flex-shrink: 0;
    justify-self: start;
    padding: 5px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #7a5d00;
    background: #fdf0c2;
    border: none;
    border-radius: 999px;
    cursor: pointer;
}

.wiring-page .elev-temp-switch.active{
    color: #000;
    background: #fab519;
}

/* ── tablet / computer ──
     341 Lenox Rd        Aug 31   E1  Overhead  13 fl  (Temp)  TEMP   [OL]  In 11/05  Out 11/12
     Brooklyn, NY · 3             E2  MRL       8 fl   (Temp)  FINAL  [AT]  In 12/01  Out 12/09
     [Assign all] [+ Add elevator]                                                                */
@media (min-width: 601px) {
    .wiring-page .wire-card{
        display: grid;
        grid-template-columns: 300px 120px minmax(0, 1fr); /* job, start, elevators */
        grid-template-rows: auto 1fr;
        grid-template-areas:
            'job     start elevs'
            'actions .     elevs';
        align-items: start;
        column-gap: 24px;
        padding: 20px 24px;
    }

    .wiring-page .wire-head{ display: contents; }
    .wiring-page .wire-job{ grid-area: job; }
    .wiring-page .wire-start{ grid-area: start; }
    .wiring-page .wire-elevs{
        grid-area: elevs;
        min-width: 0;
        margin-top: -8px; /* first row's text lines up with the job name */
    }

    .wiring-page .wire-name{ font-size: 15px; }

    .wiring-page .wire-start{
        padding-top: 1px;
        font-size: 14px;
    }

    .wiring-page .wire-start small{ display: none; }
    .wiring-page .wire-start b{ font-weight: 500; }

    /* "Assign all" and "+ Add elevator" on one line, under the address */
    .wiring-page .wire-actions{
        grid-area: actions;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 12px;
    }

    /* dashed buttons: "Assign all", "+ Add elevator" and "+ Assign" */
    .wiring-page .wire-assign-all,
    .wiring-page .wire-add-elev,
    .wiring-page .assign-btn{
        padding: 6px 10px;
        font: inherit;
        font-size: 12px;
        color: #555;
        background: #fff;
        border: 1px dashed #c8c8c8;
        border-radius: 6px;
        white-space: nowrap;
        cursor: pointer;
        transition: border-color 0.15s, color 0.15s;
    }

    .wiring-page .wire-assign-all{
        appearance: none;
        -webkit-appearance: none;
    }

    .wiring-page .assign-btn{ padding: 5px 10px; }

    .wiring-page .wire-assign-all:hover,
    .wiring-page .wire-add-elev:hover,
    .wiring-page .assign-btn:hover{
        border-color: #111;
        color: #111;
    }

    /* one grid per elevator, the same columns on every one so they line up:
       name · type · floors · Temp · TEMP/FINAL · team · in · out.
       Temp comes first, so Final drops to the next line under it */
    .wiring-page .elev-row{
        display: grid;
        grid-template-columns: 40px 90px 56px 64px 44px 96px 80px 80px;
        align-items: center;
        column-gap: 24px;
        row-gap: 4px;
        width: fit-content;
        max-width: 100%;
        min-height: 43px;
        padding: 6px 0;
        font-size: 14px;
    }

    .wiring-page .elev-row + .elev-row{
        border-top: 1px solid #f0f0f0;
    }

    .wiring-page .elev-name,
    .wiring-page .elev-type,
    .wiring-page .elev-floors,
    .wiring-page .elev-temp-switch{
        grid-row: 1;
    }

    .wiring-page .elev-type,
    .wiring-page .elev-floors{
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .wiring-page .elev-phase{ display: contents; }
    .wiring-page .elev-phase-label{ grid-column: 5; }
    .wiring-page .elev-phase .elev-team{ grid-column: 6; }
    .wiring-page .elev-phase .elev-date-in{ grid-column: 7; }
    .wiring-page .elev-phase .elev-date-out{ grid-column: 8; }

    /* the type dropdown / floors box while editing */
    .wiring-page .elev-edit{
        width: 100%;
        min-width: 0;
        padding: 4px 6px;
        font: inherit;
        font-size: 13px;
        color: #111;
        background: #fff;
        border: 1px solid #f5a800;
        border-radius: 6px;
    }

    /* team: "+ Assign" or the team */
    .wiring-page .elev-team{
        display: flex;
        align-items: center;
        min-height: 32px;
    }

    .wiring-page .team-chip{
        padding: 4px 10px;
        border-radius: 6px;
        background: #111;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
    }

    .wiring-page .elev-team select{
        padding: 4px 6px;
        font: inherit;
        font-size: 13px;
        border: 1px solid #f5a800;
        border-radius: 6px;
        background: #fff;
    }

    /* date in / out: "IN" over "11/05"; the date box sits over the row since it's wider than the column */
    .wiring-page .elev-date{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        min-height: 32px;
        line-height: 1.2;
    }

    .wiring-page .elev-date.empty span{
        font-size: 12px;
    }

    .wiring-page .elev-date input{
        position: absolute;
        left: 0;
        top: 50%;
        z-index: 5;
        width: 150px;
        padding: 4px 6px;
        transform: translateY(-50%);
        font: inherit;
        color: #111;
        background: #fff;
        border: 1px solid #f5a800;
        border-radius: 6px;
    }
}

/* everything to the left: same side space as the top bar */
@media (min-width: 1025px) {
    .wiring-page .pBottom{
        padding-left: 1%;
        padding-right: 1%;
    }
}

/* smaller computer screens: tighter, so the last columns don't run off the edge */
@media (min-width: 1025px) and (max-width: 1300px) {
    .wiring-page .wire-card{
        grid-template-columns: 210px 70px minmax(0, 1fr);
        column-gap: 16px;
    }

    .wiring-page .elev-row{
        column-gap: 12px;
    }
}

/* wide screens: two elevators side by side; a 3rd goes on the next line */
@media (min-width: 1800px) {
    .wiring-page .wire-card{
        grid-template-columns: 220px 80px minmax(0, 1fr);
    }

    .wiring-page .wire-elevs{
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 32px;
    }

    .wiring-page .elev-row{
        grid-template-columns: 28px 70px 40px 56px 38px 80px 66px 66px;
        column-gap: 12px;
    }

    /* the line goes between the pairs, not between the two in a pair */
    .wiring-page .elev-row + .elev-row{
        border-top: none;
    }

    .wiring-page .elev-row:nth-child(n + 3){
        border-top: 1px solid #f0f0f0;
    }
}

@media (max-width: 1024px) {
    .mechanic-page .pTop .filters:has(.tech-btn){
        flex-wrap: wrap;
    }

    /* Wiring: search + "Needs Update" on one line, the team buttons on the line under them */
    .wiring-page .search{
        flex: 1 1 0;
    }

    .wiring-page .pTop .needs-btn{
        order: 3;
        flex: none;
        margin-top: 12px;
        padding: 5px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* all 5 buttons on one line, sharing the width */
    .wiring-page .pTop .filters,
    .wiring-page .pTop .filters:has(.tech-btn){
        flex-basis: 100%;
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 8px;
    }

    .wiring-page .pTop .filters .filter-btn{ /* the team buttons share the line; Needs Update stays narrow */
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
        gap: 4px;
        padding: 5px 6px;
        white-space: nowrap;
    }

    .wiring-page .tech-count{
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 10px;
    }

    .wiring-page .pBottom{
        padding-top: 12px;
    }
}

/* tablets: job on the left, start date on the right, buttons under them, the elevators full width */
@media (min-width: 601px) and (max-width: 1024px) {
    .wiring-page .wire-card{
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: none;
        grid-template-areas:
            'job     start'
            'actions actions'
            'elevs   elevs';
        row-gap: 14px;
        padding: 16px;
    }

    .wiring-page .wire-actions{ margin-top: -6px; }
    .wiring-page .wire-elevs{ margin-top: 0; }

    .wiring-page .elev-row{
        grid-template-columns: 30px 76px 44px 56px 38px 84px 66px 66px;
        column-gap: 12px;
    }
}

/* ── phone: one card per job ──
     341 Lenox Rd                          START
     Brooklyn, NY · 3 elevators            Aug 31
     ───────────────────────────────────────────
     E1     Overhead            13 fl    (Temp)
     TEMP   [ OL ] [IN mm/dd   ] [OUT mm/dd  ]   ← only when Temp is on
     FINAL  [ OL ] [IN mm/dd   ] [OUT mm/dd  ]
     ───────────────────────────────────────────
     [Assign all]  + Add elevator
   Hold a finger on an elevator's block to remove it. */
@media (max-width: 600px) {
    .wiring-page .rows-active{
        gap: 8px;
        padding-bottom: 8px;
    }

    .wiring-page .wire-card{
        overflow: hidden;
        border-color: #e6e6e6;
        font-size: 13px;
    }

    /* header: address on the left, START date on the right */
    .wiring-page .wire-head{
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 12px 6px;
    }

    .wiring-page .wire-name{ font-size: 14px; }
    .wiring-page .wire-sub{ margin-top: 0; font-size: 12px; }
    .wiring-page .elev-temp-switch{ padding: 3px 10px; font-size: 11px; }

    .wiring-page .wire-start{
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        flex-shrink: 0;
    }

    .wiring-page .wire-start small{
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #888;
    }

    .wiring-page .wire-start b{ font-size: 13px; }

    /* one block per elevator, a line between them */
    .wiring-page .elev-row{
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 6px;
        padding: 10px 12px; /* room between one elevator and the next */
        border-top: 1px solid #eee;
        -webkit-touch-callout: none; /* the long press removes, it does not open a menu */
    }

    .wiring-page .elev-name{
        width: 32px;
        flex-shrink: 0;
    }

    /* the boxes: Type, Floors, In, Out — dashed when empty; double-tap to change */
    .wiring-page .elev-type,
    .wiring-page .elev-floors,
    .wiring-page .elev-date{
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        height: 26px;
        padding: 0 10px;
        border: 1px solid #dedede;
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .wiring-page .elev-type.empty,
    .wiring-page .elev-floors.empty,
    .wiring-page .elev-date.empty{
        border-style: dashed;
    }

    /* Type and Floors once filled in: just the text, no box (still double-tap to change) */
    .wiring-page .elev-type:not(.empty),
    .wiring-page .elev-floors:not(.empty){
        border-color: transparent;
        padding-left: 0;
        font-weight: 500;
    }

    .wiring-page .elev-type{ flex: 1 1 0; }

    .wiring-page .elev-floors{
        width: 64px;
        flex-shrink: 0;
    }

    /* the type dropdown / floors box while editing: fills the box */
    .wiring-page .elev-type:has(.elev-edit),
    .wiring-page .elev-floors:has(.elev-edit){
        padding: 0;
        border-style: solid;
        border-color: #f5a800;
    }

    .wiring-page .elev-edit{
        width: 100%;
        height: 100%;
        min-width: 0;
        padding: 0 8px;
        font: inherit;
        color: #111;
        background: #fff;
        border: none;
        border-radius: 8px;
        outline: none;
    }

    /* TEMP / FINAL line: label · team · IN · OUT */
    .wiring-page .elev-phase{
        flex-basis: 100%;
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .wiring-page .elev-phase-label{
        width: 32px;
        flex-shrink: 0;
    }

    .wiring-page .elev-phase .elev-date{ flex: 1 1 0; }

    /* the date box while editing: covers the IN / OUT box */
    .wiring-page .elev-date input{
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0 6px;
        font: inherit;
        font-size: 13px;
        color: #111;
        background: #fff;
        border: 1px solid #f5a800;
        border-radius: 8px;
    }

    /* team: the team as a dark box, or a dashed blue "+ Assign" */
    .wiring-page .elev-team{
        display: flex;
        width: 64px;
        flex-shrink: 0;
        height: 26px;
    }

    .wiring-page .team-chip,
    .wiring-page .assign-btn{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        border-radius: 8px;
        font: inherit;
        font-size: 13px;
        white-space: nowrap;
        cursor: pointer;
    }

    .wiring-page .team-chip{
        background: #141a2a;
        color: #fff;
        font-weight: 700;
    }

    .wiring-page .assign-btn{
        padding: 0;
        color: #1a8ad4;
        background: #fff;
        border: 1px dashed #9cc7e8;
    }

    .wiring-page .elev-team select{
        width: 100%;
        height: 100%;
        padding: 0 4px;
        font: inherit;
        font-size: 13px;
        border: 1px solid #f5a800;
        border-radius: 8px;
        background: #fff;
    }

    /* bottom: [Assign all]  + Add elevator */
    .wiring-page .wire-actions{
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 6px 12px;
        border-top: 1px solid #eee;
    }

    .wiring-page .wire-assign-all{
        height: 26px;
        padding: 0 14px;
        font: inherit;
        font-size: 13px;
        font-weight: 500;
        color: #111;
        background: #fff;
        border: 1px solid #d6d6d6;
        border-radius: 8px;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

    .wiring-page .wire-add-elev{
        padding: 0;
        font: inherit;
        font-size: 13px;
        font-weight: 500;
        color: #1a8ad4;
        background: none;
        border: none;
        cursor: pointer;
    }
}

/* the short line per elevator — phones only (wiring.js makeSummary) */
.wiring-page .elev-summary{
    display: none;
}

@media (max-width: 600px) {
    /* closed: just "E1" and the short line; tap it to open the boxes under it */
    .wiring-page .elev-row:not(.open) > :not(.elev-name):not(.elev-summary){
        display: none !important;
    }

    .wiring-page .elev-summary{
        flex: 1 1 calc(100% - 40px);
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        padding: 0;
        font: inherit;
        color: inherit;
        text-align: left;
        background: none;
        border: none;
        cursor: pointer;
    }

    .wiring-page .sum-text{
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .wiring-page .sum-what{
        font-size: 14px;
        font-weight: 500;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }


    /* "Temp In 11/05 · Out 11/12  OL": the dates, then that phase's team */
    .wiring-page .sum-dates{
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 3px;
        font-size: 12px;
        color: #888;
    }

    .wiring-page .sum-dates b{
        display: inline-block;
        min-width: 34px;
        font-weight: 600;
        color: #555;
    }

    /* that phase's team in a small dark circle; none yet → a dashed blue "+" */
    .wiring-page .sum-team{
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px; /* a circle for "OL", a pill for "Omar" */
        height: 24px;
        padding: 0 6px;
        border-radius: 999px;
        background: #141a2a;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
    }

    .wiring-page .sum-team.none{
        background: #fff;
        color: #1a8ad4;
        border: 1px dashed #9cc7e8;
        font-size: 13px;
        font-weight: 500;
    }

    .wiring-page .sum-arrow{
        flex-shrink: 0;
        width: 12px;
        font-size: 20px;
        line-height: 1;
        color: #bbb;
        transition: transform 0.15s;
    }

    .wiring-page .elev-row.open .sum-arrow{
        transform: rotate(90deg);
    }

    /* open: a little space between the short line and the boxes */
    .wiring-page .elev-row.open .elev-summary{
        margin-bottom: 4px;
    }
}

/* the boxes' container: on a computer / tablet it isn't a box at all — its boxes sit in the elevator's columns */
@media (min-width: 601px) {
    .wiring-page .elev-details{
        display: contents;
    }
}

/* phone, an elevator opened: its boxes in a light-gray panel under the short line, with room to tap */
@media (max-width: 600px) {
    .wiring-page .elev-details{
        flex-basis: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        margin-top: 8px;
        padding: 12px;
        background: #f5f6f8;
        border-radius: 12px;
    }

    .wiring-page .elev-row.open{
        padding-bottom: 14px;
    }

    .wiring-page .elev-row.open .elev-summary{
        margin-bottom: 0;
    }

    /* bigger boxes than the folded line, easy to tap */
    .wiring-page .elev-details .elev-type,
    .wiring-page .elev-details .elev-floors,
    .wiring-page .elev-details .elev-date,
    .wiring-page .elev-details .elev-team{
        height: 38px;
    }

    .wiring-page .elev-details .elev-type,
    .wiring-page .elev-details .elev-floors{
        font-size: 14px;
    }

    /* filled-in Type / Floors: just the text, no box (not even the white) */
    .wiring-page .elev-details .elev-type:not(.empty),
    .wiring-page .elev-details .elev-floors:not(.empty){
        background: transparent;
    }

    .wiring-page .elev-details .elev-floors,
    .wiring-page .elev-details .elev-team{
        width: 72px;
    }

    .wiring-page .elev-details .elev-temp-switch{
        padding: 7px 14px;
        font-size: 12px;
    }

    /* Temp / Final lines: a thin line above each, so they're easy to tell apart */
    .wiring-page .elev-details .elev-phase{
        gap: 10px;
        padding-top: 10px;
        border-top: 1px solid #e6e7ea;
    }

    .wiring-page .elev-details .elev-phase-label{
        width: 40px;
        font-size: 11px;
    }

    .wiring-page .elev-details .team-chip,
    .wiring-page .elev-details .assign-btn{
        font-size: 13px;
    }
}

/* Phone only: search + its button(s) as one piece — the search a full pill, the button a plain box
   tucked under its round right end, square at its own right side:  ( 🔍 Search...   )Needs Update|
   (on a computer / tablet they stay separate) */
@media (max-width: 600px) {
    .mechanic-page .search{
        position: relative;
        z-index: 1;
        height: 32px;
        box-sizing: border-box;
    }

    /* Wiring: Needs Update */
    .wiring-page .pTop .needs-btn{
        position: relative;
        height: 32px;
        box-sizing: border-box;
        margin-left: -28px; /* the top bar's 12px gap + 16px under the search's round end */
        padding-left: 24px;
        border-radius: 0;
    }

    /* Mechanic + Drafting: Needs Update / Running Late */
    .mechanic-page:not(.wiring-page) .pTop .filters{
        gap: 0;
        margin-left: -28px;
    }

    .mechanic-page:not(.wiring-page) .pTop .filters .filter-btn{
        height: 32px;
        box-sizing: border-box;
        padding-left: 24px;
        border-radius: 0;
    }

    /* Drafting: the sort box joins the end — ( 🔍 Search...   )Running Late|⇅| — a bit tighter */
    .drafting-page .pTop .filters .filter-btn{
        padding-left: 20px;
        padding-right: 8px;
    }

    .drafting-page .pTop .sort-select{
        align-self: auto;
        height: 32px;
        width: 30px;
        box-sizing: border-box;
        margin-left: -12px; /* cancels the top bar's gap, so it touches Running Late */
        border-left: none;
        border-radius: 0;
    }
}

/* Wiring: the address opens that job's own page (wiring-job.html) */
.wiring-page .wire-job{
    cursor: pointer;
}

.wiring-page .wire-job:hover .wire-name{
    text-decoration: underline;
}

/* Wiring, phone: a tidier top bar —
     ( 🔍 Search...            )Needs Update|
     ( Omar 0 )( OL 1 )( AT 0 )( WB 1 )( BP 1 )   ← all the same width, as tall as the search line */
@media (max-width: 600px) {
    .wiring-page .search{
        min-width: 0;
    }

    .wiring-page .pTop .needs-btn{
        padding-right: 12px;
        font-size: 12px;
        font-weight: 600;
    }

    .wiring-page .pTop .filters,
    .wiring-page .pTop .filters:has(.tech-btn){
        gap: 6px;
        margin-top: 10px;
        overflow: visible;
    }

    .wiring-page .pTop .filters .filter-btn{
        flex: 1 1 0; /* equal widths, whatever the name */
        height: 32px;
        box-sizing: border-box;
        gap: 5px;
        padding: 0 4px;
        font-size: 12px;
        font-weight: 600;
    }

    /* the job count: a light bubble instead of a heavy black one */
    .wiring-page .tech-count{
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        background: #ececec;
        color: #111;
        font-size: 11px;
    }

    .wiring-page .tech-btn.active .tech-count{
        background: #fff;
        color: #111;
    }
}

/* Wiring: Punch List button on each job card (between Assign all and + Add elevator) — opens the job's punch list page.
   Any item not done yet = red, with "Open" after the name; otherwise a plain button */
.wiring-page .wire-punch{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
    color: #555;
    background: #fff;
    border: 1px dashed #c8c8c8;
    border-radius: 6px;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.wiring-page .wire-punch:hover{
    border-color: #111;
    color: #111;
}

.wiring-page .wire-punch.open{
    color: #b71c1c;
    background: #fdecea;
    border: 1px solid #d32f2f;
    font-weight: 600;
}

.wiring-page .punch-state:empty{
    display: none;
}

.wiring-page .wire-punch.open .punch-state{
    padding: 1px 7px;
    border-radius: 999px;
    background: #d32f2f;
    color: #fff;
    font-size: 11px;
}

.wiring-page .wire-punch:disabled{
    opacity: 0.6;
    cursor: default;
}

/* phone: the same height as Assign all */
@media (max-width: 600px) {
    .wiring-page .wire-punch{
        height: 26px;
        padding: 0 12px;
        font-size: 13px;
        font-weight: 500;
        border: 1px solid #d6d6d6;
        border-radius: 8px;
        color: #111;
    }

    .wiring-page .wire-punch.open{
        border-color: #d32f2f;
        color: #b71c1c;
    }
}

/* Wiring, computer / tablet: the Temp switch when off (only Final) — gray with slanted stripes;
   on stays solid yellow */
@media (min-width: 601px) {
    .wiring-page .elev-temp-switch:not(.active){
        color: #777;
        background-color: #ececec;
        background-image: repeating-linear-gradient(
            45deg,
            transparent 0 4px,
            rgba(0, 0, 0, 0.09) 4px 6px
        );
        box-shadow: inset 0 0 0 1px #d6d6d6;
    }

    .wiring-page .elev-temp-switch:not(.active):hover{
        color: #333;
        background-color: #e2e2e2;
    }
}

/* ── Priority ──
   Each elevator has a Priority switch next to Temp: off = pale gray, on = solid red, and its E1 turns red.
   Priority elevators also show at the top of the page under "Priority" (their job, just those elevators),
   then "All" lists every job as always. */
.wiring-page .elev-prio-switch{
    flex-shrink: 0;
    justify-self: start;
    padding: 5px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #777;
    background: #f0f0f0;
    border: none;
    border-radius: 999px;
    cursor: pointer;
}

.wiring-page .elev-prio-switch:hover{
    color: #333;
}

.wiring-page .elev-prio-switch.active{
    color: #fff;
    background: #d32f2f;
}

.wiring-page .elev-prio-switch:disabled{
    opacity: 0.6;
}

.wiring-page .elev-row.priority .elev-name{
    color: #d32f2f;
}

/* "Priority 3" / "All 42" above each part of the list */
.wiring-page .wire-section-title{
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 2px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111;
}

.wiring-page .wire-section-title:first-child{
    margin-top: 0;
}

.wiring-page .wire-section-title span{
    padding: 1px 8px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #555;
    font-size: 12px;
    letter-spacing: 0;
}

/* a job in the Priority list: a red line on its left; adding elevators / assigning all is done in All */
.wiring-page .wire-card.priority-card{
    border-left: 4px solid #d32f2f;
}

.wiring-page .priority-card .wire-assign-all,
.wiring-page .priority-card .wire-add-elev{
    display: none;
}

/* tablet / computer: the switch gets its own column after Temp, so the rows still line up:
   name · type · floors · Temp · Priority · TEMP/FINAL · team · in · out */
@media (min-width: 601px) {
    .wiring-page .elev-row{
        grid-template-columns: 40px 90px 56px 64px 76px 44px 96px 80px 80px;
    }

    .wiring-page .elev-prio-switch{ grid-row: 1; }
    .wiring-page .elev-phase-label{ grid-column: 6; }
    .wiring-page .elev-phase .elev-team{ grid-column: 7; }
    .wiring-page .elev-phase .elev-date-in{ grid-column: 8; }
    .wiring-page .elev-phase .elev-date-out{ grid-column: 9; }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .wiring-page .elev-row{
        grid-template-columns: 30px 76px 44px 56px 68px 38px 84px 66px 66px;
    }

    .wiring-page .elev-prio-switch{ padding: 4px 10px; font-size: 11px; }
}

/* phone: in the opened elevator's panel, next to Temp */
@media (max-width: 600px) {
    .wiring-page .elev-prio-switch{ padding: 3px 10px; font-size: 11px; }

    .wiring-page .elev-details .elev-prio-switch{
        padding: 7px 14px;
        font-size: 12px;
    }
}

/* phone, opened elevator — compact, and it fits inside the card:
     Overhead  41 fl            (Temp) (Priority)
     FINAL  [OL]  [IN 11/24]  [OUT 12/01]          */
@media (max-width: 600px) {
    .wiring-page .elev-details{
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
        gap: 8px;
        padding: 10px;
    }

    /* type and floors just as wide as their text, the switches pushed to the right */
    .wiring-page .elev-details .elev-type{
        flex: 0 1 auto;
        height: 30px;
    }

    .wiring-page .elev-details .elev-floors{
        width: auto;
        height: 30px;
    }

    .wiring-page .elev-details .elev-floors.empty,
    .wiring-page .elev-details .elev-type.empty{
        min-width: 56px;
    }

    .wiring-page .elev-details .elev-temp-switch{
        margin-left: auto;
    }

    .wiring-page .elev-details .elev-temp-switch,
    .wiring-page .elev-details .elev-prio-switch{
        padding: 5px 10px;
        font-size: 11px;
    }

    /* TEMP / FINAL: smaller boxes so IN and OUT both fit */
    .wiring-page .elev-details .elev-phase{
        box-sizing: border-box;
        max-width: 100%;
        gap: 6px;
        padding-top: 8px;
    }

    .wiring-page .elev-details .elev-phase-label{
        width: 36px;
        font-size: 10px;
    }

    .wiring-page .elev-details .elev-team{
        width: 58px; /* room for "+ Assign" */
        flex-shrink: 0;
    }

    .wiring-page .elev-details .elev-date,
    .wiring-page .elev-details .elev-team{
        height: 32px;
    }

    .wiring-page .elev-details .elev-date{
        flex: 1 1 0;
        min-width: 0;
        padding: 0 8px;
        gap: 4px;
        font-size: 12px;
    }

    .wiring-page .elev-details .team-chip,
    .wiring-page .elev-details .assign-btn{
        font-size: 12px;
    }
}

/* no black box around the elevator's short line after tapping it (still shows for keyboard use) */
.wiring-page .elev-summary:focus:not(:focus-visible){
    outline: none;
}
