* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
}

.login-card h1 {
    margin: 0;
    text-align: center;
    font-size: 30px;
    color: #111827;
}

/* The company logo in place of the heading text. */
.login-card .login-logo img {
    display: block;
    width: 240px;
    max-width: 80%;
    height: auto;
    margin: 0 auto;
}

/* Sign-in: the logo alone above the form (no subtitle under it). */
.login-card .login-logo-alone {
    margin-bottom: 32px;
}

.login-card h2 {
    margin: 14px 0 32px;
    text-align: center;
    font-size: 17px;
    font-weight: normal;
    color: #6b7280;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
}

.form-group input:focus {
    outline: none;
    border-color: #374151;
}

button {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 7px;
    background: #111827;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #374151;
}

@media (max-width: 600px) {
    .login-card {
        padding: 30px 22px;
        box-shadow: none;
    }

    body {
        background: white;
    }
}

.login-error {
    margin-bottom: 20px;
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    color: #991b1b;
    font-size: 14px;
    text-align: center;
}

/* Application */

.app-header {
    height: 70px;
    background: #111827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.app-brand {
    font-size: 21px;
    font-weight: 700;
}

.app-user {
    font-size: 15px;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 35px 25px;
}

/* The job page is one 750px column (tiles, DigAlerts): centre the whole column. */
.page-container.project-page {
    max-width: 800px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Shown under the header while an admin is in an inactive project. */
.inactive-project-bar {
    padding: 10px 20px;
    background: #fffaeb;
    border-bottom: 1px solid #fedf89;
    color: #93370d;
    font-size: 14px;
    text-align: center;
}

.inactive-project-bar a {
    margin-left: 8px;
    color: #93370d;
    font-weight: 700;
}

/* Section title with "22453 - Project Name" underneath (Documents' style). */
.page-heading h1 {
    margin: 0 0 5px;
    font-size: 28px;
}

.page-heading p {
    margin: 0;
    color: #667085;
    font-size: 14px;
}

@media (max-width: 700px) {
    .page-heading h1 {
        font-size: 23px;
    }
}

.admin-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

.admin-card h2 {
    margin-top: 0;
}

.project-form {
    display: grid;
    grid-template-columns: 180px 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.project-form .form-group {
    margin: 0;
}

.primary-button {
    width: auto;
    padding-left: 25px;
    padding-right: 25px;
}

.primary-button:disabled {
    background: #d0d5dd;
    color: #667085;
    cursor: not-allowed;
    box-shadow: none;
}

.project-list {
    border-top: 1px solid #e5e7eb;
}

.project-row {
    display: grid;
    grid-template-columns: 130px 1fr 100px;
    gap: 20px;
    align-items: center;
    padding: 18px 5px;
    border-bottom: 1px solid #e5e7eb;
}

.project-number {
    font-weight: 700;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-info span {
    color: #6b7280;
    font-size: 14px;
}

.project-status {
    text-align: right;
    font-size: 14px;
}

/* Manage Projects: Edit button at the end of each row; its form opens
   full-width underneath. */
.project-row {
    grid-template-columns: 130px 1fr auto;
}

/* Active / Inactive sections on Manage Projects; click a heading to fold it. */
.project-group {
    padding-top: 0;
    padding-bottom: 0;
}

.project-group-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.project-group-summary::-webkit-details-marker {
    display: none;
}

/* Arrow: points right when folded, down when open. */
.project-group-summary::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid #667085;
    border-bottom: 2px solid #667085;
    transform: rotate(-45deg);
    transition: transform .15s ease;
    flex: 0 0 auto;
}

.project-group[open] > .project-group-summary::before {
    transform: rotate(45deg);
}

.project-group-summary h2 {
    margin: 0;
}

.project-group-count {
    padding: 2px 9px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: 13px;
    font-weight: 700;
}

.project-group[data-group="inactive"] .project-group-summary h2 {
    color: #475467;
}

.project-group[open] .project-list {
    margin-bottom: 18px;
}

.project-row[hidden] {
    display: none;
}

.project-info .project-map-status {
    font-size: 12px;
    color: #667085;
}

.project-info .project-map-status.is-found {
    color: #027a48;
}

.project-info .project-map-status.is-missing {
    color: #b54708;
}

.project-row.is-saved {
    background: #f0fdf4;
}

.project-edit-toggle {
    width: auto;
    padding: 8px 16px;
}

.project-status.is-archived {
    color: #98a2b3;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-archive-button {
    width: auto;
    padding: 8px 14px;
}

.project-archive-button.is-open {
    border-color: #fdb022;
    background: #fffaeb;
    color: #b54708;
}

/* Archive turned off until it's set up (see the button's tooltip). */
.project-archive-button:disabled {
    background: #f2f4f7;
    border-color: #e4e7ec;
    color: #98a2b3;
    cursor: not-allowed;
}

/* Trash can: quiet grey until hovered or open, then red. */
.project-delete-toggle {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #ffffff;
    color: #667085;
    cursor: pointer;
}

.project-delete-toggle:hover,
.project-delete-toggle.is-open {
    border-color: #fda29b;
    background: #fef3f2;
    color: #b42318;
}

.project-delete-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #fda29b;
    border-radius: 9px;
    background: #fef3f2;
}

.project-delete-form[hidden] {
    display: none;
}

.project-delete-text {
    grid-column: 1 / -1;
    color: #7a271a;
    font-size: 14px;
    line-height: 1.45;
}

.project-delete-text strong {
    color: #b42318;
}

.project-delete-text p {
    margin: 4px 0 0;
}

.project-delete-form .form-group {
    margin: 0;
}

.project-delete-form input {
    max-width: 260px;
}

.project-delete-button {
    width: auto;
    padding: 10px 18px;
    border: 0;
    border-radius: 7px;
    background: #d92d20;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.project-delete-button:disabled {
    background: #fda29b;
    cursor: not-allowed;
}

/* Archive panel: same layout as Delete, in amber. */
.project-archive-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #fedf89;
    border-radius: 9px;
    background: #fffaeb;
}

.project-archive-form[hidden] {
    display: none;
}

.project-archive-text {
    grid-column: 1 / -1;
    color: #7a2e0e;
    font-size: 14px;
    line-height: 1.45;
}

.project-archive-text p {
    margin: 4px 0 0;
}

.project-archive-form .form-group {
    margin: 0;
}

.project-archive-form input {
    max-width: 260px;
}

.project-archive-submit {
    width: auto;
}

.project-archive-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* "Adding markups to C-101 Rev 2 (3 of 12)…" while the copies are made. */
.project-archive-prep {
    grid-column: 1 / -1;
    padding: 10px 12px;
    border-radius: 7px;
    background: #ffffff;
    color: #b54708;
    font-size: 14px;
    font-weight: 600;
}

.project-archive-prep[hidden] {
    display: none;
}

.project-archive-prep.is-error {
    color: #b42318;
    font-weight: 500;
}

.project-info .project-archive-status {
    font-size: 13px;
    color: #475467;
}

.project-info .project-archive-status.is-working {
    color: #b54708;
    font-weight: 600;
}

.project-archive-download {
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 8px 16px;
    text-decoration: none;
}

.project-archive-cancel {
    margin: 0;
}

.project-archive-cancel button {
    width: auto;
    padding: 8px 16px;
}

.project-edit-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 160px 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #f9fafb;
}

.project-edit-form[hidden] {
    display: none;
}

.project-edit-form .form-group {
    margin: 0;
}

.project-edit-form input:disabled {
    background: #f2f4f7;
    color: #667085;
    cursor: not-allowed;
}

.project-edit-actions {
    display: flex;
    gap: 8px;
}

.project-edit-actions button {
    width: auto;
}

.project-edit-error {
    grid-column: 1 / -1;
    margin: 0;
}

.project-edit-pin {
    grid-column: 1 / -1;
}

.project-edit-pin label span {
    color: #98a2b3;
    font-weight: 400;
}

.project-edit-pin input {
    max-width: 320px;
}

.project-edit-hint {
    margin: 8px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}

.project-edit-hint p {
    margin: 0 0 6px;
}

.project-edit-hint p strong {
    color: #344054;
}

.project-edit-hint ol {
    margin: 0 0 10px;
    padding-left: 22px;
}

.project-edit-hint li {
    margin-bottom: 3px;
}

.success-message {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 15px;
    border-radius: 7px;
    margin-bottom: 20px;
}

.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 15px;
    border-radius: 7px;
    margin-bottom: 20px;
}

@media (max-width: 800px) {

    .project-form {
        grid-template-columns: 1fr;
    }

    .primary-button {
        width: 100%;
    }

    .project-row {
        grid-template-columns: 90px 1fr;
    }

    .project-edit-form,
    .project-delete-form,
    .project-archive-form {
        grid-template-columns: 1fr;
    }

    /* Buttons move under the job name on narrow screens. */
    .project-actions {
        grid-column: 1 / -1;
    }

    .project-status {
        display: none;
    }

    .app-header {
        padding: 0 20px;
    }

}

/* Field project list (projects.php): one row per project, job number on the
   left, name and address beside it. Rows stay tall enough to tap on an iPad. */

.project-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-card {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 12px 18px;
    background: white;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    text-decoration: none;
    color: #111827;
    transition: background .12s ease, border-color .12s ease;
}

.project-card:hover {
    background: #f9fafb;
    border-color: #d0d5dd;
}

.project-card-number {
    font-size: 16px;
    font-weight: 800;
    color: #344054;
}

.project-card-text {
    min-width: 0;
}

.project-card-name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.project-card-location {
    margin-top: 2px;
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-open {
    color: #98a2b3;
    font-size: 28px;
    line-height: 1;
}

/* Search box above a list (projects.php, admin-projects.php). */
.list-search {
    width: 100%;
    min-height: 46px;
    margin: 0 0 14px;
    padding: 0 14px;
    border: 1px solid #cfd5dc;
    border-radius: 9px;
    background: #fff;
    font-size: 16px; /* 16px stops iPhones zooming the page when typing */
    box-sizing: border-box;
}

.list-search:focus {
    outline: none;
    border-color: #667085;
    box-shadow: 0 0 0 3px rgba(102, 112, 133, .12);
}

.list-search-empty {
    padding: 22px 10px;
    color: #667085;
    text-align: center;
}

.list-search-empty[hidden] {
    display: none;
}

/* ---- Safety topic library (safety-topics.php) ---- */
.topic-help {
    margin: 0 0 14px;
    color: #475467;
    font-size: 14px;
    line-height: 1.5;
}

.topic-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.topic-upload button {
    width: auto;
}

.topic-upload-status {
    margin-top: 12px;
    font-weight: 700;
    color: #b54708;
}

.topic-upload-status[hidden] {
    display: none;
}

.topic-upload-log {
    margin: 8px 0 0;
    padding-left: 18px;
    max-height: 240px;
    overflow-y: auto;
    font-size: 13px;
    color: #475467;
}

.topic-upload-log .is-added { color: #027a48; }
.topic-upload-log .is-skipped { color: #667085; }
.topic-upload-log .is-failed { color: #b42318; font-weight: 600; }

.topic-list-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.topic-list-heading h2 {
    margin: 0;
}

.topic-hidden-count {
    color: #667085;
    font-size: 13px;
}

.topic-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 16px;
    align-items: center;
    padding: 12px 4px;
    border-top: 1px solid #eaecf0;
}

.topic-row[hidden] {
    display: none;
}

.topic-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.topic-title {
    color: #101828;
    font-weight: 700;
    text-decoration: none;
}

.topic-title:hover {
    text-decoration: underline;
}

.topic-meta {
    color: #667085;
    font-size: 13px;
}

.topic-row.is-hidden-topic .topic-title {
    color: #98a2b3;
}

.topic-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-actions form {
    margin: 0;
}

.topic-actions .secondary-button {
    width: auto;
    padding: 8px 14px;
}

.topic-edit-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #f9fafb;
}

.topic-edit-form[hidden] {
    display: none;
}

.topic-edit-form .form-group {
    margin: 0;
}

.topic-edit-form label span {
    color: #667085;
    font-weight: 400;
}

@media (max-width: 700px) {
    .topic-row,
    .topic-edit-form {
        grid-template-columns: 1fr;
    }
}

/* ---- Employees (employees.php); rows reuse the topic-row styles ---- */
.employee-import {
    display: grid;
    gap: 12px;
    max-width: 560px;
}

.employee-import textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd5dc;
    border-radius: 9px;
    font: inherit;
    font-size: 16px;
    box-sizing: border-box;
    resize: vertical;
}

.employee-import button,
.employee-add button {
    width: auto;
    justify-self: start;
}

.employee-add {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.employee-add .form-group {
    margin: 0;
}

@media (max-width: 700px) {
    .employee-add {
        grid-template-columns: 1fr;
    }
}
.admin-link {
    display: inline-block;
    background: #111827;
    color: white;
    padding: 10px 15px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 600px) {

    .page-heading {
        align-items: flex-start;
        gap: 15px;
        flex-direction: column;
    }

    .project-card {
        grid-template-columns: 64px 1fr auto;
        gap: 12px;
        padding: 12px 14px;
    }

    .project-card-wrap {
        flex-wrap: wrap;
    }

}

/* Project Home */

/* "Back up a level" (Plans, All Projects ...): a white bordered button like the
   site's others, with a green chevron, big enough for a thumb. */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    min-height: 40px;
    margin-bottom: 25px;
    padding: 0 14px 0 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    color: #101828;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}

.back-link::before {
    content: "";
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%231e6b3a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") no-repeat center / contain;
}

.back-link:hover {
    background: #f9fafb;
    color: #101828;
}

.back-link:active {
    background: #f2f4f7;
}

.project-heading {
    margin-bottom: 35px;
}

.project-heading-number {
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
}

.project-heading h1 {
    margin: 0 0 7px;
    font-size: 32px;
}

.project-heading p {
    margin: 0;
    color: #6b7280;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 750px;
}

.document-card {
    background: white;
    border-radius: 10px;
    padding: 35px;
    min-height: 190px;
    text-decoration: none;
    color: #111827;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: transform .15s ease, box-shadow .15s ease;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0,0,0,.12);
}

.document-icon {
    font-size: 32px;
    margin-bottom: 20px;
}

.document-title {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 7px;
}

.document-description {
    color: #6b7280;
    font-size: 14px;
}

@media (max-width: 600px) {

    .document-grid {
        grid-template-columns: 1fr;
    }

    /* Phones: each tile is a row, icon beside its name, so every section
       fits on one screen. */
    .document-grid {
        gap: 10px;
    }

    .document-card {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        column-gap: 16px;
        align-items: center;
        min-height: 0;
        padding: 16px 18px;
    }

    .document-icon {
        grid-row: span 2;
        margin: 0;
        font-size: 30px;
        line-height: 1;
        text-align: center;
    }

    .document-title {
        align-self: end;
        margin-bottom: 2px;
        font-size: 18px;
    }

    .document-description {
        align-self: start;
    }

    .project-heading h1 {
        font-size: 27px;
    }

}

.plan-set-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 5px;
    border-bottom: 1px solid #e5e7eb;
}

.plan-set-row:last-child {
    border-bottom: 0;
}

.file-detail {
    margin-top: 5px;
    color: #6b7280;
    font-size: 13px;
}

input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: white;
}

/* =========================================
   PLAN UPLOAD MODAL
========================================= */

.upload-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.upload-modal.active {
    display: flex;
}

.upload-modal-card {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 14px;
    padding: 35px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.upload-modal-card h2 {
    margin: 10px 0 8px;
    font-size: 24px;
}

.upload-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: #0f172a;
}

.upload-file-name {
    margin-top: 8px;
    color: #64748b;
    font-size: 14px;
    word-break: break-word;
}

.upload-progress-track {
    width: 100%;
    height: 14px;
    margin-top: 28px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    background: #0f172a;
    border-radius: 999px;
    transition: width 0.15s ease;
}

.upload-percentage {
    margin-top: 14px;
    font-size: 30px;
    font-weight: 700;
    color: #0f172a;
}

.upload-size {
    margin-top: 3px;
    font-size: 14px;
    color: #64748b;
}

.upload-warning {
    margin: 25px 0 18px;
    font-size: 13px;
    color: #64748b;
}

.cancel-upload-button {
    width: 100%;
    padding: 13px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.cancel-upload-button:hover {
    background: #f8fafc;
}

.cancel-upload-button:disabled {
    opacity: 0.6;
    cursor: default;
}

@media (max-width: 600px) {

    .upload-modal-card {
        padding: 28px 20px;
    }

}

/* Plan Sets */

.plan-set-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.plan-set-card {
    background: white;
    border-radius: 10px;
    padding: 25px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}

.plan-set-title {
    font-size: 18px;
    font-weight: 700;
}

.plan-sheet-count {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
}

.plan-set-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.secondary-button {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    text-decoration: none;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    background: white;
}

.secondary-button:hover {
    background: #f8fafc;
}

@media (max-width: 650px) {

    .plan-set-card {
        flex-direction: column;
        align-items: stretch;
    }

    .plan-set-actions {
        width: 100%;
    }

    .plan-set-actions a {
        flex: 1;
        text-align: center;
    }

}

/* =========================================
   PLAN SHEET INDEX
========================================= */

.sheet-index-header,
.sheet-index-row {
    display: grid;
    grid-template-columns: 110px 170px 1fr;
    gap: 12px;
    align-items: center;
}

.sheet-index-header {
    padding: 0 4px 10px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.sheet-index-row {
    padding: 8px 0;
    border-top: 1px solid #e5e7eb;
}

.sheet-index-row input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 15px;
    background: white;
}

.sheet-index-row input:focus {
    outline: none;
    border-color: #64748b;
}

.remove-sheet-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 7px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 22px;
    cursor: pointer;
}

.remove-sheet-button:hover {
    background: #fee2e2;
    color: #991b1b;
}

.add-sheet-button {
    margin-top: 18px;
}

.index-save-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 40px;
}

@media (max-width: 700px) {

    .sheet-index-header {
        display: none;
    }

    .sheet-index-row {
        grid-template-columns: 80px 120px 1fr 38px;
        gap: 7px;
    }

    .sheet-index-row input {
        padding: 10px 8px;
        font-size: 14px;
    }

}

@media (max-width: 500px) {

    .sheet-index-row {
        grid-template-columns: 65px 100px 1fr 35px;
    }

}

/* =========================================
   PLAN SHEET LIST
========================================= */

.sheet-search-container {
    margin-bottom: 18px;
}

.sheet-search {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: white;
    font-size: 16px;
}

.sheet-search:focus {
    outline: none;
    border-color: #64748b;
}

.sheet-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sheet-card {
    display: grid;
    grid-template-columns: 55px 1fr 35px;
    align-items: center;
    gap: 18px;

    padding: 18px 22px;

    background: white;
    border-radius: 10px;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.06);

    text-decoration: none;
    color: #0f172a;

    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease;
}

.sheet-card:hover {
    transform: translateY(-1px);

    box-shadow:
        0 4px 14px
        rgba(0, 0, 0, 0.09);
}

.sheet-page-number {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 7px;

    background: #f1f5f9;

    color: #64748b;

    font-size: 13px;
    font-weight: 700;
}

.sheet-number {
    font-size: 18px;
    font-weight: 700;
}

.sheet-title {
    margin-top: 4px;

    font-size: 14px;

    color: #64748b;
}

.sheet-open-arrow {
    text-align: right;

    font-size: 30px;

    color: #94a3b8;
}

.no-sheet-results {
    padding: 35px;

    text-align: center;

    color: #64748b;
}


/* MOBILE */

@media (max-width: 600px) {

    .sheet-card {
        grid-template-columns:
            45px
            1fr
            25px;

        gap: 12px;

        padding: 15px;
    }

    .sheet-page-number {
        width: 40px;
        height: 40px;
    }

    .sheet-number {
        font-size: 17px;
    }

}

/* =========================================
   PLAN VIEWER
========================================= */

.viewer-body {
    margin: 0;
    overflow: hidden;
    background: #374151;
}

.plan-viewer-header {
    height: 64px;

    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 0 20px;

    background: #111827;
    color: white;
}

.viewer-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.viewer-back {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.viewer-sheet-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.viewer-sheet-info strong {
    font-size: 17px;
}

.viewer-sheet-info span {
    margin-top: 2px;

    font-size: 12px;

    color: #cbd5e1;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewer-project {
    font-size: 13px;

    color: #cbd5e1;

    white-space: nowrap;
}

.pdf-viewer-container {
    width: 100%;
    height: calc(100vh - 64px);
}

.pdf-viewer-frame {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;

    background: #525659;
}


/* MOBILE */

@media (max-width: 700px) {

    .plan-viewer-header {
        height: 60px;
        padding: 0 12px;
    }

    .viewer-left {
        gap: 12px;
    }

    .viewer-project {
        display: none;
    }

    .pdf-viewer-container {
        height: calc(100vh - 60px);
    }

}

/* =========================================
   SHARED PROJECT NAVIGATION
========================================= */

.site-nav-header {
    min-height: 86px;
    height: auto;
    padding: 12px 28px;
    gap: 24px;
    background: #ffffff;
    color: #111827;
    border-bottom: 1px solid #dfe3e8;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.site-logo-link {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.site-logo {
    display: block;
    width: 160px;
    max-height: 58px;
    object-fit: contain;
}

/* Name (My Account) and Sign Out at the right of the header. */
.app-user-link {
    color: #344054;
    font-weight: 700;
    text-decoration: none;
}

.app-user-link:hover {
    text-decoration: underline;
}

.app-signout {
    margin-left: 12px;
    color: #667085;
    font-weight: 600;
    text-decoration: none;
}

.app-signout:hover {
    color: #b42318;
}

/* Home tile and logo, kept side by side. */
.site-brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Home tile (brand green) left of the logo: back to the project list from anywhere. */
.site-home-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--brand-accent);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.site-home-button:hover {
    background: var(--brand-accent-dark);
}

.site-home-button svg {
    width: 26px;
    height: 26px;
}

@media (max-width: 850px) {
    .site-brand {
        gap: 10px;
    }

    .site-home-button {
        width: 40px;
        height: 40px;
    }

    .site-home-button svg {
        width: 22px;
        height: 22px;
    }
}

.site-nav-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex: 1;
    min-width: 0;
    max-width: 720px;
}

.site-nav-field {
    flex: 1 1 440px;
    min-width: 0;
}

.site-nav-section-field {
    flex: 0 1 210px;
}

.site-nav-field label {
    display: block;
    margin: 0 0 5px 2px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* The Project menu is a button and Tools is a real <select>; browsers size
   those differently, so both get the same fixed height, and the select's own
   look is switched off and redrawn with the same arrow as the button. */
.site-nav-select {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    height: 42px;
    min-height: 0;
    margin: 0;
    padding: 0 36px 0 11px;
    border: 1px solid #cfd5dc;
    border-radius: 7px;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23667085' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: #111827;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 40px;
    text-align: left;
    cursor: pointer;
}

.site-nav-select:focus {
    outline: none;
    border-color: #667085;
    box-shadow: 0 0 0 3px rgba(102,112,133,.12);
}

/* ---- Pull down to refresh (Home Screen app, pull-refresh.js) ---- */
.pull-refresh {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    left: 50%;
    z-index: 6000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #d0d5dd;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .18);
    color: #667085;
    font-size: 20px;
    font-weight: 700;
    opacity: 0;
    transform: translate(-50%, -60px);
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
}

.pull-refresh.is-pulling {
    transition: none;
}

.pull-refresh.is-ready,
.pull-refresh.is-refreshing {
    color: var(--brand-accent);
    border-color: #b7dcc3;
}

.pull-refresh-icon {
    display: block;
    line-height: 1;
    transition: transform .15s ease;
}

.pull-refresh.is-refreshing .pull-refresh-icon {
    animation: pullRefreshSpin .8s linear infinite;
}

@keyframes pullRefreshSpin {
    to { transform: rotate(360deg); }
}

/* ---- Searchable project menu (header) ---- */
.project-picker {
    position: relative;
}

.project-picker-button {
    display: block;
    text-align: left;
    /* Draw the same down-arrow a <select> has. */
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23667085' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
}

.project-picker-button:hover {
    background-color: #f9fafb;
    color: #111827;
}

.project-picker-button span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 280px;
    z-index: 5100;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
}

.project-picker-panel[hidden] {
    display: none;
}

.project-picker-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 11px;
    border: 1px solid #cfd5dc;
    border-radius: 7px;
    font: inherit;
    font-size: 16px; /* 16px stops iPhones zooming the page when typing */
}

.project-picker-search:focus {
    outline: none;
    border-color: #667085;
}

.project-picker-list {
    max-height: 320px;
    margin-top: 6px;
    overflow-y: auto;
}

/* Tools menu options share this look (own class, so the project search
   in header.php never picks them up). */
.project-picker-option,
.tools-picker-option {
    display: block;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #344054;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.project-picker-option strong {
    margin-right: 6px;
    color: #101828;
}

.project-picker-option:hover,
.project-picker-option.is-active,
.tools-picker-option:hover,
.tools-picker-option.is-active {
    background: #f2f4f7;
    color: #101828;
}

.project-picker-option.is-current,
.tools-picker-option.is-current {
    box-shadow: inset 3px 0 0 var(--brand-accent);
}

.tools-picker-option.is-current {
    color: #101828;
    font-weight: 700;
}

/* Tools sits at the right of the header: open the menu from the right edge,
   narrower than the project list, and without a search box. */
.tools-picker-panel {
    left: auto;
    right: 0;
    min-width: 190px;
    padding: 6px;
}

.tools-picker-option:focus {
    outline: none;
}

.project-picker-option[hidden],
.project-picker-group[hidden] {
    display: none;
}

.project-picker-group {
    margin: 8px 10px 4px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* "Nearest" shortcut above the project list (header.php). */
/* Nearest sits in its own green-tinted box so it stands apart from the list. */
.project-picker-nearest {
    margin-top: 8px;
    padding: 4px;
    border: 1px solid #b7dcc3;
    border-radius: 9px;
    background: #eef7f1;
}

.project-picker-nearest .project-picker-heading {
    margin: 6px 8px 4px;
    color: var(--brand-accent);
}

.project-picker-nearest .project-picker-heading::before {
    content: "📍 ";
}

/* Space between the box and the full list under it. */
.project-picker-nearest + .project-picker-list {
    margin-top: 8px;
}

.project-picker-nearest .project-picker-nearest-option {
    background: #ffffff;
    border: 1px solid #fde4c4;
    margin-bottom: 4px;
    font-weight: 600;
}

.project-picker-nearest .project-picker-nearest-option:hover,
.project-picker-nearest .project-picker-nearest-option.is-active {
    background: #dcefe3;
}

.project-picker-nearest .project-picker-nearest-option:last-child {
    margin-bottom: 0;
}

.project-picker-nearest[hidden] {
    display: none;
}

/* "Recent" jobs under Nearest (header.php): the same box, in grey. */
.project-picker-recent {
    margin-top: 8px;
    padding: 4px;
    border: 1px solid #c4cad4;
    border-radius: 9px;
    background: #e1e5eb;
}

.project-picker-recent[hidden] {
    display: none;
}

.project-picker-recent .project-picker-heading {
    margin: 6px 8px 4px;
    color: #475467;
}

.project-picker-recent .project-picker-heading::before {
    content: "🕘 ";
}

.project-picker-recent .project-picker-recent-option {
    background: #ffffff;
    border: 1px solid #c4cad4;
    margin-bottom: 4px;
    font-weight: 600;
}

.project-picker-recent .project-picker-recent-option:hover {
    background: #f2f4f7;
}

.project-picker-recent .project-picker-recent-option:last-child {
    margin-bottom: 0;
}

/* Shorter full list under it, so the menu still fits on a phone. */
.project-picker-recent:not([hidden]) + .project-picker-list {
    margin-top: 8px;
    max-height: min(320px, 34vh);
}

.project-picker-heading {
    margin: 8px 10px 4px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.project-picker-nearest-option {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.project-picker-distance {
    margin-left: auto;
    padding-left: 10px;
    color: var(--brand-accent);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.project-picker-nearest-note {
    padding: 10px;
    color: #667085;
    font-size: 13px;
}

.project-picker-empty {
    padding: 14px 10px;
    color: #667085;
    font-size: 14px;
}

.site-nav-header .app-user {
    flex: 0 0 auto;
    color: #667085;
    font-size: 14px;
    white-space: nowrap;
}

@media (max-width: 850px) {
    .site-nav-header {
        flex-wrap: wrap;
        padding: 10px 16px 12px;
        gap: 10px 14px;
    }

    .site-logo {
        width: 120px;
        max-height: 48px;
    }

    .site-nav-header .app-user {
        margin-left: auto;
    }

    .site-nav-controls {
        order: 3;
        flex: 0 0 100%;
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 520px) {
    .site-nav-header {
        padding: 9px 12px 11px;
    }

    .site-logo {
        width: 105px;
    }

    .site-nav-controls {
        gap: 8px;
    }

    .site-nav-field {
        flex: 1 1 62%;
    }

    .site-nav-section-field {
        flex: 1 1 38%;
    }

    .site-nav-select {
        height: 44px;
        line-height: 42px;
        padding-left: 9px;
        padding-right: 28px;
        background-position: right 10px center;
        font-size: 13px;
    }

    .site-nav-field label {
        font-size: 10px;
    }

    .site-nav-header .app-user {
        font-size: 12px;
    }
}


/* Extra logo sizing safeguard */
.site-nav-header .site-logo,
.app-header .site-logo {
    width: 160px !important;
    height: auto !important;
    max-width: 160px !important;
    max-height: 58px !important;
}
@media (max-width: 850px) {
    .site-nav-header .site-logo,
    .app-header .site-logo {
        width: 120px !important;
        max-width: 120px !important;
        max-height: 48px !important;
    }
}
@media (max-width: 520px) {
    .site-nav-header .site-logo,
    .app-header .site-logo {
        width: 105px !important;
        max-width: 105px !important;
    }
}

/* Keep main navigation visible while scrolling */
.site-nav-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* =========================================
   STICKY / FROZEN PROJECT NAVIGATION
========================================= */
.site-nav-header {
    position: sticky;
    top: 0;
    z-index: 5000;
}

/* Keep the drawing viewer toolbar below the frozen main header. */
.viewer-body .plan-viewer-header {
    position: sticky;
    top: 86px;
    z-index: 4000;
}

@media (max-width: 850px) {
    .viewer-body .plan-viewer-header {
        top: 118px;
    }
}

@media (max-width: 520px) {
    .viewer-body .plan-viewer-header {
        position: relative;
        top: auto;
    }
}

.delete-spec-button {
    color: #b42318 !important;
    background: #ffffff !important;
    border: 1px solid #d0d5dd !important;
}

.delete-spec-button:hover {
    color: #912018 !important;
    background: #fef3f2 !important;
    border-color: #fda29b !important;
}

/* =========================================
   BRAND ACCENT (forest green) - main action buttons
   (Manage Projects, Upload, Publish, Upload Drawings, Download Set ...)
   Outlined white buttons (secondary) stay as they are.
========================================= */
:root {
    /* Deep enough for white text to stay readable outdoors (about 4.5:1). */
    --brand-accent: #1e6b3a;
    --brand-accent-dark: #17552e;
}

.admin-link,
.primary-button {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: #fff;
}

.admin-link:hover,
.primary-button:hover {
    background: var(--brand-accent-dark);
    border-color: var(--brand-accent-dark);
    color: #fff;
}

/* Disabled stays grey (after the rules above so it wins). */
.primary-button:disabled,
.primary-button:disabled:hover {
    background: #d0d5dd;
    border-color: #d0d5dd;
    color: #667085;
}
/* ---- Safety topic distribution list (safety-topics.php) ---- */
.recipient-list {
    margin-bottom: 14px;
}

.recipient-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px;
    border-top: 1px solid #eaecf0;
}

.recipient-row form {
    margin: 0;
}

.recipient-row .secondary-button {
    width: auto;
    padding: 8px 14px;
}

.recipient-empty {
    margin: 0 0 14px;
}

.recipient-add {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
    align-items: end;
    padding-top: 14px;
    border-top: 1px solid #eaecf0;
}

/* The people dropdown and the Add button take a full row each. */
.recipient-add .recipient-pick,
.recipient-add button {
    grid-column: 1 / -1;
}

/* The site's own field look (white, grey border, the Project menu's arrow):
   without it iPhones and iPads draw their grey pill. */
.recipient-add .recipient-pick select {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 10px 38px 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23667085' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 14px center;
    color: #101828;
    font: inherit;
    font-size: 16px;
}

.recipient-add .recipient-pick select:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 107, 58, .12);
    outline: none;
}

.recipient-add .recipient-other[hidden] {
    display: none;
}

.recipient-add .form-group {
    margin: 0;
}

.recipient-add label span {
    color: #667085;
    font-weight: 400;
}

.recipient-add button {
    width: auto;
    justify-self: start;
}

@media (max-width: 700px) {
    .recipient-add {
        grid-template-columns: 1fr;
    }
}

/* ---- A job's toolbox talks (safety.php) ---- */
.safety-new-talk {
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 12px 18px;
    text-decoration: none;
    white-space: nowrap;
}

.safety-week-note {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #b2ddff;
    border-radius: 9px;
    background: #eff8ff;
    color: #194185;
    font-size: 14px;
}

.safety-outbox {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #fedf89;
    border-radius: 9px;
    background: #fffaeb;
    color: #7a2e0e;
    font-size: 14px;
}

.safety-outbox[hidden] {
    display: none;
}

.safety-outbox-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.safety-outbox-item.has-error {
    color: #b42318;
    font-weight: 600;
}

.safety-outbox .secondary-button {
    width: auto;
    justify-self: start;
    padding: 8px 14px;
}

.safety-empty {
    margin: 0;
    color: #475467;
}

.safety-talk-row {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 4px;
    border-top: 1px solid #eaecf0;
}

.safety-talk-row:first-child {
    border-top: 0;
}

.safety-talk-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    border-radius: 8px;
    background: #f2f4f7;
    color: #475467;
    font-size: 11px;
    line-height: 1.3;
    text-transform: uppercase;
}

.safety-talk-date strong {
    color: #101828;
    font-size: 17px;
}

.safety-talk-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.safety-talk-info strong {
    color: #101828;
}

.safety-talk-info span {
    color: #667085;
    font-size: 13px;
}

.safety-talk-row.is-void .safety-talk-info strong {
    color: #98a2b3;
    text-decoration: line-through;
}

.safety-talk-info .safety-void-note {
    color: #b42318;
    font-weight: 600;
}

.safety-talk-actions {
    display: flex;
    gap: 8px;
}

.safety-talk-actions form {
    margin: 0;
}

.safety-talk-actions .secondary-button {
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 8px 14px;
    text-decoration: none;
}

@media (max-width: 600px) {
    .safety-talk-row {
        grid-template-columns: 52px 1fr;
    }

    .safety-talk-actions {
        grid-column: 1 / -1;
    }
}

/* ---- Holding a toolbox talk (safety-talk.php) ---- */
.talk-page .page-heading .secondary-button {
    width: auto;
    text-decoration: none;
}

.talk-step h2 {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 0;
}


.talk-help {
    margin: 0 0 12px;
    color: #667085;
    font-size: 14px;
}

.talk-link-button {
    width: auto;
    padding: 6px 2px;
    border: 0;
    background: none;
    color: #475467;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.talk-resumed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #ecfdf3;
    color: #05603a;
    font-size: 14px;
}

.talk-resumed[hidden] {
    display: none;
}





.talk-crew-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #ffffff;
    color: #101828;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}

.talk-crew-person:hover {
    border-color: #667085;
}


/* The talk date, on the Sign & Complete screen. */

.talk-date-line {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.talk-date-line strong {
    color: #101828;
}

.talk-date-line [hidden] {
    display: none;
}

.talk-date-input {
    width: auto;
    max-width: 200px;
    padding: 6px 10px;
    font-size: 16px;
}



.talk-step textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd5dc;
    border-radius: 9px;
    font: inherit;
    font-size: 16px;
    box-sizing: border-box;
    resize: vertical;
}

.talk-leader-name {
    margin: 0 0 8px;
    font-weight: 600;
}

/* The signing box: a line to sign on, and no page scrolling while drawing. */
.signature-pad {
    position: relative;
    height: 160px;
    border: 1px solid #98a2b3;
    border-radius: 10px;
    background:
        linear-gradient(#98a2b3, #98a2b3) 20px calc(100% - 38px) / calc(100% - 40px) 1px no-repeat,
        #ffffff;
    touch-action: none;
    overflow: hidden;
}

.signature-pad canvas {
    display: block;
    touch-action: none;
    cursor: crosshair;
}

.signature-pad-large {
    height: min(42vh, 320px);
}

.talk-pad-actions {
    display: flex;
    justify-content: flex-end;
}

.talk-signed-count {
    color: #027a48;
    font-size: 15px;
}

.talk-crew-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.talk-crew-person.is-signed {
    border-color: #6ce9a6;
    background: #ecfdf3;
}

.talk-crew-status {
    flex-shrink: 0;
    color: #667085;
    font-size: 12px;
}

.talk-crew-person.is-signed .talk-crew-status {
    color: #027a48;
    font-weight: 700;
}

/* GC forms: the form's sign-in lines are all used (form-fill.js). */
.talk-crew-person.is-full {
    opacity: 0.5;
}

.talk-add-name {
    display: flex;
    gap: 8px;
}

.talk-add-name input {
    flex: 1;
    min-width: 0;
    font-size: 16px;
}

.talk-add-name button {
    width: auto;
    white-space: nowrap;
}

.talk-finish {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin: 8px 0 40px;
}

.talk-finish-status {
    margin: 0;
    color: #475467;
    font-weight: 600;
    text-align: center;
}

.talk-finish-status.is-error {
    color: #b42318;
}


.talk-discard {
    color: #b42318;
}

/* One crew member signing: fills the screen so there is room to sign. */
.signature-modal {
    position: fixed;
    inset: 0;
    z-index: 6000; /* above the sticky site header (5000) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(16, 24, 40, .55);
}

.signature-modal[hidden] {
    display: none;
}

.signature-modal-box {
    width: min(100%, 820px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(16, 24, 40, .3);
}

.signature-modal-box h2 {
    margin: 0 0 4px;
    font-size: 24px;
}

.signature-modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.signature-modal-spacer {
    flex: 1;
}

.signature-modal-actions .secondary-button,
.signature-modal-actions .primary-button {
    width: auto;
    min-height: 48px;
    padding: 10px 20px;
}

.talk-remove {
    color: #b42318;
}

body.signature-open {
    overflow: hidden;
}

/* Choose Topic > Read > Sign & Complete. */
.talk-progress {
    display: flex;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    counter-reset: talk-step;
}

.talk-progress li {
    flex: 1;
    padding: 9px 10px;
    border-radius: 8px;
    background: #f2f4f7;
    color: #667085;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    counter-increment: talk-step;
}

.talk-progress li::before {
    content: counter(talk-step) ". ";
}

.talk-progress li.is-current {
    background: var(--brand-accent);
    color: #ffffff;
}

.talk-progress li.is-done {
    background: #e8f3ec;
    color: var(--brand-accent);
}

.talk-view[hidden] {
    display: none;
}

/* 1. The topic list, like the Specifications list. */
.topic-search {
    width: 100%;
    min-height: 52px;
    margin: 0 0 20px;
    padding: 0 16px;
    border: 1px solid #cfd5dc;
    border-radius: 9px;
    background: #ffffff;
    font-size: 17px;
    box-sizing: border-box;
}

.topic-search:focus {
    outline: none;
    border-color: #667085;
    box-shadow: 0 0 0 3px rgba(102, 112, 133, .12);
}

.talk-page .division {
    margin-bottom: 22px;
}

.talk-page .division-title {
    margin: 0 0 8px;
    color: #667085;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.talk-page .section-list {
    overflow: hidden;
    border: 1px solid #d8dde4;
    border-radius: 10px;
    background: #ffffff;
}

.talk-page .section-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    border-top: 1px solid #eaecf0;
    background: #ffffff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}

.talk-page .section-row:first-child {
    border-top: 0;
}

.talk-page .section-row:hover {
    background: #f9fafb;
}

.talk-page .section-row.is-recent {
    box-shadow: inset 4px 0 0 #fdb022;
}

.talk-page .section-main {
    flex: 1;
    min-width: 0;
}

.talk-page .section-title {
    color: #101828;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.talk-page .section-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fffaeb;
    color: #b54708;
    font-size: 12px;
    font-weight: 700;
}

.talk-page .section-pages {
    flex: 0 0 auto;
    color: #98a2b3;
    font-size: 13px;
}

.talk-page .section-arrow {
    flex: 0 0 auto;
    color: #7a8492;
    font-size: 26px;
    line-height: 1;
}

.talk-page .no-section-results {
    padding: 28px 15px;
    color: #667085;
    text-align: center;
}

/* 2. Reading the topic: its pages, full width, with Sign & Complete below. */
.talk-read-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.talk-read-head h2 {
    margin: 0;
    font-size: 22px;
}

.talk-read-head .secondary-button,
.talk-summary .secondary-button {
    width: auto;
    flex-shrink: 0;
    padding: 10px 14px;
}

.talk-topic-pages {
    display: grid;
    gap: 14px;
    padding-bottom: 96px; /* room above the Sign & Complete bar */
}

/* English / Español and Read Aloud, above the topic. */
.talk-read-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.talk-lang {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #f2f4f7;
}

.talk-lang-button,
.talk-lang-button:hover {
    width: auto;
    padding: 10px 18px;
    border-radius: 8px;
    background: transparent;
    color: #344054;
    font-size: 16px;
    font-weight: 600;
}

.talk-lang-button.is-current,
.talk-lang-button.is-current:hover {
    background: #ffffff;
    color: #101828;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .15);
}

.talk-lang-button:disabled {
    color: #98a2b3;
    cursor: not-allowed;
}

.talk-speak {
    display: flex;
    gap: 8px;
}

.talk-speak-button {
    width: auto;
    padding: 12px 18px;
    font-size: 16px;
}

.talk-voice {
    max-width: 220px;
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    font-size: 15px;
}

.talk-speak {
    flex-wrap: wrap;
}

.talk-speak-note {
    flex-basis: 100%;
    margin: 0;
    color: #b54708;
    font-size: 14px;
}

/* The Spanish text: large and easy to read to a crew, the paragraph being read highlighted. */
.talk-topic-text {
    padding: 20px 22px 96px;
    border: 1px solid #d8dde4;
    border-radius: 6px;
    background: #ffffff;
    font-size: 19px;
    line-height: 1.6;
    color: #101828;
}

.talk-topic-text p {
    margin: 0 0 14px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: pre-line;
    transition: background-color .2s;
}

.talk-topic-text p.is-reading {
    background: #fef0c7;
}

.talk-topic-page {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #d8dde4;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

.talk-page-missing {
    padding: 40px 20px;
    border: 1px dashed #d0d5dd;
    border-radius: 8px;
    color: #667085;
    text-align: center;
}

.talk-sticky {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    justify-content: center;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #eaecf0;
    background: rgba(255, 255, 255, .96);
}

.talk-big-button {
    width: min(100%, 420px);
    min-height: 56px;
    font-size: 18px;
}

/* 3. Sign & Complete. */
.talk-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.talk-summary > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.talk-summary-label {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.talk-summary > div > strong {
    font-size: 18px;
}

.talk-summary .talk-date-line {
    color: #475467;
    font-size: 14px;
}

.talk-optional {
    color: #667085;
    font-size: 15px;
    font-weight: 400;
}

@media (max-width: 650px) {
    .talk-page .section-row {
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .talk-page .section-pages {
        display: none;
    }

    .talk-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .talk-progress li {
        font-size: 12px;
    }
}

/* Toolbox talk email status (safety.php, admins). */
.safety-talk-info .safety-email-status {
    color: #667085;
    font-size: 12px;
}

.safety-talk-info .safety-email-status.is-sent {
    color: #027a48;
}

.safety-talk-info .safety-email-status.is-failed {
    color: #b42318;
    font-weight: 600;
}

/* ---- Drag and drop upload (documents.php, admins) ---- */
.drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(30, 107, 58, .12);
    border: 4px dashed var(--brand-accent);
    pointer-events: none; /* the rows underneath still say where the drop lands */
}

.drop-overlay[hidden] {
    display: none;
}

.drop-overlay-box {
    padding: 16px 24px;
    border-radius: 12px;
    background: var(--brand-accent);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .25);
}

.document-row.is-drop-target {
    outline: 3px solid var(--brand-accent);
    outline-offset: -3px;
    background: #eef7f1;
}

.drop-panel {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 6100;
    width: min(420px, calc(100vw - 32px));
    max-height: 60vh;
    overflow-y: auto;
    padding: 14px 16px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .2);
}

.drop-panel[hidden] {
    display: none;
}

.drop-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.drop-panel-close {
    width: auto;
    padding: 0 6px;
    border: 0;
    background: none;
    color: #475467;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.drop-panel-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.drop-panel-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    font-size: 13px;
}

.drop-file-name {
    overflow: hidden;
    color: #101828;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drop-file-status {
    color: #667085;
}

.drop-file-track {
    grid-column: 1 / -1;
    height: 4px;
    border-radius: 2px;
    background: #eaecf0;
    overflow: hidden;
}

.drop-file-bar {
    display: block;
    width: 0;
    height: 100%;
    background: var(--brand-accent);
    transition: width .15s;
}

.drop-panel-list li.is-done .drop-file-status {
    color: #027a48;
    font-weight: 600;
}

.drop-panel-list li.is-failed .drop-file-status {
    color: #b42318;
    font-weight: 600;
}

.drop-panel-list li.is-failed .drop-file-bar {
    background: #fda29b;
    width: 100%;
}

/* Same-name files dropped: Replace / Skip / Cancel. */
.drop-panel-list li.drop-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.drop-panel-list li.drop-choices button {
    width: auto;
    padding: 8px 14px;
}

.drop-panel-list li.drop-choices-note {
    display: block;
    color: #667085;
    font-size: 12px;
}

/* Replace / Skip on one file's line (the server found the same name). */
.drop-panel-list .drop-line-choices {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
}

.drop-panel-list .drop-line-choices button {
    width: auto;
    padding: 6px 12px;
    font-size: 13px;
}

/* 4. Review (safety-talk.php): the talk as it will go out. */
.talk-review h2 {
    margin: 2px 0 4px;
    font-size: 24px;
}

.talk-review-job {
    margin: 0 0 16px;
    color: #475467;
}

.talk-review-details {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px 14px;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid #eaecf0;
    border-radius: 9px;
    background: #f9fafb;
}

.talk-review-details dt {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.talk-review-details dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #101828;
}

.talk-review-note {
    margin: 2px 0 14px;
    white-space: pre-wrap;
}

.talk-review-crew-title {
    margin: 8px 0 8px;
    font-size: 17px;
}

.talk-review-crew {
    border-top: 1px solid #eaecf0;
}

.talk-review-person {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eaecf0;
}

.talk-review-name {
    font-weight: 600;
}

.talk-review-time {
    color: #667085;
    font-size: 13px;
}

/* Signatures shown small, on white, like on the PDF. */
.talk-review-signature {
    display: block;
    height: 44px;
    width: auto;
    max-width: 180px;
    border: 1px solid #eaecf0;
    border-radius: 6px;
    background: #ffffff;
}

.talk-edit-button {
    width: min(100%, 420px);
    min-height: 48px;
}

@media (max-width: 600px) {
    .talk-review-person {
        grid-template-columns: 1fr auto;
    }

    .talk-review-person .talk-review-signature {
        grid-column: 1 / -1;
    }
}

/* ---- T&M tickets (tm.php, tm-tickets.php, tm-ticket.php) ---- */
.tm-card-title {
    margin-top: 0;
    font-size: 19px;
}

.tm-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 4px;
    border-top: 1px solid #eaecf0;
}

.tm-row:first-child {
    border-top: 0;
}

.tm-row-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    border-radius: 8px;
    background: #f2f4f7;
    color: #475467;
    font-size: 11px;
    line-height: 1.3;
    text-transform: uppercase;
}

.tm-row-number strong {
    color: #101828;
    font-size: 17px;
}

.tm-row.is-billed .tm-row-number {
    background: #ecfdf3;
}

.tm-row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.tm-row-info > strong {
    color: #101828;
}

.tm-row-info > span {
    color: #667085;
    font-size: 13px;
}

.tm-day {
    color: #667085;
    font-size: 13px;
    font-weight: 600;
}

.tm-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
}

.tm-badge {
    padding: 2px 9px;
    border-radius: 999px;
    background: #fef0c7;
    color: #93370d;
    font-size: 12px;
    font-weight: 700;
}

.tm-badge.is-signed {
    background: #ecfdf3;
    color: #05603a;
}

.tm-badge.is-billed {
    background: #e0f2fe;
    color: #075985;
}

.tm-badge.is-quiet {
    background: #f2f4f7;
    color: #475467;
    font-weight: 600;
}

.tm-badge.is-revised {
    background: #f4ebff;
    color: #6941c6;
}

.tm-badge.is-processed {
    background: #e8f3ec;
    color: var(--brand-accent);
}

.tm-row.is-processed .tm-row-number {
    background: #e8f3ec;
}

/* One piece of T&M work with its days underneath (tm-helpers.php). */
.tm-work {
    border-top: 1px solid #eaecf0;
}

.tm-work:first-child {
    border-top: 0;
}

.tm-work .tm-row {
    border-top: 0;
}

.tm-work-toggle {
    width: auto;
}

.tm-badge.is-open {
    background: #eff8ff;
    color: #175cd3;
}

.tm-work-days {
    margin: 0 0 10px 30px;
    border-left: 3px solid #eaecf0;
    padding-left: 12px;
}

.tm-work-days[hidden] {
    display: none;
}

.tm-day-row {
    padding: 8px 4px;
    border-top: 1px dashed #eaecf0 !important;
}

.tm-day-row:first-child {
    border-top: 0 !important;
}

.tm-day-row .tm-row-number {
    padding: 4px 0;
    background: transparent;
}

.tm-day-row .tm-row-number strong {
    font-size: 15px;
}

.tm-day-row .tm-day {
    margin-left: 6px;
    font-weight: 500;
}

@media (max-width: 650px) {
    .tm-work-days {
        margin-left: 8px;
        padding-left: 8px;
    }
}

.tm-badge.is-failed {
    background: #fee4e2;
    color: #b42318;
}

.tm-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.tm-row-actions form {
    margin: 0;
}

.tm-row-actions .secondary-button,
.tm-row-actions .primary-button {
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 8px 14px;
    /* Buttons don't take the page's font on their own; match the links. */
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    text-decoration: none;
    cursor: pointer;
}

/* Same height as Download beside it (which has a 1 px border). */
.tm-row-actions .primary-button {
    border: 1px solid var(--brand-accent);
}

.tm-open-list {
    display: grid;
    gap: 10px;
}

.tm-open-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
}

.tm-open-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.tm-open-info span {
    color: #667085;
    font-size: 13px;
}

.tm-open-item > .primary-button {
    width: auto;
    padding: 10px 18px;
}

.tm-show-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    border-radius: 10px;
    background: #eaecf0;
}

.tm-show-tabs .status-tab {
    padding: 9px 14px;
    border-radius: 7px;
    color: #475467;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.tm-show-tabs .status-tab.is-current {
    background: #fff;
    color: #101828;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.tm-tab-count {
    color: #667085;
    font-weight: 600;
}

/* Just the Job picker; choosing a job shows it right away. */
.tm-filters {
    display: grid;
    grid-template-columns: minmax(0, 560px);
    gap: 12px;
    align-items: end;
}

.tm-filters .form-group {
    margin: 0;
}

/* The Job list looks like the date and search boxes beside it. */
.tm-filters input,
.tm-filters select {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
}

.tm-filters select {
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #fff;
    color: #101828;
    font-size: 16px;
}

.tm-filters select:focus {
    outline: none;
    border-color: #374151;
}

.tm-filter-buttons .primary-button,
.tm-filter-buttons .secondary-button {
    height: 48px;
}

.tm-filter-buttons {
    display: flex;
    gap: 8px;
}

.tm-filter-buttons .secondary-button {
    display: inline-flex;
    align-items: center;
}

/* The ticket form. */
.tm-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tm-page .admin-card > .primary-button {
    min-height: 48px;
}

.tm-completed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    margin-top: 12px;
    font-weight: 600;
}

.tm-completed label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
}

.tm-completed input {
    width: 22px;
    height: 22px;
    margin: 0;
}

.tm-lines {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.tm-lines:empty {
    display: none;
}

.tm-line {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 80px minmax(0, 1.4fr) 40px;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    background: #fcfcfd;
}

#materialLines .tm-line,
#miscLines .tm-line,
#equipmentLines .tm-line {
    grid-template-columns: minmax(0, 2.5fr) 80px minmax(0, 1.6fr) 40px;
}

.tm-line-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    margin: 0;
}

.tm-line-label {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.tm-line-field input,
.tm-line-field select {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
}

.tm-line-field input[readonly] {
    border-color: transparent;
    background: transparent;
    font-weight: 700;
}

.tm-line-remove {
    width: 40px;
    height: 44px;
    padding: 0;
    border: 1px solid #fecdca;
    border-radius: 8px;
    background: #fff;
    color: #b42318;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.tm-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tm-add-row select {
    flex: 1;
    min-width: 200px;
    min-height: 46px;
    font-size: 16px;
}

.tm-add-row .secondary-button,
.tm-add-line {
    width: auto;
    min-height: 46px;
    cursor: pointer;
}

.file-picker {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.tm-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.tm-photos:empty {
    display: none;
}

.tm-photo {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f2f4f7;
}

.tm-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(16, 24, 40, .7);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.tm-signer-list {
    display: grid;
    gap: 8px;
}

.tm-signer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.tm-signer-option.is-picked {
    border-color: var(--brand-accent);
    background: #e8f3ec;
}

.tm-signer-option input {
    width: 22px;
    height: 22px;
    margin: 0;
    flex: none;
    accent-color: var(--brand-accent);
}

.tm-signer-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tm-signer-text span {
    color: #667085;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.tm-sign-now {
    width: auto;
    min-height: 48px;
    margin-top: 12px;
    cursor: pointer;
}

.tm-signed-here {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #ecfdf3;
    color: #05603a;
    font-weight: 700;
}

.tm-page [hidden] {
    display: none !important;
}

.tm-review-title {
    margin: 2px 0 12px;
}

.tm-review-row {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid #eaecf0;
}

.tm-review-row .talk-summary-label {
    width: 140px;
    flex: none;
}

.tm-review-block {
    margin-top: 16px;
}

.tm-review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tm-review-table th {
    padding: 6px 8px;
    border-bottom: 1px solid #d0d5dd;
    color: #667085;
    font-size: 12px;
    text-align: left;
}

.tm-review-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #eaecf0;
}

.tm-review-signatures {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.tm-review-unsigned {
    margin: 4px 0 0;
    color: #93370d;
    font-weight: 600;
}

.tm-review-sendto {
    margin: 18px 0 0;
    padding: 10px 12px;
    border-radius: 9px;
    background: #f2f4f7;
    color: #344054;
    font-weight: 600;
}


@media (max-width: 650px) {
    .tm-row {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .tm-row-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .tm-two {
        grid-template-columns: 1fr;
    }

    .tm-line,
    #materialLines .tm-line,
    #miscLines .tm-line,
    #equipmentLines .tm-line {
        grid-template-columns: 1fr 1fr;
    }

    .tm-line .tm-line-name,
    .tm-line .tm-line-remarks {
        grid-column: 1 / -1;
    }

    .tm-line-remove {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* ---- Admin (admin.php, admin-nav.php) ---- */
.app-admin-link {
    margin-right: 14px;
    color: var(--brand-accent);
    font-weight: 700;
    text-decoration: none;
}

.app-admin-link:hover {
    text-decoration: underline;
}

.admin-home-button {
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 10px 20px;
    font-size: 15px;
    text-decoration: none;
}

/* The tab bar under the site header on every admin page. */
.admin-nav {
    background: #fff;
    border-bottom: 1px solid #e4e7ec;
}

.admin-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 25px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.admin-nav-inner::-webkit-scrollbar {
    display: none;
}

.admin-nav-label {
    flex: none;
    margin-right: 10px;
    color: #98a2b3;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.admin-nav-tab {
    flex: none;
    padding: 13px 12px 11px;
    border-bottom: 3px solid transparent;
    color: #475467;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.admin-nav-tab:hover {
    color: #101828;
}

.admin-nav-tab.is-current {
    border-bottom-color: var(--brand-accent);
    color: var(--brand-accent);
}

/* The Admin page's tiles. */
.admin-group {
    margin-bottom: 26px;
}

.admin-group-title {
    margin: 0 0 10px;
    color: #667085;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.admin-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-tile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 20px 20px 22px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    color: #101828;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.admin-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .12);
}

.admin-tile-icon {
    flex: none;
    font-size: 30px;
    line-height: 1;
}

.admin-tile-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.admin-tile-title {
    font-size: 18px;
    font-weight: 700;
}

.admin-tile-text {
    color: #6b7280;
    font-size: 14px;
}

.admin-tile-stat {
    margin-top: 4px;
    color: var(--brand-accent);
    font-size: 13px;
    font-weight: 700;
}

.admin-tile-arrow {
    flex: none;
    color: #98a2b3;
    font-size: 26px;
}

@media (max-width: 700px) {
    .admin-tiles {
        grid-template-columns: 1fr;
    }

    .admin-nav-inner {
        padding: 0 12px;
    }

    .admin-nav-label {
        display: none;
    }
}

/* ---- Project import (admin-projects.php) ---- */
.import-preview {
    max-height: 460px;
    overflow: auto;
    margin: 12px 0 16px;
    border: 1px solid #eaecf0;
    border-radius: 9px;
}

.import-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.import-preview th {
    position: sticky;
    top: 0;
    padding: 8px 10px;
    border-bottom: 1px solid #d0d5dd;
    background: #f9fafb;
    color: #667085;
    font-size: 12px;
    text-align: left;
    text-transform: uppercase;
}

.import-preview td {
    padding: 8px 10px;
    border-bottom: 1px solid #eaecf0;
    vertical-align: top;
}

.import-result {
    font-weight: 600;
    white-space: nowrap;
}

.import-preview tr.is-new .import-result {
    color: var(--brand-accent);
}

.import-preview tr.is-exists td,
.import-preview tr.is-repeat td {
    color: #98a2b3;
}

.import-preview tr.is-problem .import-result {
    color: #b42318;
}

.import-confirm fieldset {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
}

.import-confirm legend {
    float: left;
    margin-right: 6px;
    font-weight: 700;
}

.import-confirm label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.import-confirm input[type="radio"] {
    width: auto;
    margin: 0;
}

.import-buttons {
    display: flex;
    gap: 10px;
}

.import-buttons .primary-button,
.import-buttons .secondary-button {
    display: inline-flex;
    align-items: center;
    width: auto;
}

/* ---- Plans Import (admin-plan-import.php) ---- */
.plan-import-list {
    display: grid;
}

.plan-import-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 4px;
    border-top: 1px solid #eaecf0;
}

.plan-import-row:first-child {
    border-top: 0;
}

.plan-import-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.plan-import-info span {
    color: #667085;
    font-size: 13px;
}

.plan-import-info .plan-import-status {
    color: #344054;
    font-weight: 600;
}

.plan-import-row .primary-button,
.plan-import-row .secondary-button {
    display: inline-flex;
    align-items: center;
    flex: none;
    width: auto;
    text-decoration: none;
}

/* "Show N finished projects" under the Plans Import list (Photo Import has its own). */
.plan-import-list + .show-finished,
.admin-card + .show-finished {
    display: inline-block;
    margin-top: 14px;
    color: #475467;
    font-size: 14px;
    font-weight: 600;
}

/* Import All above the Plans Import list. */
.plan-import-all {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 16px;
}

.plan-import-all .primary-button {
    width: auto;
}

.plan-import-all span {
    color: #475467;
    font-size: 14px;
    font-weight: 600;
}

/* ---- Forms (forms.php, form-fill.php) ---------------------------------------------- */

.form-field {
    display: block;
}

.form-field-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.form-field input[type="date"] {
    max-width: 260px;
}

.form-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-chip {
    width: auto;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
}

.form-chip::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid #98a2b3;
    border-radius: 4px;
    vertical-align: -2px;
}

.form-chip.is-on {
    border-color: var(--brand-accent);
    background: #e8f3ec;
    color: var(--brand-accent-dark);
}

.form-chip.is-on::before {
    border-color: var(--brand-accent);
    background: var(--brand-accent);
    box-shadow: inset 0 0 0 2px #fff;
}

.form-choice .form-field-label {
    font-weight: 600;
}

.form-crew-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.form-sign-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    background: #fff;
}

.form-sign-line button {
    width: auto;
}

.form-sign-name {
    flex: 1;
    min-width: 0;
}

.form-sign-name-input {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 16px;
}

.form-sign-picture {
    height: 44px;
    max-width: 160px;
    object-fit: contain;
    border-bottom: 1px solid #d0d5dd;
}

.form-sign-button {
    padding: 10px 18px;
}

.form-cc {
    margin-top: 16px;
}

.form-cc-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-weight: 500;
}

.form-cc-option input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--brand-accent);
}

/* Review: the GC's form with the answers laid on it, like the PDF. */
.form-review-pages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-review-page {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid #d0d5dd;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

.form-review-page > img {
    display: block;
    width: 100%;
    height: 100%;
}

.form-review-value {
    position: absolute;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-left: 0.3%;
    color: #142878;
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1.15;
    white-space: nowrap;
}

.form-review-multiline {
    align-items: flex-start;
    white-space: pre-wrap;
}

.form-review-checkbox {
    justify-content: center;
    padding: 0;
}

.form-review-value img {
    max-width: 100%;
    max-height: 100%;
}

.form-review-value.has-name .form-review-name {
    flex: 0 0 45%;
    overflow: hidden;
}

.form-review-value.has-name img {
    max-width: 55%;
}

.form-add-to-job {
    margin-top: 16px;
}

/* Rows without a number box on the left (Admin > Forms). */
.tm-row.no-number {
    grid-template-columns: minmax(0, 1fr) auto;
}

/* The site's button hover (dark gray) would hide the chips' dark text. */
.form-chip:hover {
    background: #f9fafb;
    border-color: #98a2b3;
}

.form-chip.is-on:hover {
    background: #d9eee0;
    border-color: var(--brand-accent);
}

/* Signatures show only their ink over the form, like the PDF. */
.form-review-value img {
    mix-blend-mode: multiply;
}

/* Item lines on a form (the return slip), like T&M lines:
   Qty (small) · Description · Special Order · Damage · remove. */
.form-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto auto 40px;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    background: #fcfcfd;
}

.form-item-qty,
.form-item-qty .tm-line-label {
    text-align: center;
}

.form-item-qty input {
    text-align: center;
}

.form-item-check {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
    margin: 0;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.form-item-check input {
    order: 2;
    width: 26px;
    height: 26px;
    margin: 0 0 9px;
    accent-color: var(--brand-accent);
}

.form-item-add {
    width: auto;
    align-self: flex-start;
}

@media (max-width: 600px) {
    .form-item {
        grid-template-columns: 64px minmax(0, 1fr) 40px;
    }

    .form-item-description {
        grid-column: 2 / 4;
    }

    .form-item .tm-line-remove {
        grid-column: 3;
        grid-row: 2;
    }
}

/* Picking job photos for a T&M ticket (tm-ticket.php). */
.tm-pick-box {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
}

.tm-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    min-height: 0;
    margin: 8px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tm-pick-tile {
    position: relative;
    width: auto;
    padding: 0;
    overflow: hidden;
    border: 3px solid transparent;
    border-radius: 8px;
    background: #f2f4f7;
    aspect-ratio: 1;
}

.tm-pick-tile:hover {
    background: #f2f4f7;
}

.tm-pick-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-pick-date {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px 4px;
    background: rgba(16, 24, 40, .6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.tm-pick-tile.is-picked {
    border-color: var(--brand-accent);
}

.tm-pick-tile.is-picked::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
}

.tm-pick-more {
    width: auto;
    align-self: center;
}

/* Excess Material (excess.php): Qty · Description · Notes · Save / Add · remove. */
.excess-line {
    grid-template-columns: 80px minmax(0, 2.2fr) minmax(0, 1.6fr) auto 40px;
}

form.excess-line:not(.excess-item) {
    grid-template-columns: 80px minmax(0, 2.2fr) minmax(0, 1.6fr) auto;
}

.excess-line button.primary-button {
    width: auto;
    min-height: 44px;
    padding: 0 18px;
}

.excess-qty input {
    text-align: center;
}

.excess-log {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #475467;
    font-size: 14px;
}

.excess-log li {
    padding: 7px 0;
    border-top: 1px solid #eaecf0;
}

.excess-log li:first-child {
    border-top: 0;
}

.excess-log-when {
    display: inline-block;
    min-width: 92px;
    color: #98a2b3;
    font-size: 12px;
}

@media (max-width: 600px) {
    .excess-line,
    form.excess-line:not(.excess-item) {
        grid-template-columns: 70px minmax(0, 1fr) 40px;
    }

    .excess-line .tm-line-field:nth-of-type(3) {
        grid-column: 1 / 3;
    }

    form.excess-line:not(.excess-item) .tm-line-field:nth-of-type(3) {
        grid-column: 1 / -1;
    }

    .excess-line .excess-add {
        grid-column: 1 / -1;
    }
}

/* Excess Material: Paste a list (one item per line) and its preview. */
.excess-paste-toggle {
    width: auto;
    margin-top: 12px;
}

.excess-paste {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eaecf0;
}

.excess-paste textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 16px;
    font-family: inherit;
}

.excess-line.excess-paste-line,
form.excess-line.excess-paste-line {
    grid-template-columns: 80px minmax(0, 1fr) 40px;
}

.excess-paste-notes {
    margin-top: 12px;
}

.excess-paste .primary-button {
    width: auto;
}

/* Excess Material lists (on the job, and a pasted list): packed like a sheet,
   column names once on top, no box around each row. */
.excess-head {
    display: grid;
    gap: 6px;
    padding: 0 2px 4px;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid #eaecf0;
}

.excess-head-item {
    grid-template-columns: 80px minmax(0, 2.2fr) minmax(0, 1.6fr) 40px;
}

.excess-head-paste {
    grid-template-columns: 80px minmax(0, 1fr) 40px;
    margin-top: 6px;
}

.excess-compact {
    gap: 2px;
}

.excess-compact .excess-head {
    margin-bottom: 4px;
}

.excess-compact .tm-line {
    gap: 6px;
    align-items: center;
    padding: 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.excess-compact .tm-line-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.excess-compact .tm-line-field input {
    min-height: 38px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.excess-compact .tm-line-remove {
    height: 38px;
}

.excess-compact .excess-line button.primary-button {
    min-height: 38px;
}

@media (max-width: 600px) {
    /* Phones: each item wraps to two lines, so a thin rule keeps them apart. */
    .excess-head-item {
        display: none;
    }

    .excess-compact .excess-item {
        padding: 6px 0;
        border-bottom: 1px solid #eaecf0;
    }

    .excess-compact .excess-item .tm-line-label {
        position: static;
        width: auto;
        height: auto;
        clip: auto;
    }
}

/* Employees: first, last, classification, phone, then the button. */
.employee-add,
.employee-row .topic-edit-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.employee-add select,
.employee-row .topic-edit-form select,
.employee-add input[type="tel"],
.employee-row .topic-edit-form input[type="tel"] {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #fff;
    font-size: 16px;
}

.employee-missing {
    color: #b42318;
}

@media (max-width: 700px) {
    .employee-add,
    .employee-row .topic-edit-form {
        grid-template-columns: 1fr;
    }
}

/* ---- Schedule (schedule.php) ---- */
.sched-page {
    max-width: 1500px;
}

.sched-week-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sched-week-nav .secondary-button {
    width: auto;
}

.sched-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.sched-tab {
    padding: 9px 16px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-weight: 700;
    text-decoration: none;
}

.sched-tab.is-current {
    border-color: var(--brand-accent);
    background: var(--brand-accent);
    color: #fff;
}

.sched-crew-name {
    margin: 0 0 10px;
}

/* Six days side by side; they scroll sideways on narrow screens. */
.sched-days {
    display: grid;
    grid-template-columns: repeat(6, minmax(170px, 1fr));
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.sched-day,
.sched-note-day {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: auto;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    background: #fcfcfd;
    color: #101828;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
}

.sched-day:hover {
    border-color: var(--brand-accent);
    background: #f6fbf8;
}

/* Schedule-only accounts: the days are for reading. */
.sched-day.is-readonly,
.sched-day.is-readonly:hover {
    border-color: #eaecf0;
    background: #fcfcfd;
    cursor: default;
}

.sched-day.is-today,
.sched-note-day.is-today {
    border-color: var(--brand-accent);
    box-shadow: inset 0 3px 0 var(--brand-accent);
}

.sched-day-head {
    color: #475467;
    font-size: 13px;
}

.sched-day-head strong {
    color: #101828;
}

.sched-time {
    float: right;
    color: var(--brand-accent-dark);
    font-weight: 700;
}

.sched-job {
    font-weight: 700;
    line-height: 1.3;
}

.sched-person,
.sched-note {
    line-height: 1.3;
}

.sched-person em,
.sched-note em {
    display: inline-block;
    min-width: 30px;
    color: #98a2b3;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.sched-empty {
    margin-top: auto;
    color: #98a2b3;
}

.sched-note-field {
    display: block;
}

.sched-note-field textarea,
.sched-editor textarea,
.sched-editor select,
.sched-editor input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #fff;
    font: inherit;
    font-size: 16px;
}

.sched-saved {
    color: #667085;
    font-size: 12px;
}

/* 10 Wheeler / Mechanic: tall boxes that are easy to tap and type in. */
.sched-note-days .sched-note-field textarea {
    min-height: 260px;
    padding: 12px;
    line-height: 1.4;
    resize: vertical;
}

.sched-note-days .tm-line-label {
    font-size: 13px;
}

/* Phones: one day per row, full width, instead of six narrow columns. */
@media (max-width: 700px) {
    .sched-note-days {
        grid-template-columns: 1fr;
        gap: 12px;
        overflow-x: visible;
    }

    .sched-note-days .sched-note-day {
        padding: 14px;
        gap: 8px;
    }

    .sched-note-days .sched-day-head {
        font-size: 16px;
    }

    .sched-note-days .sched-note-field textarea {
        min-height: 320px;
        font-size: 17px;
    }

    .sched-note-days .tm-line-label {
        font-size: 15px;
    }

    .sched-note-days .sched-saved {
        font-size: 14px;
    }
}

.sched-copy {
    margin-top: 4px;
}

.sched-copy .secondary-button {
    width: auto;
}

/* The day editor */
.sched-day-box {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
}

.sched-editor {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sched-editor-top {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 12px;
}

.sched-editor-top input[type="text"] {
    margin-top: 6px;
}

.sched-role {
    margin-bottom: 14px;
}

.sched-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.sched-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 6px 5px 12px;
    border-radius: 999px;
    background: #e8f3ec;
    color: var(--brand-accent-dark);
    font-weight: 600;
}

.sched-chip-remove {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--brand-accent-dark);
    font-size: 18px;
    line-height: 1;
}

.sched-chip-remove:hover {
    background: #d1e7d9;
}

.sched-look-today {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fffaeb;
    color: #93370d;
    font-size: 14px;
}

/* Look Ahead and Set Up */
.sched-look-add {
    display: grid;
    grid-template-columns: 160px 160px minmax(0, 1fr) minmax(0, 2fr) auto;
    gap: 8px;
    align-items: end;
}

.sched-look-add input {
    min-height: 44px;
    font-size: 16px;
}

.sched-look-add .primary-button,
.sched-crew-add .primary-button {
    width: auto;
}

.sched-crew-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 8px;
}

.sched-crew-edit input,
.sched-crew-edit select {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 16px;
}

.sched-crew-edit .secondary-button,
.tm-row-actions .secondary-button {
    width: auto;
}

/* The header's Schedule link */
.app-schedule-link {
    margin-right: 14px;
    color: var(--brand-accent);
    font-weight: 700;
    text-decoration: none;
}

.app-schedule-link:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .sched-editor-top,
    .sched-look-add,
    .sched-crew-edit {
        grid-template-columns: 1fr;
    }
}

/* Schedule: classifications shaded like the sheet (FM gold, OP green, LAB blue, APP light yellow). */
.sched-person {
    margin: 0 -4px;
    padding: 2px 4px;
    border-radius: 4px;
}

.sched-role-fm { background: #fbe7a8; }
.sched-role-op { background: #dcefd9; }
.sched-role-lab { background: #d6e4f7; }
.sched-role-app { background: #fff4d6; }

.sched-role {
    padding: 10px 12px;
    border-radius: 10px;
}

/* A foreman's card with a border color (Set Up). */
.sched-crew.is-flagged {
    border: 3px solid;
}

.sched-color-pick {
    border-width: 3px;
}

.sched-crew-edit {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr) auto;
    align-items: end;
    flex: 1;
}

.sched-crew-edit .secondary-button {
    min-height: 44px;
}

@media (max-width: 700px) {
    .sched-crew-edit {
        grid-template-columns: 1fr;
    }
}

/* Schedule day editor: above the site header (it was cutting off the top),
   and more compact. Typed text stays 16px so iPads don't zoom in. */
#dayModal {
    z-index: 7000;
    align-items: flex-start;
    padding: 10px;
}

#dayModal .sched-day-box {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px 16px;
}

#dayModal h2 {
    margin-bottom: 8px;
    font-size: 19px;
}

.sched-editor .form-field-label {
    margin-bottom: 4px;
    font-size: 13px;
}

.sched-editor .sched-field,
.sched-editor .form-group {
    margin-bottom: 8px;
}

.sched-editor select,
.sched-editor input[type="text"],
.sched-editor textarea {
    padding: 7px 10px;
}

.sched-editor textarea {
    min-height: 0;
}

.sched-role {
    margin-bottom: 8px;
    padding: 7px 10px;
}

.sched-chip {
    padding: 3px 4px 3px 10px;
    font-size: 14px;
}

.sched-chip-remove {
    width: 22px;
    height: 22px;
    font-size: 16px;
}

.sched-look-today {
    margin-bottom: 8px;
    padding: 7px 10px;
    font-size: 13px;
}

#dayModal .signature-modal-actions {
    margin-top: 8px;
}

/* Schedule day editor: "Copy from [day] [Copy]". */
.sched-copy-from {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 7px 10px;
    border: 1px dashed #d0d5dd;
    border-radius: 10px;
}

.sched-copy-from .form-field-label {
    margin: 0;
}

.sched-copy-from select {
    flex: 1;
    min-width: 160px;
    width: auto;
}

.sched-copy-from .secondary-button {
    width: auto;
    padding: 7px 16px;
}

/* Schedule drop-downs: the iPad's own look switched off and redrawn like the
   header's menus (same border, arrow and font). 16px so iPads don't zoom in. */
.sched-page select,
#dayModal select {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    min-height: 44px;
    padding: 0 36px 0 11px;
    border: 1px solid #cfd5dc;
    border-radius: 7px;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23667085' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: #111827;
    font: inherit;
    font-size: 16px;
    line-height: 1.2;
    text-overflow: ellipsis;
    cursor: pointer;
}

.sched-page select:focus,
#dayModal select:focus {
    outline: none;
    border-color: #667085;
    box-shadow: 0 0 0 3px rgba(102, 112, 133, .12);
}

/* The Set Up border picker keeps its colored border. */
.sched-page select.sched-color-pick {
    border-width: 3px;
}

/* Schedule: the "+ Add operator..." buttons and the person picker. */
.sched-pick-button {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px dashed #98a2b3;
    border-radius: 7px;
    background: rgba(255, 255, 255, .7);
    color: #344054;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

.sched-pick-button:hover {
    background: #fff;
}

.sched-picker {
    position: fixed;
    inset: 0;
    z-index: 7100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
    background: rgba(16, 24, 40, .4);
}

.sched-picker[hidden] {
    display: none;
}

.sched-picker-box {
    display: flex;
    flex-direction: column;
    width: min(100%, 480px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(16, 24, 40, .3);
}

.sched-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.sched-picker-head h3 {
    margin: 0;
    font-size: 18px;
}

.sched-picker-head .secondary-button {
    width: auto;
    padding: 8px 14px;
}

#personPickerSearch {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd5dc;
    border-radius: 7px;
    font-size: 16px;
}

.sched-picker-list {
    min-height: 0;
    margin-top: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sched-pick-group {
    position: sticky;
    top: 0;
    padding: 8px 4px 4px;
    background: #fff;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sched-pick-person {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 11px 10px;
    border-bottom: 1px solid #f2f4f7;
    border-radius: 0;
    background: #fff;
    color: #101828;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
}

.sched-pick-person:hover {
    background: #f6fbf8;
}

.sched-pick-person.is-busy,
.sched-pick-person.is-busy:hover {
    background: #f9fafb;
    color: #98a2b3;
    cursor: not-allowed;
}

.sched-pick-note {
    color: #98a2b3;
    font-size: 13px;
    white-space: nowrap;
}

.sched-pick-typed {
    color: var(--brand-accent-dark);
    font-weight: 600;
}

/* Schedule: a foreman's name with its own "Copy last week". */
.sched-crew-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.sched-crew-head .sched-crew-name {
    margin: 0;
}

.sched-card-copy {
    width: auto;
    padding: 6px 12px;
    font-size: 13px;
}

/* The header's Schedule: a button, not a plain link. */
.app-schedule-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--brand-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.app-schedule-link:hover {
    background: var(--brand-accent-dark);
    color: #fff;
    text-decoration: none;
}

/* Texts: the "Send Text" button over each day, the text buttons and previews. */
.sched-day-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.sched-day-col .sched-day {
    flex: 1;
}

.sched-text-day {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    color: #344054;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sched-text-day:hover {
    border-color: var(--brand-accent);
    background: #f6fbf8;
    color: #101828;
}

.sched-text-day.is-blank {
    visibility: hidden;
}

.sched-text-day.is-pending {
    border-color: #b2ddff;
    background: #eff8ff;
    color: #175cd3;
}

.sched-text-day.is-pending:hover {
    border-color: #84caff;
    background: #d1e9ff;
    color: #175cd3;
}

.sched-text-day.is-sent,
.sched-text-day.is-sent:hover {
    color: #175cd3;
}

/* Delivered: a plain label, not a button (disabled, no box, no hover). */
.sched-text-day.is-delivered,
.sched-text-day.is-delivered:hover {
    border-color: transparent;
    background: transparent;
    color: #067647;
    -webkit-text-fill-color: #067647;
    opacity: 1;
    cursor: default;
}

.sched-text-day.is-failed {
    border-color: #fecdca;
    background: #fef3f2;
    color: #b42318;
}

.sched-text-day.is-failed:hover {
    border-color: #fda29b;
    background: #fee4e2;
    color: #b42318;
}

.sched-text-day.is-changed {
    border-color: #fedf89;
    background: #fffaeb;
    color: #b54708;
}

.sched-text-day.is-changed:hover {
    border-color: #fec84b;
    background: #fef0c7;
    color: #b54708;
}

#textPreview .primary-button {
    margin-top: 8px;
}

.texts-body {
    margin: 6px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f2f4f7;
    color: #101828;
    font: inherit;
    font-size: 14px;
    white-space: pre-wrap;
}

/* Admin > Text Messages */
.texts-account {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.texts-account .form-group {
    margin: 0;
}

.texts-account input,
.texts-mass textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font: inherit;
    font-size: 16px;
}

.texts-account .primary-button,
.texts-mass .primary-button,
.texts-preview .primary-button,
.texts-preview .secondary-button {
    width: auto;
}

.texts-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 4px 0 12px;
}

.texts-roles label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.texts-roles .talk-link-button {
    margin-left: auto;
}

/* Mass text: pick people by name (tiles like the talk crew list). */
.texts-people-help {
    margin-bottom: 10px;
}

.texts-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.texts-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 8px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color .15s ease, background-color .15s ease;
}

.texts-person[hidden] {
    display: none;
}

.texts-person input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin: 0;
}

.texts-person-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.texts-person-text strong {
    overflow: hidden;
    color: #101828;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.texts-person-text span {
    color: #667085;
    font-size: 13px;
}

.texts-person.is-picked {
    border-color: #84adff;
    background: #eff4ff;
}

.texts-person.is-covered {
    border-color: #e4e7ec;
    background: #f9fafb;
    cursor: default;
}

.texts-person.is-covered .texts-person-text strong {
    color: #475467;
}

.texts-preview form {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.texts-log-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    padding: 8px 0;
    border-top: 1px solid #eaecf0;
    font-size: 14px;
}

.texts-log-row:first-child {
    border-top: 0;
}

@media (max-width: 700px) {
    .texts-account {
        grid-template-columns: 1fr;
    }
}

/* Admin tab bar: with this many tabs it wraps onto a second line instead of
   scrolling sideways (which hid "Admin" and "Overview" off the left). Phones
   keep the sideways scroll. */
@media (min-width: 701px) {
    .admin-nav-inner {
        max-width: 1300px;
        flex-wrap: wrap;
        overflow-x: visible;
        row-gap: 0;
    }

    .admin-nav-tab {
        padding: 12px 10px 10px;
    }
}

/* Skilled / trained ✪ (Employees, and the Schedule only). */
.employee-star,
.sched-star {
    margin-right: 3px;
    color: #b54708;
}

.employee-skilled-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 600;
    white-space: nowrap;
}

.employee-skilled-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--brand-accent);
}

@media (min-width: 701px) {
    .employee-add,
    .employee-row .topic-edit-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto auto;
    }
}

/* Schedule: Equipment and Loose Ends tabs. */
.sched-equip-list {
    display: flex;
    flex-direction: column;
}

.sched-equip-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
    gap: 6px 14px;
    align-items: center;
    padding: 10px 2px;
    border-top: 1px solid #eaecf0;
}

.sched-equip-row:first-child {
    border-top: 0;
}

.sched-equip-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sched-equip-location {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sched-equip-location input,
.sched-equip-edit input,
.sched-equip-add input,
.sched-loose-add input,
.sched-loose-add textarea,
.sched-equip-paste textarea,
.sched-equip-search {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font: inherit;
    font-size: 16px;
}

.sched-equip-search {
    margin-bottom: 8px;
}

.sched-equip-admin {
    display: flex;
    gap: 6px;
}

.sched-equip-admin .secondary-button,
.sched-equip-edit .primary-button,
.sched-equip-add .primary-button,
.sched-equip-paste .primary-button,
.sched-loose-open,
.sched-loose-add .primary-button {
    width: auto;
}

.sched-equip-edit {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 90px minmax(0, 2fr) minmax(0, 1fr) auto;
    gap: 8px;
}

.sched-equip-edit[hidden] {
    display: none;
}

.sched-equip-add {
    display: grid;
    grid-template-columns: 90px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 8px;
}

.sched-equip-paste {
    margin-top: 12px;
}

.sched-equip-paste summary {
    color: var(--brand-accent-dark);
    font-weight: 700;
    cursor: pointer;
}

.sched-equip-paste textarea {
    margin-bottom: 8px;
}

.sched-loose-note {
    color: #344054;
    white-space: normal;
}

.sched-loose-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
    gap: 8px;
    align-items: end;
}

.sched-loose-add[hidden] {
    display: none;
}

@media (max-width: 700px) {
    .sched-equip-row,
    .sched-equip-edit,
    .sched-equip-add,
    .sched-loose-add {
        grid-template-columns: 1fr;
    }
}

/* Schedule > Equipment: the sheet's headings. */
.sched-equip-section {
    margin: 18px 0 4px;
    padding: 6px 10px;
    border-radius: 7px;
    background: #f2f4f7;
    color: #101828;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sched-equip-list > .sched-equip-section:first-child {
    margin-top: 4px;
}

.sched-equip-group {
    margin: 12px 0 2px;
    padding-left: 10px;
    color: var(--brand-accent-dark);
    font-size: 14px;
    font-weight: 700;
}

.sched-equip-section + .sched-equip-row,
.sched-equip-group + .sched-equip-row {
    border-top: 0;
}

.sched-equip-edit,
.sched-equip-add {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) auto;
}

@media (max-width: 700px) {
    .sched-equip-edit,
    .sched-equip-add {
        grid-template-columns: 1fr;
    }
}

/* Schedule > Equipment: the sheet's colors on headings and machines. */
.sched-equip-section,
.sched-equip-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sched-equip-group {
    padding: 5px 10px;
    border-radius: 7px;
}

.sched-equip-make {
    padding: 1px 6px;
    border-radius: 5px;
}

.sched-heading-color {
    position: relative;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.sched-heading-color summary {
    padding: 2px 8px;
    border: 1px solid rgba(16, 24, 40, .25);
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: #344054;
    cursor: pointer;
    list-style: none;
}

.sched-heading-color summary::-webkit-details-marker {
    display: none;
}

.sched-heading-color form {
    position: absolute;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #101828;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .2);
    white-space: nowrap;
}

.sched-heading-color .primary-button {
    width: auto;
    padding: 6px 12px;
}

.sched-color-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sched-color-field input[type="color"],
.sched-heading-color input[type="color"] {
    width: 44px;
    height: 36px;
    padding: 2px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
}

.sched-color-field label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    white-space: nowrap;
}

/* Schedule > Equipment: Add a Machine in two labeled rows. */
.sched-equip-add {
    display: block;
}

.sched-equip-add-row {
    display: grid;
    grid-template-columns: 100px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.4fr) auto;
    gap: 10px;
    align-items: end;
}

.sched-equip-add-row.is-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    margin-bottom: 12px;
}

.sched-equip-add-row .tm-line-field input[type="text"] {
    min-height: 44px;
}

.sched-equip-add-row .primary-button {
    width: auto;
    min-height: 44px;
    padding: 0 26px;
}

.sched-equip-add-row .sched-color-field {
    min-height: 44px;
}

@media (max-width: 700px) {
    .sched-equip-add-row,
    .sched-equip-add-row.is-top {
        grid-template-columns: 1fr;
    }
}

/* ---- Schedule > Calendar: one big month, like the old sheet; school breaks and the Look Ahead ---- */
.sched-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.sched-cal-head h2 {
    margin: 0;
    font-size: 22px;
    text-align: center;
}

.sched-cal-head .secondary-button,
.sched-cal-today {
    width: auto;
    padding: 9px 14px;
    white-space: nowrap;
}

.sched-cal-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.sched-cal-tools .tm-line-field {
    min-width: 260px;
}

/* Soft rounded day boxes on a light card (the look of the month cards). */
.sched-cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    padding: 10px;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    background: #fcfcfd;
}

.sched-cal-dow {
    padding: 2px 4px 6px;
    color: #98a2b3;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    text-align: center;
    text-transform: uppercase;
}

.sched-cal-cell {
    min-height: 118px;
    padding: 6px 7px 8px;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.sched-cal-cell.is-weekend {
    background: #f2f4f7;
}

.sched-cal-cell.is-other {
    background: transparent;
    border-color: transparent;
    color: #d0d5dd;
}

.sched-cal-cell.is-other .sched-cal-break,
.sched-cal-cell.is-other .sched-cal-look {
    opacity: .45;
}

.sched-cal-cell.is-today {
    border-color: var(--brand-accent);
    box-shadow: inset 0 0 0 1px var(--brand-accent);
}

.sched-cal-cell.is-today .sched-cal-date {
    color: var(--brand-accent-dark);
}

.sched-cal-date {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
}

.sched-cal-wd {
    display: none;
}

/* A holiday / break: colored text, like the old sheet. */
.sched-cal-break {
    margin: 2px 0 4px;
    font-weight: 500;
}

.sched-cal-break strong {
    color: inherit;
}

/* Admins tap a day to add, or a holiday / break to change it. */
.sched-cal-month-grid.can-edit .sched-cal-cell {
    cursor: pointer;
}

.sched-cal-month-grid.can-edit .sched-cal-cell:hover {
    border-color: var(--brand-accent);
}

.sched-cal-month-grid.can-edit .sched-cal-break:hover {
    text-decoration: underline;
}

.sched-cal-look {
    margin: 2px 0;
    color: #101828;
}

.sched-cal-break[hidden] {
    display: none;
}

/* Phones: a list of the days that have something, instead of a squeezed grid. */
@media (max-width: 700px) {
    .sched-cal-month-grid {
        grid-template-columns: 1fr;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .sched-cal-dow,
    .sched-cal-cell.is-empty,
    .sched-cal-cell.is-other {
        display: none;
    }

    .sched-cal-cell {
        min-height: 0;
        font-size: 15px;
    }

    .sched-cal-wd {
        display: inline;
    }

    .sched-cal-head h2 {
        font-size: 18px;
    }

    .sched-cal-tools .tm-line-field {
        min-width: 0;
        width: 100%;
    }
}

/* The holiday / break popup. */
.sched-cal-add {
    width: auto;
}

.sched-break-box {
    max-width: 560px;
}

.sched-break-box form {
    display: grid;
    gap: 12px;
}

.sched-break-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sched-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sched-swatch {
    position: relative;
    cursor: pointer;
}

.sched-swatch input {
    position: absolute;
    opacity: 0;
}

.sched-swatch span {
    display: block;
    width: 34px;
    height: 34px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #d0d5dd;
}

.sched-swatch input:checked + span {
    box-shadow: 0 0 0 3px #101828;
}

.sched-swatch input:focus-visible + span {
    outline: 2px solid var(--brand-accent);
    outline-offset: 3px;
}

.sched-break-all {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.sched-break-all input,
.sched-break-job input {
    width: auto;
}

.sched-break-schools[hidden] {
    display: none;
}

.sched-break-search {
    width: 100%;
    margin: 6px 0;
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    font-size: 16px;
}

.sched-break-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    padding: 4px 8px;
}

.sched-break-job {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    font-size: 14px;
}

.sched-break-job[hidden] {
    display: none;
}

@media (max-width: 500px) {
    .sched-break-dates {
        grid-template-columns: 1fr;
    }
}

/* keep-place.js: the page's success message, floated for a moment when the
   page came back to where you were (below the message). */
.keep-place-note {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top));
    left: 50%;
    z-index: 2000;
    max-width: min(92vw, 520px);
    padding: 11px 16px;
    border-radius: 10px;
    background: #067647;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .25);
    transform: translateX(-50%);
    transition: opacity .4s;
}

.keep-place-note.is-leaving {
    opacity: 0;
}

/* ---- Safety page: Emergency (the job address, nearest ER and urgent care) ---- */
.emergency-card {
    border-left: 5px solid #d92d20;
}

.emergency-title {
    margin: 0 0 8px;
    color: #b42318;
}

.emergency-address {
    margin: 0 0 6px;
    color: #344054;
    font-size: 15px;
}

.emergency-group {
    margin: 16px 0 6px;
    color: #475467;
    font-size: 14px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.emergency-place {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid #eaecf0;
}

.emergency-group + .emergency-place {
    border-top: 0;
}

.emergency-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.emergency-info strong {
    color: #101828;
    font-size: 17px;
}

.emergency-info span {
    color: #475467;
    font-size: 15px;
}

.emergency-phone {
    color: #175cd3;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.emergency-info .emergency-miles {
    color: #98a2b3;
    font-size: 13px;
}

.emergency-info .emergency-check {
    color: #b54708;
    font-size: 13px;
    font-weight: 600;
}

.emergency-directions {
    flex-shrink: 0;
    width: auto;
    padding: 12px 18px;
    text-decoration: none;
    white-space: nowrap;
}

.emergency-wait {
    margin: 10px 0 0;
    color: #667085;
}

@media (max-width: 600px) {
    .emergency-place {
        flex-direction: column;
        align-items: stretch;
    }

    .emergency-directions {
        text-align: center;
    }
}

/* Admin > Emergency Lookup */
.emergency-admin-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.emergency-admin-buttons .secondary-button {
    width: auto;
}

.emergency-admin-row .tm-row-info span {
    font-size: 14px;
}

/* DigAlerts: Admin > DigAlerts and each job's DigAlerts page. */
.dl-heading-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dl-heading-buttons .secondary-button,
.dl-heading-buttons .primary-button {
    width: auto;
}

.tm-show-tabs .status-tab.dl-tab-due .tm-tab-count {
    color: #b42318;
}

.dl-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.dl-search input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 260px;
    box-sizing: border-box;
    width: auto;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    color: #101828;
    font: inherit;
    font-size: 16px; /* 16px: iPhones don't zoom in when typing */
}

.dl-search input[type="search"]:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 107, 58, .12);
    outline: none;
}

.dl-search .secondary-button {
    width: auto;
}

.dl-export {
    margin-left: auto;
}

.dl-job-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 14px;
    margin-bottom: 4px;
}

.dl-job-head h2 {
    margin: 0;
    font-size: 18px;
}

.dl-job-number {
    margin-right: 6px;
    color: var(--brand-accent);
}

.dl-no-job {
    color: #b54708;
}

.dl-job-missing {
    margin-left: 8px;
    color: #98a2b3;
    font-size: 13px;
    font-weight: 500;
}

.dl-dir {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.dl-row {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 4px;
    border-top: 1px solid #eaecf0;
}

/* Mark a batch renewed (admin-digalerts.php, To Renew / Active tabs). */
.dl-row.has-pick {
    grid-template-columns: 44px 210px minmax(0, 1fr) auto;
}

.dl-row.is-picked {
    background: #f6fbf8;
}

.dl-pick {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    cursor: pointer;
}

.dl-pick input {
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--brand-accent);
    cursor: pointer;
}

.dl-renew-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 20px;
}

.dl-renew-text h2 {
    margin: 0 0 4px;
}

.dl-renew-text .topic-help {
    margin: 0;
}

.dl-renew-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
}

.dl-renew-date {
    margin: 0;
}

.dl-renew-date input {
    min-height: 44px;
    font-size: 16px;
}

.dl-renew-controls .primary-button,
.dl-renew-controls .talk-link-button {
    width: auto;
    min-height: 44px;
}

.dl-renew-controls .primary-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.dl-row-ticket {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.dl-copy {
    width: auto;
    padding: 2px 0;
    border: 0;
    background: none;
    color: #101828;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: copy;
    transition: color .2s ease;
}

.dl-copy:hover {
    color: var(--brand-accent);
}

.dl-copy.is-copied::after {
    content: "  Copied";
    color: var(--brand-accent);
    font-family: inherit;
    font-size: 12px;
}

.dl-rev {
    color: #98a2b3;
    font-weight: 500;
}

.dl-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #05603a;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.dl-badge.is-soon {
    background: #fef0c7;
    color: #93370d;
}

.dl-badge.is-urgent,
.dl-badge.is-expired {
    background: #fee4e2;
    color: #b42318;
}

.dl-badge.is-let,
.dl-badge.is-closed,
.dl-badge.is-unknown {
    background: #f2f4f7;
    color: #475467;
}

.dl-row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dl-row-info > strong {
    color: #101828;
}

.dl-row-info > span {
    color: #667085;
    font-size: 13px;
}

.dl-notes {
    color: #475467 !important;
    font-style: italic;
}

.dl-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dl-row-actions .secondary-button {
    width: auto;
    padding: 8px 16px;
}

.dl-row.is-closed .dl-copy,
.dl-row.is-let .dl-copy {
    color: #667085;
}

.dl-add-form {
    display: grid;
    gap: 10px;
}

.dl-add-form textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
}

.dl-add-form .primary-button {
    justify-self: start;
    width: auto;
}

.dl-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 12px;
    border: 2px dashed #d0d5dd;
    border-radius: 10px;
    background: #fcfcfd;
    color: #667085;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.dl-drop:hover,
.dl-drop.is-over {
    border-color: var(--brand-accent);
    background: #f3faf6;
}

.dl-drop input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dl-mail-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.dl-mail-form .primary-button {
    width: auto;
}

.dl-inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dl-inline-form select {
    width: auto;
}

.dl-steps {
    margin-top: 14px;
    color: #475467;
    font-size: 14px;
}

.dl-steps summary {
    cursor: pointer;
    font-weight: 600;
}

.dl-steps ol {
    margin: 8px 0 0;
    padding-left: 22px;
    line-height: 1.6;
}

.dl-modal-box {
    max-width: 720px;
}

.dl-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin: 12px 0;
}

.dl-form-grid .dl-wide {
    grid-column: 1 / -1;
}

.dl-form-grid [hidden] {
    display: none;
}

.dl-form-grid textarea {
    width: 100%;
    box-sizing: border-box;
}

/* The DigAlerts section on a project page: one line per ticket, tap to open. */
.dl-section {
    max-width: 750px; /* lines up with the tiles (.document-grid) */
    box-sizing: border-box;
    margin-top: 20px;
}

.dl-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.dl-section-head h2 {
    margin: 0;
    font-size: 20px;
}

.dl-ticket {
    border-top: 1px solid #eaecf0;
}

.dl-ticket summary {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 4px 12px 12px;
    border-left: 4px solid #12b76a;
    list-style: none;
    cursor: pointer;
    transition: background-color .2s ease;
}

.dl-ticket summary::-webkit-details-marker {
    display: none;
}

.dl-ticket summary:hover {
    background: #f9fafb;
}

.dl-ticket.is-soon summary {
    border-left-color: #f79009;
}

.dl-ticket.is-urgent summary,
.dl-ticket.is-expired summary {
    border-left-color: #d92d20;
}

.dl-ticket.is-let summary,
.dl-ticket.is-unknown summary {
    border-left-color: #d0d5dd;
}

.dl-ticket-number {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .02em;
}

.dl-ticket-what {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dl-ticket-what strong {
    color: #101828;
}

.dl-ticket-what span {
    color: #667085;
    font-size: 13px;
}

.dl-ticket-body {
    padding: 4px 4px 14px 16px;
    animation: dl-open .2s ease;
}

@keyframes dl-open {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.dl-members-title {
    color: #344054;
    font-weight: 600;
}

.dl-card-location {
    margin: 0 0 6px;
    color: #475467;
    font-size: 14px;
    line-height: 1.45;
}

.dl-ticket-body .dl-notes {
    margin: 4px 0 0;
    font-size: 14px;
}

.dl-card-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 12px;
}

.dl-card-links .secondary-button {
    width: auto;
}

.dl-members {
    margin-top: 12px;
    border-top: 1px solid #eaecf0;
    padding-top: 10px;
}

.dl-members ul {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.dl-members li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 12px;
    padding: 8px 0;
    border-top: 1px dashed #eaecf0;
}

.dl-members li:first-child {
    border-top: 0;
}

.dl-members a {
    color: var(--brand-accent);
    font-weight: 700;
    white-space: nowrap;
}

.dl-past summary {
    color: #475467;
    font-weight: 600;
    cursor: pointer;
}

.dl-past-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid #eaecf0;
    color: #667085;
    font-size: 14px;
}

.dl-past-row:first-of-type {
    margin-top: 8px;
}

.dl-past-number {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-weight: 700;
}

.project-dir {
    margin-top: 6px !important;
    color: #344054 !important;
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .dl-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .dl-row-info {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .dl-row.has-pick {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .dl-row.has-pick .dl-row-info {
        grid-column: 2 / -1;
    }

    .dl-mail-form,
    .dl-form-grid {
        grid-template-columns: 1fr;
    }

    .dl-past-row,
    .dl-ticket summary {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .dl-ticket-what {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .dl-past-row > span:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .dl-export {
        margin-left: 0;
    }
}

/* Admin > Text Messages: opt-outs. */
.texts-replies-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.texts-replies-form .form-group {
    margin: 0;
}

.texts-replies-form input {
    width: 100%;
    box-sizing: border-box;
}

.texts-replies-form .secondary-button {
    width: auto;
}

.texts-optout-note {
    margin: 6px 0 10px;
    color: #b42318;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 650px) {
    .texts-replies-form {
        grid-template-columns: 1fr;
    }
}

/* Forms: a job plan sheet in the form's photo box (Dig Permit site plan). */
.form-plan-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 12px;
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #f9fafb;
}

.form-plan-pick[hidden] {
    display: none;
}

.form-plan-pick img {
    width: 120px;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #eaecf0;
}

.form-plan-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.form-plan-search {
    width: 100%;
    box-sizing: border-box;
    margin: 4px 0 12px;
}

.form-plan-grid .form-plan-tile img {
    object-fit: contain;
    background: #ffffff;
}

.form-plan-tile .tm-pick-date {
    white-space: normal;
    line-height: 1.25;
}

/* Forms: two short fields side by side (Date | Time). */
.form-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

/* Forms: the DigAlert ticket drop-down, and its "Other" box. */
.form-field select {
    width: 100%;
    box-sizing: border-box;
}

.form-digalert-other {
    margin-top: 8px;
}

/* Forms Review: the plan sheet / first photo in the form's photo box. */
.form-review-page > img.form-review-photo {
    position: absolute;
    object-fit: contain;
}

/* T&M: Move to another job (admins). */
.tm-move {
    width: auto;
}

.tm-move-box {
    max-width: 520px;
}

.tm-move-box select {
    width: 100%;
    box-sizing: border-box;
}

/* Schedule: Pick a Week. The date input covers the button, so a tap opens
   the iPad's date wheel; on a computer a click opens the calendar. */
.sched-week-pick {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    overflow: hidden;
    cursor: pointer;
}

.sched-week-pick input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0.01;
    cursor: pointer;
}

/* Schedule: the week controls fade out on tabs that don't go by week
   (Calendar, Equipment, Loose Ends, Set Up); space kept so nothing jumps. */
.sched-week-nav,
.sched-week-of {
    transition: opacity .18s ease, visibility .18s ease;
}

.sched-week-nav.is-off,
.sched-week-of.is-off {
    opacity: 0;
    visibility: hidden;
}

/* Text Messages: the mass text's character count. */
.texts-count {
    margin-top: 4px;
    color: #667085;
    font-size: 13px;
    text-align: right;
    transition: color .2s ease;
}

.texts-count.is-near {
    color: #b54708;
    font-weight: 700;
}

/* Schedule day editor: the Job field opens a searchable list (like adding a person). */
.sched-job-button {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 38px 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: #101828;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.sched-job-button:hover,
.sched-job-button:focus-visible {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 107, 58, .12);
    outline: none;
}

.sched-job-button.is-empty {
    color: #667085;
    font-weight: 400;
}

.sched-pick-person.is-current {
    background: #e8f3ec;
    font-weight: 700;
}

/* Schedule > Equipment search: rows and headings it hides (their own display
   rules would otherwise win over [hidden]). */
.sched-equip-list [hidden],
.sched-people-list [hidden],
.sched-people-group[hidden] {
    display: none !important;
}

/* Back from a viewer: the sheet / section / file you were on, marked for a
   moment (keep-place.js). */
.sheet-card {
    transition: transform 0.1s ease, box-shadow 0.4s ease, background-color 0.4s ease;
}

.section-row,
.document-row {
    transition: box-shadow 0.4s ease, background-color 0.4s ease;
}

.is-back-here {
    box-shadow: 0 0 0 3px var(--brand-accent), 0 4px 14px rgba(16, 24, 40, 0.12) !important;
    background-color: #f6fbf8 !important;
}

/* Schedule > Employees: tap the number to call. */
.sched-person-phone {
    width: auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

/* ---- Daily reports (testing) and Admin > Miter ---- */
.daily-new { width: auto; }
.daily-problem { margin: 6px 0; color: #b42318; font-weight: 600; }
.daily-text { margin: 2px 0 12px; color: #344054; line-height: 1.45; }
.daily-row { color: inherit; text-decoration: none; }
.daily-row:hover { background: #f9fafb; }
.daily-inline { display: inline; margin: 0; }
.daily-date { width: auto; min-width: 200px; }

.daily-person { padding: 10px 0; border-top: 1px solid #eaecf0; }
.daily-person:first-of-type { border-top: 0; }
.daily-person-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 4px; }
.daily-line-view { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.8fr); gap: 10px; padding: 3px 0 3px 12px; color: #344054; font-size: 14px; }

.daily-crew-card { margin-bottom: 12px; padding: 12px; border: 1px solid #eaecf0; border-radius: 10px; background: #fcfcfd; }
.daily-crew-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.daily-crew-name { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.daily-warn { color: #b54708 !important; font-weight: 600; }
.daily-line { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.daily-line select, .daily-line input { width: 100%; box-sizing: border-box; }
.daily-add-line { font-size: 14px; }

.daily-note { margin-bottom: 10px; }
.daily-note-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.daily-note textarea { width: 100%; box-sizing: border-box; }
.daily-note-safety { background: #fef0c7; color: #93370d; }
.daily-note-incident { background: #fee4e2; color: #b42318; }
.daily-note-delivery { background: #e0f2fe; color: #075985; }
.daily-note-delay { background: #f4ebff; color: #6941c6; }
.daily-note-general { background: #f2f4f7; color: #344054; }

.daily-sign-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px; margin-bottom: 8px; border: 1px solid #eaecf0; border-left: 4px solid #d0d5dd; border-radius: 8px; transition: border-color .2s ease; }
.daily-sign-row.is-signed { border-left-color: #12b76a; }
.daily-sign-row.is-texted { border-left-color: #f79009; }
.daily-sign-row .secondary-button, .daily-sign-row .primary-button { width: auto; }
.daily-sign-who { display: flex; flex: 1; flex-direction: column; min-width: 140px; }
.daily-sign-image { height: 44px; max-width: 200px; object-fit: contain; background: #fff; border: 1px solid #eaecf0; border-radius: 6px; }
.daily-pad { display: block; width: 100%; height: 220px; margin: 10px 0; border: 2px dashed #d0d5dd; border-radius: 10px; background: #fff; touch-action: none; }

.daily-sign-page { background: #f2f4f7; }
.daily-sign-main { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; }
.daily-sign-logo { display: block; width: 150px; margin: 4px auto 14px; }
.daily-sign-main h1 { margin: 0 0 6px; font-size: 22px; }
.daily-sign-hours { margin: 12px 0; padding: 8px 4px; border-radius: 8px; background: #f9fafb; }
.daily-sign-total { border-top: 1px solid #eaecf0; font-weight: 700; }

.miter-link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 4px; border-top: 1px solid #eaecf0; }
.miter-link-row:first-child { border-top: 0; }
.miter-link-row.is-missing .miter-link-name strong { color: #b54708; }
.miter-link-row select { width: 100%; }

@media (max-width: 650px) {
    .daily-line { grid-template-columns: minmax(0, 1fr) 90px auto; }
    .miter-link-row { grid-template-columns: 1fr; }
}

/* Admin > Miter: the token box and its Save button on one line. */
.miter-token-form {
    display: grid;
    grid-template-columns: minmax(0, 420px) auto;
    gap: 12px;
    align-items: end;
}

.miter-token-form .form-group {
    margin: 0;
}

.miter-token-form .primary-button {
    width: auto;
}

@media (max-width: 650px) {
    .miter-token-form {
        grid-template-columns: 1fr;
    }
}

/* Daily Reports: "+ New Daily Report" is a link, so it gets the button shape here. */
a.daily-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid var(--brand-accent);
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease;
}

/* Daily report crew lines: Hours | Activity at their own sizes (not the full card). */
.daily-line {
    grid-template-columns: auto minmax(0, 300px) auto;
    justify-content: start;
}

.daily-line select,
.daily-line input,
.daily-page #dailyAddPerson {
    box-sizing: border-box;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background-color: #ffffff;
    color: #101828;
    font: inherit;
    font-size: 16px;
}

.daily-line select:focus,
.daily-line input:focus,
.daily-page #dailyAddPerson:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 107, 58, .12);
    outline: none;
}

.daily-page #dailyAddPerson {
    width: auto;
    min-width: 260px;
    max-width: 100%;
}

@media (max-width: 650px) {
    .daily-line {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
}

/* Daily report: the date, same size as the other fields. */
.daily-page .daily-date {
    box-sizing: border-box;
    min-width: 220px;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    color: #101828;
    font: inherit;
    font-size: 16px;
}

.daily-page .daily-date:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 107, 58, .12);
    outline: none;
}

/* Daily reports: what the worker signs. */
.daily-sign-summary {
    margin: 4px 0 8px;
    color: #101828;
    font-weight: 700;
}

.daily-ack {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--brand-accent);
    border-radius: 6px;
    background: #f3faf6;
    color: #344054;
    font-size: 14px;
    line-height: 1.45;
}

.daily-comment textarea {
    width: 100%;
    box-sizing: border-box;
}

.daily-sign-comment {
    flex-basis: 100%;
    margin: 4px 0 0;
    color: #b54708;
    font-size: 14px;
    font-weight: 600;
}

/* Daily reports: "Were you injured today?" when a worker signs. */
.daily-injury {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
}

.daily-injury legend {
    margin-bottom: 6px;
    padding: 0;
}

.daily-injury-choices {
    display: flex;
    gap: 10px;
}

.daily-injury-choices label {
    flex: 1;
    max-width: 160px;
    cursor: pointer;
}

.daily-injury-choices input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.daily-injury-choices span {
    display: block;
    padding: 11px 0;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font-weight: 700;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.daily-injury-choices input:focus-visible + span {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

.daily-injury-choices input[value="no"]:checked + span {
    border-color: var(--brand-accent);
    background: #f3faf6;
    color: #05603a;
}

.daily-injury-choices input[value="yes"]:checked + span {
    border-color: #d92d20;
    background: #fef3f2;
    color: #b42318;
}

.daily-injury-note {
    display: block;
    margin-top: 8px;
}

.daily-injury-note[hidden] {
    display: none;
}

.daily-injury-note textarea {
    width: 100%;
    box-sizing: border-box;
}

.daily-sign-comment.daily-injury-flag {
    color: #b42318;
}

.daily-injury-no {
    margin: 2px 0 0;
}

/* Daily reports: weather (7 AM, noon, 3 PM), search, work preview, email, distribution list. */
.daily-weather {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.daily-weather-form {
    margin-top: 12px;
}

.daily-weather-form:empty {
    display: none;
}

.daily-weather > .topic-meta {
    grid-column: 1 / -1;
    margin: 0;
}

.daily-weather-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    background: #f9fafb;
    animation: daily-fade-in 0.25s ease;
}

.daily-weather-cell strong {
    color: #101828;
    font-size: 22px;
    line-height: 1.15;
}

.daily-weather-hour {
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@keyframes daily-fade-in {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
    .daily-weather {
        grid-template-columns: 1fr;
    }
}

.daily-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.daily-search input {
    flex: 1;
    max-width: 420px;
}

.daily-row[hidden] {
    display: none !important;
}

.daily-row-work {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    margin: 2px 0;
    color: #344054 !important;
    line-height: 1.4;
}

.daily-email-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 8px;
}

.daily-email-status .daily-problem {
    flex-basis: 100%;
    margin: 0;
}

.daily-pdf-button {
    align-self: center;
    white-space: nowrap;
}

.daily-dist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 760px) {
    .daily-dist {
        grid-template-columns: 1fr;
    }
}

.daily-dist-list h3 {
    margin: 0 0 8px;
    color: #101828;
    font-size: 15px;
}

.daily-dist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #eaecf0;
}

.daily-dist-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.daily-dist-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 480px) {
    .daily-dist-add {
        grid-template-columns: 1fr;
    }
}

/* Daily reports: revisions, refused to sign, hours disputes. */
.daily-rev {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #fffaeb;
    color: #b54708;
    font-size: 0.55em;
    font-weight: 700;
    vertical-align: middle;
}

.tm-badge.daily-rev-badge {
    background: #fffaeb;
    color: #b54708;
}

.daily-revised {
    margin: 0 0 16px;
    padding: 11px 14px;
    border: 1px solid #fedf89;
    border-left: 4px solid #f79009;
    border-radius: 8px;
    background: #fffaeb;
    color: #7a2e0e;
    font-size: 14px;
    line-height: 1.45;
}

.daily-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.daily-revise-card {
    border-left: 4px solid #f79009;
}

.daily-revise-card textarea {
    width: 100%;
    box-sizing: border-box;
}

.daily-refuse,
.daily-dispute {
    margin: 8px 0 4px;
}

.daily-refuse summary,
.daily-dispute summary {
    width: fit-content;
    color: #b42318;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.daily-dispute summary {
    margin: 4px 0 10px;
    font-size: 15px;
}

.daily-refuse form,
.daily-dispute-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 520px;
    margin-top: 8px;
}

.daily-refuse textarea,
.daily-dispute-form textarea {
    width: 100%;
    box-sizing: border-box;
}

.daily-refuse button,
.daily-dispute-form button {
    align-self: flex-start;
}

.daily-refuse .topic-meta {
    margin: 6px 0 0;
}

/* Daily reports list: each report with its PDF download beside it. */
.daily-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.daily-row-link {
    flex: 1;
    min-width: 0;
}

.daily-row-download {
    flex: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Admin > Daily Reports, Reports by Day: the month calendar (how many
   reports each day) beside the picked day's reports. */
.daily-by-day {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 22px;
    align-items: start;
}

/* While the next day or month loads in place. */
#by-day .daily-by-day {
    transition: opacity .15s ease;
}

#by-day.is-loading .daily-by-day {
    opacity: .55;
}

.daily-cal {
    padding: 12px;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    background: #f9fafb;
}

.daily-cal-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.daily-cal-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
}

.daily-cal-title strong {
    color: #101828;
    font-size: 17px;
}

.daily-cal-title span {
    color: #667085;
    font-size: 13px;
}

.daily-cal-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #101828;
    font-size: 24px;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.daily-cal-step:hover {
    border-color: #1e6b3a;
    background: #f0f7f2;
}

.daily-cal-step.is-disabled {
    color: #d0d5dd;
    pointer-events: none;
}

.daily-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.daily-cal-weekday {
    padding: 2px 0 4px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
}

.daily-cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    aspect-ratio: 1;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #98a2b3;
    font-size: 14px;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}

a.daily-cal-day:hover {
    border-color: #d0d5dd;
    background: #fff;
}

a.daily-cal-day:active {
    transform: scale(.95);
}

.daily-cal-day.has-reports {
    background: #fff;
    border-color: #eaecf0;
    color: #101828;
    font-weight: 700;
}

.daily-cal-count {
    min-width: 22px;
    padding: 1px 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #1e6b3a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.daily-cal-day.has-failed .daily-cal-count {
    background: #d92d20;
}

.daily-cal-day.is-today {
    border-color: #1e6b3a;
}

.daily-cal-day.is-picked {
    border-color: #1e6b3a;
    background: #1e6b3a;
    color: #fff;
    box-shadow: 0 2px 6px rgba(30, 107, 58, .3);
}

.daily-cal-day.is-picked .daily-cal-count {
    background: #fff;
    color: #1e6b3a;
}

.daily-cal-day.is-picked.has-failed .daily-cal-count {
    color: #d92d20;
}

.daily-cal-day.is-future {
    color: #d0d5dd;
}

.daily-cal-today {
    display: block;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    color: #1e6b3a;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.daily-cal-today:hover {
    background: #f0f7f2;
}

.daily-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaecf0;
}

.daily-day-head div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.daily-day-head strong {
    color: #101828;
    font-size: 18px;
}

.daily-day-head span {
    color: #667085;
    font-size: 14px;
}

.daily-day-all {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
    white-space: nowrap;
}

@media (max-width: 860px) {
    .daily-by-day {
        grid-template-columns: 1fr;
    }

    .daily-cal {
        max-width: 460px;
        width: 100%;
        box-sizing: border-box;
        justify-self: center;
    }
}

@media (max-width: 650px) {
    .daily-day-all {
        width: 100%;
        justify-content: center;
    }
}

.daily-admin-section {
    margin: 28px 0 12px;
    color: #101828;
    font-size: 20px;
}

.daily-row {
    border-top: 1px solid #eaecf0;
}

.daily-row:first-child {
    border-top: 0;
}

.daily-row .tm-row {
    border-top: 0;
}

a.daily-row-link,
a.daily-row-link:hover {
    color: inherit;
    text-decoration: none;
}

/* Daily report crew: one tight row per person — name | hours + activity | total, × */
.daily-page .daily-crew-card {
    display: grid;
    grid-template-columns: minmax(140px, 210px) minmax(0, 1fr) auto;
    gap: 6px 14px;
    align-items: start;
    margin: 0;
    padding: 10px 2px;
    border: 0;
    border-top: 1px solid #eaecf0;
    border-radius: 0;
    background: transparent;
}

.daily-page .daily-crew-card:first-child {
    border-top: 0;
    padding-top: 2px;
}

.daily-page .daily-crew-name {
    padding-top: 11px;
}

.daily-page .daily-crew-name strong {
    line-height: 1.2;
}

.daily-crew-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.daily-page .daily-line {
    margin: 0;
}

.daily-page .daily-add-line {
    align-self: flex-start;
    padding: 2px 2px 0;
    font-size: 14px;
}

.daily-crew-end {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
}

.daily-crew-end .tm-tab-count {
    min-width: 52px;
    text-align: right;
    white-space: nowrap;
}

.daily-crew-remove {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #98a2b3;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.daily-crew-remove:hover,
.daily-crew-remove:focus-visible {
    background: #fef3f2;
    color: #b42318;
}

@media (max-width: 650px) {
    .daily-page .daily-crew-card {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .daily-page .daily-crew-name {
        padding-top: 8px;
    }

    .daily-crew-lines {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* Daily report: "+ Add a person", searchable like the header's project menu. */
.daily-person-picker {
    margin-top: 12px;
}

.daily-person-picker .project-picker-button {
    height: auto;
    min-height: 46px;
    padding: 0 40px 0 14px;
    border-radius: 8px;
    color: #344054;
    font-size: 16px;
    font-weight: 600;
    line-height: 44px;
}

.daily-person-picker .project-picker-panel {
    z-index: 50;
}

.daily-person-option {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #101828;
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.daily-person-option:hover,
.daily-person-option.is-active {
    background: #f2f4f7;
}

.daily-person-option[hidden] {
    display: none;
}

.daily-person-meta {
    color: #667085;
    font-size: 13px;
}

/* Daily report: the date and the weather on one compact line. */
.daily-page .daily-date-card {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 18px;
}

.daily-date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.daily-page .daily-date-field .daily-date {
    min-width: 0;
    width: 190px;
}

.daily-weather-chips {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
}

.daily-weather-chips:empty {
    display: none;
}

.daily-weather-chips > .topic-meta {
    margin: 0;
}

.daily-weather-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    background: #f9fafb;
    white-space: nowrap;
    animation: daily-fade-in 0.25s ease;
}

.daily-weather-chip .daily-weather-hour {
    font-size: 11px;
}

.daily-weather-chip strong {
    color: #101828;
    font-size: 17px;
}

.daily-weather-desc {
    color: #475467;
    font-size: 14px;
}

.daily-weather-note {
    color: #98a2b3;
    font-size: 12px;
}

/* Daily report: Work Completed is a fixed box (no resize corner). */
.daily-page textarea.daily-work {
    width: 100%;
    box-sizing: border-box;
    resize: none;
}

/* Daily reports: every text box is a fixed size (no resize corner), on the
   form, its sign window, the texted sign page and the report page. */
.daily-page textarea,
.daily-comment textarea,
.daily-injury-note textarea,
.daily-dispute-form textarea,
.daily-refuse textarea,
.daily-revise-card textarea {
    resize: none;
}

.daily-sign-waiting {
    color: #98a2b3;
    font-size: 14px;
    font-style: italic;
}

/* Daily report: people on the Schedule for this job who aren't on the crew yet. */
.daily-scheduled {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #b2ddff;
    border-radius: 8px;
    background: #eff8ff;
    color: #175cd3;
    font-size: 14px;
}

.daily-scheduled[hidden] {
    display: none;
}

/* T&M: the Schedule's crew / equipment note for the ticket's day. */
.tm-scheduled {
    margin: 0 0 12px;
    white-space: pre-line;
}

/* Employees from Miter: the note on Employees, kept names/classifications, the sync preview. */
.employee-miter-note {
    margin: 0 0 16px;
    padding: 11px 14px;
    border: 1px solid #b2ddff;
    border-radius: 8px;
    background: #eff8ff;
    color: #194185;
    font-size: 14px;
    line-height: 1.45;
}

.tm-badge.employee-kept {
    background: #fffaeb;
    color: #b54708;
}

.employee-miter-help {
    flex-basis: 100%;
    margin: 4px 0 0;
}

.miter-plan-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 7px 0;
    border-top: 1px solid #eaecf0;
}

.miter-plan-row .talk-link-button {
    margin-left: auto;
}

.tm-badge.employee-local {
    background: #f4f3ff;
    color: #5925dc;
}

.employee-group[hidden] {
    display: none;
}

/* Employees: the "from Miter" note gets its own full row under the fields. */
.employee-row .topic-edit-form .employee-miter-help {
    grid-column: 1 / -1;
    order: 99;
    margin: 0;
}

/* Employees: phone and ✪ for people from Miter, shown locked (not inputs). */
.employee-locked {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px dashed #d0d5dd;
    border-radius: 7px;
    background: #f2f4f7;
    color: #344054;
    font-size: 15px;
    white-space: nowrap;
}

.employee-locked span {
    color: #667085;
    font-size: 12px;
}

.employee-locked {
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-field-label .talk-optional {
    font-size: 12px;
}

/* Daily report: the "Send this daily report?" check, then each step as it's sent. */
.daily-confirm-box {
    max-width: 520px;
}

.daily-confirm-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid #eaecf0;
    font-size: 15px;
}

.daily-confirm-label {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding-top: 2px;
}

.daily-confirm-value {
    color: #101828;
    font-weight: 600;
}

.daily-confirm-crew {
    max-height: 240px;
    margin: 0 0 4px 90px;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.daily-confirm-crew li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    color: #344054;
    font-size: 14px;
}

.daily-confirm-hours {
    color: #667085;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .daily-confirm-crew {
        margin-left: 0;
    }
}

.daily-steps {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.daily-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #eaecf0;
    transition: opacity .2s ease;
}

.daily-step.is-pending {
    opacity: .45;
}

.daily-step-icon {
    position: relative;
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 2px solid #d0d5dd;
    border-radius: 50%;
    box-sizing: border-box;
}

.daily-step.is-working .daily-step-icon {
    border-color: #d0d5dd;
    border-top-color: var(--brand-accent);
    animation: daily-spin .8s linear infinite;
}

.daily-step.is-done .daily-step-icon,
.daily-step.is-warning .daily-step-icon,
.daily-step.is-failed .daily-step-icon,
.daily-step.is-skipped .daily-step-icon {
    border: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
    animation: daily-pop .25s ease;
}

.daily-step.is-done .daily-step-icon { background: var(--brand-accent); }
.daily-step.is-done .daily-step-icon::after { content: '✓'; }
.daily-step.is-warning .daily-step-icon { background: #f79009; }
.daily-step.is-warning .daily-step-icon::after { content: '!'; }
.daily-step.is-failed .daily-step-icon { background: #d92d20; }
.daily-step.is-failed .daily-step-icon::after { content: '×'; }
.daily-step.is-skipped .daily-step-icon { background: #d0d5dd; }
.daily-step.is-skipped .daily-step-icon::after { content: '–'; }

.daily-step-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.daily-step-text strong {
    color: #101828;
    font-size: 15px;
}

.daily-step-detail {
    color: #475467;
    font-size: 13px;
    line-height: 1.4;
}

.daily-step-detail:empty {
    display: none;
}

.daily-step.is-failed .daily-step-detail {
    color: #b42318;
}

.daily-steps-note {
    margin: 8px 0 0;
    color: #b54708;
    font-size: 14px;
}

.daily-steps-note:empty {
    display: none;
}

@keyframes daily-spin {
    to { transform: rotate(360deg); }
}

@keyframes daily-pop {
    from { transform: scale(.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Daily report page: the crew, one row each — who | hours by activity | signed, injury, Miter. */
.daily-crew-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.daily-crew-list {
    margin-top: 6px;
}

.daily-crew-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(160px, 1.2fr) minmax(0, 1.6fr);
    gap: 6px 18px;
    align-items: start;
    padding: 12px 0;
    border-top: 1px solid #eaecf0;
}

.daily-crew-row:first-child {
    border-top: 0;
}

.daily-crew-who {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.daily-crew-who strong {
    color: #101828;
    font-size: 16px;
}

.daily-crew-hours {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 1px;
}

.daily-crew-hours > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #475467;
    font-size: 15px;
}

.daily-crew-hours strong {
    color: #101828;
    white-space: nowrap;
}

.daily-crew-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.daily-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.daily-chip.is-good {
    background: #ecfdf3;
    color: #067647;
}

.daily-chip.is-bad {
    background: #fef3f2;
    color: #b42318;
}

.daily-chip.is-miter {
    background: #eff8ff;
    color: #175cd3;
}

.daily-crew-notes {
    grid-column: 1 / -1;
}

.daily-crew-notes p {
    margin: 2px 0;
}

.daily-crew-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 18px;
}

@media (max-width: 760px) {
    .daily-crew-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .daily-crew-status {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

/* Daily report page: column names over the crew; the day's forms. */
.daily-crew-row.daily-crew-head {
    padding: 4px 0 6px;
    border-top: 0;
    border-bottom: 1px solid #d0d5dd;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.daily-crew-head + .daily-crew-row {
    border-top: 0;
}

.daily-crew-head-split {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.daily-crew-head-status {
    text-align: right;
}

@media (max-width: 760px) {
    .daily-crew-row.daily-crew-head {
        display: none;
    }
}

.daily-forms .daily-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #eaecf0;
}

.daily-forms .daily-form-row:first-child {
    border-top: 0;
}

.daily-form-row > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.daily-forms-note {
    flex-basis: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d6fe;
    border-radius: 8px;
    background: #f4f3ff;
    color: #5925dc;
    font-size: 14px;
}

.daily-forms-note[hidden] {
    display: none;
}

/* Texted sign page: "Saving your signature…" while it saves. */
.daily-sign-saving {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 24, 40, .45);
    animation: daily-fade-in .2s ease;
}

.daily-sign-saving[hidden] {
    display: none;
}

.daily-sign-saving > div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .25);
    color: #101828;
    font-size: 16px;
}

.daily-sign-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #d0d5dd;
    border-top-color: var(--brand-accent);
    border-radius: 50%;
    animation: daily-spin .8s linear infinite;
}

/* Breaks: "Yes" is the good answer (green), "No" the one to flag (red). */
.daily-breaks .daily-injury-choices input[value="yes"]:checked + span {
    border-color: var(--brand-accent);
    background: #f3faf6;
    color: #05603a;
}

.daily-breaks .daily-injury-choices input[value="no"]:checked + span {
    border-color: #d92d20;
    background: #fef3f2;
    color: #b42318;
}

/* The pad's Clear sits right under the signature box. */
.daily-pad-clear {
    display: flex;
    justify-content: flex-end;
    margin: 2px 0 10px;
}

/* Admin > Daily Reports: editing the Employee Acknowledgement. */
.daily-ack-form textarea {
    width: 100%;
    box-sizing: border-box;
    resize: none;
    font-size: 15px;
    line-height: 1.5;
}

.daily-ack-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

/* Admin > Daily Reports: what each employee sync changed. */
.miter-log-sync {
    border-top: 1px solid #eaecf0;
}

.miter-log-sync summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    min-height: 44px;
    padding: 10px 0;
    cursor: pointer;
}

.miter-log-row {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    gap: 4px 14px;
    align-items: center;
    padding: 6px 0 6px 14px;
    border-left: 3px solid #eaecf0;
    font-size: 14px;
}

.miter-log-old {
    color: #667085;
    text-decoration: line-through;
}

@media (max-width: 560px) {
    .miter-log-row {
        grid-template-columns: 1fr;
    }
}

/* Admin > Daily Reports: Miter matching dropdowns at the site's normal size. */
.miter-link-row select {
    box-sizing: border-box;
    min-height: 46px;
    padding: 10px 36px 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background-color: #fff;
    color: #101828;
    font: inherit;
    font-size: 16px;
}

/* Employees from Miter, the change log and the token: collapsed panels at the bottom. */
.daily-admin-fold {
    margin-top: 14px;
}

.daily-admin-fold > summary {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 20px;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    background: #fff;
    color: #101828;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.daily-admin-fold > summary::-webkit-details-marker {
    display: none;
}

.daily-admin-fold > summary::after {
    content: '';
    width: 9px;
    height: 9px;
    margin-left: auto;
    border-right: 2px solid #667085;
    border-bottom: 2px solid #667085;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.daily-admin-fold[open] > summary::after {
    transform: rotate(-135deg);
}

.daily-admin-fold[open] > summary {
    margin-bottom: 10px;
}

/* Admin > Daily Reports: who signs timecards. */
.daily-sign-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.daily-sign-mode label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 760px;
    padding: 10px 12px;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
}

.daily-sign-mode label:has(input:checked) {
    border-color: var(--brand-accent);
    background: #f3faf6;
}

.daily-sign-mode input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-accent);
}

/* Daily report: the crew's day (start, paid hours, lunch) and each person's times. */
.daily-day {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 4px 0 10px;
}

.daily-day-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.daily-day-field input {
    box-sizing: border-box;
    width: 150px;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #101828;
    font: inherit;
    font-size: 16px;
}

.daily-day-short input {
    width: 110px;
}

.daily-lunch-confirm {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 11px 14px;
    border: 1px solid #fedf89;
    border-radius: 8px;
    background: #fffaeb;
    color: #93370d;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.daily-lunch-confirm input {
    width: 22px;
    height: 22px;
    accent-color: var(--brand-accent);
}

.daily-lunch-confirm.is-confirmed {
    border-color: #abefc6;
    background: #ecfdf3;
    color: #067647;
}

/* 5 paid hours or less: the lunch fields and confirmation hide (daily-report.js). */
.daily-day-field[hidden],
.daily-lunch-confirm[hidden] {
    display: none;
}

.daily-no-lunch {
    margin: 0 0 14px;
}

.daily-crew-times {
    color: #475467;
    font-size: 13px;
}

.daily-crew-times.is-own {
    color: #b54708;
    font-weight: 600;
}

.daily-page .daily-adjust {
    align-self: flex-start;
    padding: 2px 0;
    font-size: 13px;
}

.daily-adjust-box {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 12px;
    padding: 10px 12px;
    border: 1px dashed #fedf89;
    border-radius: 8px;
    background: #fffcf5;
}

.daily-adjust-box .daily-day-field input {
    width: 130px;
}

/* Daily report crew: each person a light card that stands apart from the day's
   fields, the name larger, room for their times on one line. */
.daily-page .daily-crew-card {
    grid-template-columns: minmax(230px, 310px) minmax(0, 1fr) auto;
    gap: 8px 18px;
    margin: 0 0 10px;
    padding: 14px 16px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #f9fafb;
}

.daily-page .daily-crew-card:first-child {
    padding-top: 14px;
    border-top: 1px solid #e4e7ec;
}

.daily-page .daily-crew-name {
    gap: 3px;
    padding-top: 8px;
}

.daily-page .daily-crew-name strong {
    color: #101828;
    font-size: 17px;
}

.daily-page .daily-crew-times {
    font-size: 13.5px;
    white-space: nowrap;
}

.daily-page .daily-adjust {
    margin-top: 2px;
}

.daily-page .daily-crew-end .tm-tab-count {
    color: #101828;
    font-size: 16px;
}

@media (max-width: 650px) {
    .daily-page .daily-crew-card {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .daily-page .daily-crew-times {
        white-space: normal;
    }
}

/* Daily report crew: larger name and times; a narrower activity box. */
.daily-page .daily-crew-card {
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr) auto;
}

.daily-page .daily-crew-name strong {
    font-size: 19px;
}

.daily-page .daily-crew-name .topic-meta {
    font-size: 14px;
}

.daily-page .daily-crew-times {
    font-size: 15px;
}

.daily-page .daily-adjust {
    font-size: 14px;
}

/* Hours (with its − and +), then the activity; the activity drops under the
   hours when the column is too narrow for both. */
.daily-page .daily-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.daily-page .daily-line select {
    flex: 1 1 150px;
    width: auto;
    min-width: 150px;
    max-width: 260px;
}

/* Daily report crew card: name with a classification tag, times with Adjust. */
.daily-page .daily-crew-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.daily-page .daily-crew-times-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    color: #475467;
}

.daily-page .daily-crew-times-row .daily-adjust {
    margin-top: 0;
}

.daily-class-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 2px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.daily-class-tag:not(.is-missing)::after {
    content: "";
    width: 6px;
    height: 6px;
    margin: -3px 1px 0 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.6;
}

.daily-class-tag select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.daily-class-tag:hover {
    border-color: #98a2b3;
}

.daily-class-tag:focus-within {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 107, 58, .12);
}

.daily-class-tag.is-changed {
    border-color: #f79009;
    background: #fffaeb;
    color: #b54708;
}

.daily-class-tag.is-missing {
    border-style: dashed;
    color: #667085;
    font-weight: 500;
    cursor: default;
}

/* No spinner arrows on the hours boxes. */
.daily-page .daily-line input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    text-align: center;
}

.daily-page .daily-line input[type="number"]::-webkit-inner-spin-button,
.daily-page .daily-line input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

/* − and + around the hours and lunch minutes (daily-report.js stepper()):
   iPads show no arrows on number boxes, and these are big enough for a thumb. */
.daily-stepper {
    display: inline-flex;
    align-items: stretch;
    gap: 6px;
}

/* A tap on the title above a stepper does nothing, so don't flash it grey. */
.daily-page label:has(.daily-stepper) {
    -webkit-tap-highlight-color: transparent;
}

/* Work hours and lunch minutes: set with − and + only, never typed. */
.daily-page .daily-stepper input.is-buttons-only {
    background: #f9fafb;
    font-weight: 600;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
}

/* Nothing to type, so no "you're typing here" outline when tapped. */
.daily-page .daily-stepper input.is-buttons-only:focus {
    border-color: #d0d5dd;
    box-shadow: none;
    outline: none;
}

.daily-page .daily-stepper input[type="number"] {
    width: 72px;
    -moz-appearance: textfield;
    appearance: textfield;
    text-align: center;
}

.daily-page .daily-stepper input[type="number"]::-webkit-inner-spin-button,
.daily-page .daily-stepper input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.daily-step-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    color: var(--brand-accent);
    font: inherit;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation; /* quick taps step, not zoom */
    transition: background-color .15s ease;
}

/* Not the site's dark button:hover, which sticks after a tap on an iPad. */
.daily-page .daily-step-button:hover,
.daily-page .daily-step-button:focus {
    background: #ffffff;
    outline: none;
}

.daily-page .daily-step-button:focus-visible {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 107, 58, .12);
}

.daily-page .daily-step-button:active {
    background: #f2f4f7;
}

@media (max-width: 650px) {
    .daily-page .daily-stepper input[type="number"] {
        width: 56px;
    }
}

.daily-class-chip {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fffaeb;
    color: #b54708;
    font-size: 13px;
    font-weight: 600;
}

/* Upload fields as drop areas (drop-zone.js): a dashed box that lights up while a
   file is dragged over the page, and turns green under the pointer. */
.drop-zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 74px;
    padding: 14px 16px;
    border: 2px dashed #d0d5dd;
    border-radius: 10px;
    background: #fcfcfd;
    color: #475467;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.drop-zone:hover {
    border-color: var(--brand-accent);
    color: var(--brand-accent-dark);
}

.drop-zone-icon {
    display: flex;
    color: #98a2b3;
    transition: color .18s ease, transform .18s ease;
}

.drop-zone-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The real file field, clear, over the whole box: click and drop are the browser's own. */
.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone:focus-within {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(30, 107, 58, .14);
}

/* A file is being dragged over the page: every drop area says "here". */
.drop-zones-ready .drop-zone {
    border-color: var(--brand-accent);
    background: #f3faf6;
    color: var(--brand-accent-dark);
}

.drop-zones-ready .drop-zone-icon {
    color: var(--brand-accent);
    transform: translateY(-2px);
}

/* ... and the one under the pointer. */
.drop-zone.is-drag-over {
    border-style: solid;
    background: #e3f2e9;
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(30, 107, 58, .16);
}

.drop-zone.has-file {
    border-style: solid;
    border-color: #a6d4b6;
    background: #f3faf6;
    color: #101828;
    font-weight: 600;
}

.drop-zone.has-file .drop-zone-icon {
    color: var(--brand-accent);
}

/* Text Messages: "Sending to 28 people..." while the mass text is handed off. */
.texts-sending-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    padding: 28px 24px;
    text-align: center;
    animation: texts-sending-in .2s ease;
}

.texts-sending-box strong {
    font-size: 18px;
}

.texts-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #e3f2e9;
    border-top-color: var(--brand-accent);
    border-radius: 50%;
    animation: texts-spin .8s linear infinite;
}

@keyframes texts-spin {
    to { transform: rotate(360deg); }
}

@keyframes texts-sending-in {
    from { opacity: 0; transform: scale(.96); }
    to { opacity: 1; transform: none; }
}

/* Toolbox talks are weekly (toolbox-week.php): the daily report's reminder
   (yellow Mon-Tue, red from Wednesday) and Admin's list of jobs without one. */
.toolbox-warning {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #fedf89;
    border-left: 5px solid #f79009;
    border-radius: 10px;
    background: #fffaeb;
    color: #93370d;
}

.toolbox-warning > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.toolbox-warning strong {
    font-size: 16px;
}

.toolbox-warning span {
    font-size: 14px;
}

.toolbox-warning .secondary-button {
    width: auto;
}

.toolbox-warning.is-overdue {
    border-color: #fecdca;
    border-left-color: #d92d20;
    background: #fef3f2;
    color: #b42318;
}

.toolbox-missing {
    border-left: 5px solid #f79009;
}

.toolbox-missing.is-overdue {
    border-left-color: #d92d20;
}

/* Schedule > Equipment: an excavator's Lift Chart (lift-chart.php). */
.sched-lift-link {
    align-self: flex-start;
    margin-top: 4px;
    padding: 5px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #ffffff;
    color: #1e6b3a;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.sched-lift-link:hover {
    border-color: #1e6b3a;
    background: #f6fbf8;
}

.lift-warning {
    margin: 0 0 18px;
    padding: 14px 18px;
    border: 1px solid #fedf89;
    border-radius: 10px;
    background: #fffaeb;
    color: #7a2e0e;
    font-size: 15px;
    line-height: 1.45;
}

.lift-warning ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.lift-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #ffffff;
}

.lift-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.lift-table th,
.lift-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #eaecf0;
    text-align: right;
    white-space: nowrap;
    font-size: 17px;
}

.lift-table thead th {
    background: #f2f4f7;
    color: #344054;
    font-size: 14px;
}

.lift-table tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f9fafb;
    color: #344054;
    font-size: 15px;
    text-align: left;
}

.lift-table tbody tr:last-child th,
.lift-table tbody tr:last-child td {
    border-bottom: 0;
}

.lift-table .lift-corner {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left;
}

.lift-table .lift-corner span {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.lift-table .lift-corner span + span {
    color: #667085;
    font-weight: 400;
}

.lift-table tr.is-ground th,
.lift-table tr.is-ground td {
    background: #f6fbf8;
}

.lift-table td.lift-max,
.lift-table th.lift-max-head {
    border-left: 2px solid #d0d5dd;
}

.lift-table td.lift-max span {
    display: block;
    color: #667085;
    font-size: 12px;
}

.lift-units {
    margin: 8px 2px 18px;
}

.lift-sources p {
    margin: 6px 0;
    color: #344054;
}

/* Projects (admins): jobs not connected to Miter. */
.miter-missing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.miter-missing > div {
    flex: 1 1 320px;
}

.miter-missing .secondary-button {
    width: auto;
    white-space: nowrap;
}

/* ---- Submittals (admins, desktop): submittals.php, submittal.php, admin-submittal-library.php ---- */
.sub-page.sub-wide {
    max-width: 1400px;
}

.sub-page .secondary-button,
.sub-page .primary-button {
    width: auto;
}

.sub-muted {
    color: #667085;
    font-size: 13px;
}

.sub-heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Link buttons side by side: same shape, size and type as each other. */
.sub-heading-actions .primary-button,
.sub-heading-actions .secondary-button {
    display: inline-flex;
    align-items: center;
    width: auto;
    margin: 0;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sub-heading-actions .secondary-button {
    border-color: #cbd5e1;
}

.sub-table {
    width: 100%;
    border-collapse: collapse;
}

.sub-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #667085;
    padding: 10px 12px;
    border-bottom: 1px solid #eaecf0;
}

.sub-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #eaecf0;
    vertical-align: middle;
}

.sub-table tr:last-child td {
    border-bottom: 0;
}

.sub-num {
    width: 70px;
    font-variant-numeric: tabular-nums;
}

.sub-status {
    width: 210px;
}

.sub-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.sub-actions form {
    display: inline;
}

.sub-actions .secondary-button {
    margin-left: 6px;
}

.sub-title-link {
    color: #101828;
    font-weight: 600;
    text-decoration: none;
}

.sub-title-link:hover {
    color: var(--brand-accent);
}

.sub-row-error {
    margin-top: 4px;
    color: #b42318;
    font-size: 13px;
}

.sub-row-off {
    opacity: .5;
}

.sub-delete {
    color: #b42318;
}

.sub-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.sub-pill-reading {
    background: #fef0c7;
    color: #93370d;
}

.sub-pill-draft {
    background: #e8f2ec;
    color: var(--brand-accent);
}

.sub-pill-built {
    background: #e8f2ec;
    color: var(--brand-accent-dark);
}

.sub-pill-sent {
    background: #eaecf0;
    color: #344054;
}

.sub-pill-error {
    background: #fee4e2;
    color: #b42318;
}

/* New Submittals: the section list */
.sub-division-group {
    border-bottom: 1px solid #eaecf0;
}

.sub-division {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #667085;
    cursor: pointer;
    list-style: none;
    border-radius: 6px;
    user-select: none;
}

.sub-division::-webkit-details-marker {
    display: none;
}

.sub-division::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid #98a2b3;
    border-bottom: 2px solid #98a2b3;
    transform: rotate(-45deg);
    transition: transform .18s ease;
}

.sub-division-group[open] > .sub-division::before {
    transform: rotate(45deg);
}

.sub-division:hover {
    background: #f9fafb;
}

.sub-division-count {
    margin-left: auto;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #98a2b3;
}

.sub-division-group[open] {
    padding-bottom: 8px;
}

.sub-section {
    display: grid;
    grid-template-columns: 24px 110px 1fr 90px 110px;
    gap: 12px;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid #f2f4f7;
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s;
}

.sub-section:hover {
    background: #f9fafb;
}

.sub-section input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-accent);
}

.sub-section-num {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sub-section-dim {
    color: #98a2b3;
}

.sub-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Draft page */
.sub-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-chip {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.sub-chip:hover {
    border-color: var(--brand-accent);
}

.sub-chip-on {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: #fff;
}

.sub-rec {
    font-weight: 400;
    font-size: 12px;
    opacity: .8;
}

.sub-draft {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1000px) {
    .sub-draft {
        grid-template-columns: 1fr;
    }
}

.sub-panel-title {
    display: flex;
    justify-content: space-between;
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #667085;
}

.sub-questions,
.sub-flags,
.sub-contents {
    padding: 0;
    overflow: hidden;
}

.sub-q {
    padding: 16px 18px;
    border-bottom: 1px solid #eaecf0;
    transition: background .2s;
}

.sub-q:last-child {
    border-bottom: 0;
}

.sub-q-done {
    background: #fbfdfb;
}

.sub-q-check {
    float: right;
    color: var(--brand-accent);
    font-size: 12px;
    font-weight: 700;
}

.sub-q-title {
    margin-bottom: 4px;
    font-weight: 700;
}

.sub-q-detail {
    margin-bottom: 10px;
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}

.sub-q-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-flag {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 18px;
    border-bottom: 1px solid #eaecf0;
    color: inherit;
    font-size: 13px;
    line-height: 1.45;
    text-decoration: none;
}

.sub-flag:last-child {
    border-bottom: 0;
}

a.sub-flag:hover {
    background: #f9fafb;
}

.sub-flag strong {
    display: block;
    font-size: 14px;
}

.sub-flag-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fef0c7;
    color: #93370d;
    font-weight: 700;
}

.sub-flag-red {
    background: #fee4e2;
    color: #b42318;
}

.sub-flag-info {
    background: #eaecf0;
    color: #344054;
}

.sub-para {
    padding: 12px 18px 4px;
    border-top: 1px solid #eaecf0;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sub-para:first-child {
    border-top: 0;
}

.sub-item summary {
    display: grid;
    grid-template-columns: 1fr 140px 110px;
    gap: 12px;
    align-items: center;
    padding: 11px 18px;
    cursor: pointer;
    list-style: none;
    transition: background .15s;
}

.sub-item summary::-webkit-details-marker {
    display: none;
}

.sub-item summary:hover {
    background: #f9fafb;
}

.sub-item-name {
    font-weight: 600;
}

.sub-item-name small {
    display: block;
    margin-top: 2px;
    color: #667085;
    font-weight: 400;
}

.sub-item-off .sub-item-name {
    color: #98a2b3;
}

.sub-item-sizes {
    font-variant-numeric: tabular-nums;
}

.sub-item-detail {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    padding: 6px 18px 18px;
    border-top: 1px dashed #eaecf0;
    background: #fcfcfd;
}

.sub-item-detail h4 {
    margin: 12px 0 6px;
    color: #667085;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sub-item-detail p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.sub-item-flag {
    color: #93370d;
}

.sub-line-form {
    display: flex;
    gap: 8px;
}

.sub-line-form input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    font-size: 14px;
}

.sub-line-form .sub-sizes-input {
    flex: 0 0 120px;
}

.sub-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.sub-item-sheet a {
    display: block;
    margin-top: 12px;
    color: var(--brand-accent);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.sub-item-sheet img {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    border: 1px solid #eaecf0;
    border-radius: 4px;
    background: #fff;
}

.sub-no-sheet {
    display: grid;
    place-items: center;
    margin-top: 12px;
    aspect-ratio: 8.5 / 11;
    border: 2px dashed #fda29b;
    border-radius: 4px;
    color: #b42318;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.sub-add-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.sub-add-row {
    display: flex;
    gap: 14px;
}

.sub-add-row .form-group {
    flex: 1;
}

.sub-add select,
.sub-add input[type="text"],
.sub-add input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    font-size: 15px;
    background: #fff;
}

.sub-lib-results {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    max-height: 320px;
    overflow: auto;
}

.sub-lib-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #eaecf0;
    border-radius: 7px;
    background: #fff;
    color: #101828;           /* the site's button style is white text on dark */
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sub-lib-row:hover {
    border-color: var(--brand-accent);
    background: #f6faf7;
    color: #101828;
}

.sub-lib-row small {
    flex: none;
    color: #667085;
}

.sub-lib-picked,
.sub-lib-picked:hover {
    border-color: var(--brand-accent);
    background: #e8f2ec;
    color: #101828;
}

.sub-lib-none {
    padding: 10px 0;
    color: #667085;
    font-size: 14px;
}

.sub-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 4px 0 18px;
    font-size: 14px;
    line-height: 1.4;
}

.sub-check input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--brand-accent);
}

.sub-package {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

.sub-package p {
    margin: 4px 0 0;
}

.sub-package-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sub-package-actions form {
    display: inline;
}

.sub-bar {
    max-width: 520px;
    height: 8px;
    margin-top: 16px;
    border-radius: 99px;
    background: #eaecf0;
    overflow: hidden;
}

.sub-bar i {
    display: block;
    width: 35%;
    height: 100%;
    border-radius: 99px;
    background: var(--brand-accent);
    animation: sub-slide 1.4s ease-in-out infinite;
}

@keyframes sub-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

/* Library admin */
.sub-lib-filter {
    margin-bottom: 12px;
}

.sub-lib-tabs {
    margin-bottom: 16px;
}

.sub-lib-thumb {
    width: 72px;
}

.sub-lib-thumb img {
    display: block;
    width: 60px;
    border: 1px solid #eaecf0;
    border-radius: 3px;
    background: #fff;
}

.sub-lib-std {
    max-width: 260px;
}

/* Contents: drag grip on the left, × on the right (as the accounting site's change orders) */
.sub-item summary {
    grid-template-columns: 22px 1fr 120px 240px 28px;
    padding-left: 8px;
    padding-right: 10px;
}

.sub-grip {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    border-radius: 6px;
    color: #98a2b3;
    font-size: 15px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: color .15s, background .15s;
}

.sub-grip:hover {
    color: var(--brand-accent);
    background: rgba(47, 143, 82, 0.12);
}

.sub-x {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #98a2b3;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    opacity: 0;
    transition: opacity .15s, color .15s, background .15s;
}

.sub-item summary:hover .sub-x,
.sub-x:focus-visible {
    opacity: 1;
}

.sub-x:hover {
    background: #fef3f2;
    color: #b42318;
}

.sub-item.sub-dragging {
    position: relative;
    z-index: 6;
    background: #fff;
    box-shadow: 0 10px 18px -8px rgba(0, 0, 0, 0.35);
}

.sub-item.sub-dragging .sub-grip {
    color: var(--brand-accent);
}

body.sub-drag-active,
body.sub-drag-active * {
    cursor: grabbing !important;
    user-select: none;
}

/* Plan check card (job Submittals page) */
.sub-plan-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sub-plan-head .tm-card-title {
    margin-bottom: 4px;
}

.sub-plan-head .secondary-button {
    flex: none;
    width: auto;
}

.sub-plan-running {
    opacity: .75;
}

.sub-plan-counts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0 6px;
}

.sub-plan-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 11px 4px;
    border-top: 1px solid #eaecf0;
}

.sub-plan-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d0d5dd;
}

.sub-plan-missing .sub-plan-dot {
    background: #d92d20;
}

.sub-plan-covered .sub-plan-dot,
.sub-plan-added .sub-plan-dot {
    background: var(--brand-accent);
}

.sub-plan-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sub-plan-main .sub-muted {
    font-size: 13px;
    line-height: 1.4;
}

.sub-plan-act {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.sub-plan-act form {
    margin: 0;
}

.sub-plan-add {
    display: flex;
    gap: 6px;
}

.sub-plan-add select {
    max-width: 210px;
    padding: 8px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    font-size: 13px;
    background: #fff;
}

.sub-plan-act .primary-button,
.sub-plan-act .secondary-button {
    width: auto;
    padding: 8px 14px;
    font-size: 13px;
}

.sub-plan-link {
    width: auto;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sub-plan-link:hover {
    background: transparent;
    color: #101828;
}

.sub-plan-others {
    margin-top: 6px;
    border-top: 1px solid #eaecf0;
}

.sub-plan-others summary {
    padding: 11px 4px;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.sub-plan-not_ours strong {
    color: #667085;
    font-weight: 600;
}

.sub-plan-notes {
    margin: 12px 0 0;
    padding: 12px 16px 12px 30px;
    border-radius: 8px;
    background: #f9fafb;
    color: #475467;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .sub-plan-row {
        grid-template-columns: 10px 1fr;
    }

    .sub-plan-act {
        grid-column: 2;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* The cut sheet for a line: picked from a dropdown (sheets past jobs used first), searched, or uploaded. */
.sub-pick-form {
    margin: 0;
}

.sub-pick {
    width: 100%;
    min-height: 34px;
    padding: 6px 28px 6px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background-color: #fff;
    color: #101828;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.sub-pick:hover,
.sub-pick:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(31, 107, 64, .12);
    outline: none;
}

.sub-pick-empty {
    border-color: #fda29b;
    background-color: #fffbfa;
    color: #b42318;
    font-weight: 600;
}

.sub-pick-empty option,
.sub-pick-empty optgroup {
    color: #101828;
    font-weight: 400;
}

.sub-item-sheet .sub-pick-form {
    margin-top: 12px;
}

.sub-pick-more {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #eaecf0;
}

.sub-pick-more .sub-lib-results {
    margin-top: 0;
}

.sub-pick-more .sub-lib-results:empty {
    display: none;
}

.sub-pick-more .sub-lib-row {
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    font-size: 13px;
}

.sub-pick-upload {
    display: grid;
    gap: 8px;
}

.sub-pick-upload input[type=file] {
    max-width: 100%;
    font-size: 13px;
}

.sub-pick-upload .sub-check {
    margin: 0;
    font-size: 13px;
}

.sub-pick-upload .secondary-button {
    justify-self: start;
}

/* Admin > Error Log (admin-errors.php): the filter tabs are buttons, rows
   hide while filtering, and a row's details open under it. */
.tm-show-tabs button.status-tab {
    width: auto;
    display: inline-block;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.tm-show-tabs button.status-tab.is-current {
    background: #fff;
}

.error-log-row[hidden] {
    display: none;
}

.error-log-message {
    color: #101828;
}

.error-log-detail {
    flex-basis: 100%;
}

.error-log-detail summary {
    color: #475467;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.error-log-detail pre {
    max-height: 260px;
    margin: 6px 0;
    padding: 10px;
    overflow: auto;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Careers (careers.php): the open postings from Miter, Apply goes to Miter's page. */
.careers-main { max-width: 760px; margin: 0 auto; padding: 18px 16px 48px; }
.careers-head { margin: 0 0 18px; text-align: center; }
.careers-head h1 { margin: 0 0 6px; font-size: 28px; }
.careers-head p { margin: 0; color: #667085; }
.careers-card { margin-bottom: 16px; }
.careers-card-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.careers-card h2 { margin: 0 0 6px; font-size: 21px; }
.careers-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #667085; font-size: 14px; }
.careers-apply { flex: none; display: inline-block; padding: 11px 28px; border: 1px solid var(--brand-accent); border-radius: 8px; font-weight: 600; line-height: 1.2; text-decoration: none; transition: background .15s ease, transform .15s ease; }
.careers-apply:active { transform: translateY(1px); }
.careers-description { margin: 14px 0 4px; padding-top: 14px; border-top: 1px solid #eaecf0; color: #344054; line-height: 1.55; }
.careers-description p { margin: 0 0 10px; }
.careers-apply-bottom { display: none; }
@media (max-width: 560px) {
    .careers-card-head .careers-apply { display: none; }
    .careers-apply-bottom { display: block; margin-top: 12px; text-align: center; }
}
