.tjc-forms-manager {
    width: 100%;
}

.tjc-forms-manager-head,
.tjc-job-forms-head,
.tjc-new-job-forms-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.tjc-forms-manager-head h2,
.tjc-job-forms-head h3,
.tjc-new-job-forms-head h3,
.tjc-form-builder-heading h3,
.tjc-form-builder-toolbar h3 {
    margin: 0 0 6px;
}

.tjc-forms-manager-head p,
.tjc-job-forms-head p,
.tjc-form-builder-heading p,
.tjc-form-builder-toolbar p {
    margin: 0;
    color: #64748b;
}

.tjc-form-template-list {
    display: grid;
    gap: 12px;
}

.tjc-forms-empty {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    border: 1px dashed #cbd5e1;
    border-radius: 15px;
    background: #fff;
    color: #64748b;
}

.tjc-forms-empty strong {
    color: #172b4d;
}

.tjc-form-template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    border: 1px solid #dce5ef;
    border-radius: 15px;
    background: #fff;
}

.tjc-form-template-copy {
    min-width: 0;
}

.tjc-form-template-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tjc-form-template-card h3 {
    margin: 0;
}

.tjc-form-template-card p {
    margin: 7px 0 9px;
    color: #64748b;
}

.tjc-form-template-meta {
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
}

.tjc-form-template-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.tjc-forms-manager .tjc-link-btn,
.tjc-job-forms-section .tjc-link-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1f5f8b;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.tjc-forms-manager .tjc-link-btn:hover,
.tjc-forms-manager .tjc-link-btn:focus,
.tjc-job-forms-section .tjc-link-btn:hover,
.tjc-job-forms-section .tjc-link-btn:focus {
    text-decoration: underline;
}

.tjc-forms-manager .tjc-link-btn-danger,
.tjc-job-forms-section .tjc-link-btn-danger {
    color: #b42318;
}

.tjc-form-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e8f5ec;
    color: #1f6f3f;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.tjc-form-status-badge.is-inactive,
.tjc-form-status-badge.is-draft {
    background: #f1f5f9;
    color: #64748b;
}

.tjc-form-status-badge.is-completed {
    background: #e8f5ec;
    color: #1f6f3f;
}

/* Template builder */
.tjc-form-builder {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #dce5ef;
    border-radius: 16px;
    background: #f8fafc;
}

.tjc-form-builder-heading,
.tjc-form-builder-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.tjc-form-details-card {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dce5ef;
    border-radius: 13px;
    background: #fff;
}

.tjc-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
    gap: 13px 15px;
}

.tjc-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tjc-form-field-full {
    grid-column: 1 / -1;
}

.tjc-form-builder .tjc-form-field > span,
.tjc-builder-field-editor label > span {
    font-size: 12px;
    font-weight: 800;
    color: #334155;
}

.tjc-form-builder .tjc-form-field input[type="text"],
.tjc-form-builder .tjc-form-field select,
.tjc-form-builder .tjc-form-field textarea,
.tjc-builder-field-editor input[type="text"],
.tjc-builder-field-editor select,
.tjc-builder-field-editor textarea {
    width: 100%;
    min-height: 41px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #cfd9e5;
    border-radius: 9px;
    background: #fff;
    color: #172b4d;
    box-shadow: none;
    box-sizing: border-box;
    font: inherit;
}

.tjc-form-builder .tjc-form-field input[type="text"]:focus,
.tjc-form-builder .tjc-form-field select:focus,
.tjc-form-builder .tjc-form-field textarea:focus,
.tjc-builder-field-editor input[type="text"]:focus,
.tjc-builder-field-editor select:focus,
.tjc-builder-field-editor textarea:focus {
    outline: none;
    border-color: #6c9fbd;
    box-shadow: 0 0 0 3px rgba(74, 129, 165, .12);
}

.tjc-form-builder .tjc-form-field textarea {
    min-height: 66px;
    resize: vertical;
}

.tjc-form-status-field select {
    max-width: 190px;
}

.tjc-form-builder-toolbar {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #dce5ef;
}

.tjc-builder-field-editor {
    margin-top: 13px;
    padding: 15px;
    border: 1px solid #bfd2e5;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 43, 77, .06);
}

.tjc-builder-field-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.tjc-builder-field-editor-head strong,
.tjc-builder-field-editor-head span {
    display: block;
}

.tjc-builder-field-editor-head strong {
    color: #172b4d;
    font-size: 15px;
}

.tjc-builder-field-editor-head span {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
}

.tjc-builder-field-main {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, .6fr);
    gap: 12px;
}

.tjc-builder-field-editor label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tjc-builder-field-help,
.tjc-builder-field-options {
    margin-top: 11px;
}

.tjc-builder-field-editor textarea {
    min-height: 72px;
    resize: vertical;
}

.tjc-builder-field-editor-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5ebf2;
}

.tjc-builder-required {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 7px !important;
    color: #334155;
    font-weight: 700;
}

.tjc-builder-required input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.tjc-builder-field-editor-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.tjc-builder-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 13px;
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: rgba(255, 255, 255, .7);
    color: #64748b;
}

.tjc-builder-empty[hidden] {
    display: none !important;
}

.tjc-builder-empty strong {
    color: #334155;
}

.tjc-builder-fields {
    display: grid;
    gap: 8px;
    margin-top: 13px;
}

.tjc-builder-field {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 9px 11px;
    border: 1px solid #dce5ef;
    border-radius: 11px;
    background: #fff;
}

.tjc-builder-field-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #eef4f8;
    color: #33566d;
    font-size: 12px;
    font-weight: 800;
}

.tjc-builder-field-summary {
    min-width: 0;
}

.tjc-builder-field-summary strong {
    display: block;
    overflow: hidden;
    color: #172b4d;
    font-size: 14px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tjc-builder-field-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

.tjc-builder-field-type {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eef4f8;
    color: #33566d;
    font-weight: 800;
}

.tjc-builder-field-required {
    color: #9a3412;
    font-weight: 800;
}

.tjc-builder-field-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tjc-builder-field-actions .tjc-link-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
    text-decoration: none;
}

.tjc-form-builder-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid #dce5ef;
}

.tjc-form-message {
    min-height: 20px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.tjc-form-message.is-error {
    color: #b42318;
}

.tjc-form-message.is-success {
    color: #1f6f3f;
}

/* Form selection and job-card forms */
.tjc-new-job-template-grid {
    display: grid;
    gap: 10px;
}

.tjc-new-job-template-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dce5ef;
    border-radius: 11px;
    background: #fff;
}

.tjc-new-job-template-option label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

.tjc-new-job-template-option input[type="checkbox"] {
    width: 19px;
    height: 19px;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.tjc-new-job-template-option span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.tjc-new-job-template-option small {
    color: #64748b;
    line-height: 1.4;
}

.tjc-new-job-template-option > a {
    flex: 0 0 auto;
    color: #1f5f8b;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.tjc-new-job-template-option > a:hover,
.tjc-new-job-template-option > a:focus {
    text-decoration: underline;
}

.tjc-job-forms-section {
    margin-top: 18px;
}

.tjc-form-attach-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 16px;
    padding: 12px;
    border: 1px solid #dce5ef;
    border-radius: 12px;
    background: #f8fafc;
}

.tjc-form-attach-row select {
    min-height: 42px;
    flex: 1 1 260px;
}

.tjc-job-form-list {
    display: grid;
    gap: 12px;
}

.tjc-job-form-empty {
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
}

.tjc-job-form-card {
    overflow: hidden;
    border: 1px solid #dce5ef;
    border-radius: 14px;
    background: #fff;
}

.tjc-job-form-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    background: #f8fafc;
    cursor: pointer;
    list-style: none;
}

.tjc-job-form-card > summary::-webkit-details-marker {
    display: none;
}

.tjc-job-form-summary-copy {
    min-width: 0;
}

.tjc-job-form-summary-copy strong,
.tjc-job-form-summary-copy small {
    display: block;
}

.tjc-job-form-summary-copy small {
    margin-top: 4px;
    color: #64748b;
    line-height: 1.4;
}

.tjc-job-form-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 13px;
    padding: 14px;
}

.tjc-job-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tjc-job-form-field-full,
.tjc-job-form-heading,
.tjc-job-form-instruction,
.tjc-job-form-actions {
    grid-column: 1 / -1;
}

.tjc-job-form-label {
    font-weight: 800;
    color: #334155;
}

.tjc-job-form-label em {
    color: #b42318;
    font-style: normal;
}

.tjc-job-form-field > small {
    color: #64748b;
    line-height: 1.35;
}

.tjc-job-form-field input:not([type="checkbox"]),
.tjc-job-form-field select,
.tjc-job-form-field textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #cfd9e5;
    border-radius: 9px;
    background: #fff;
    color: #172b4d;
    box-sizing: border-box;
}

.tjc-job-form-field textarea {
    min-height: 78px;
    resize: vertical;
}

.tjc-job-form-heading {
    margin: 3px 0 0;
    padding-bottom: 7px;
    border-bottom: 1px solid #dce5ef;
}

.tjc-job-form-instruction {
    padding: 10px 12px;
    border-left: 4px solid #65b846;
    border-radius: 8px;
    background: #f3f8f4;
    color: #334155;
    line-height: 1.45;
}

.tjc-job-form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #cfd9e5;
    border-radius: 9px;
    background: #fff;
}

.tjc-job-form-checkbox input {
    width: 19px;
    height: 19px;
    margin: 0;
}

.tjc-job-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 5px;
}

.tjc-form-signature-preview {
    display: flex;
    align-items: center;
    min-height: 96px;
    padding: 9px;
    border: 1px solid #d8e1eb;
    border-radius: 9px;
    background: #fff;
}

.tjc-form-signature-preview img {
    display: block;
    max-width: 100%;
    max-height: 84px;
}

.tjc-form-signature-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Signature modal */
.tjc-form-signature-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .72);
}

.tjc-form-signature-overlay[hidden] {
    display: none !important;
}

.tjc-form-signature-dialog {
    width: min(840px, 100%);
    overflow: hidden;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
}

.tjc-form-signature-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 18px;
    border-bottom: 1px solid #dce5ef;
}

.tjc-form-signature-dialog-head strong,
.tjc-form-signature-dialog-head span {
    display: block;
}

.tjc-form-signature-dialog-head span {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.tjc-form-signature-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #172b4d;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.tjc-form-signature-canvas-wrap {
    padding: 18px;
    background: #f8fafc;
}

.tjc-form-signature-canvas {
    display: block;
    width: 100%;
    height: 300px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.tjc-form-signature-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px 18px;
    border-top: 1px solid #dce5ef;
}

@media (max-width: 760px) {
    .tjc-forms-manager-head,
    .tjc-job-forms-head,
    .tjc-form-builder-heading,
    .tjc-form-builder-toolbar,
    .tjc-form-template-card {
        flex-direction: column;
        align-items: stretch;
    }

    .tjc-form-template-actions {
        width: 100%;
    }

    .tjc-form-grid,
    .tjc-builder-field-main,
    .tjc-job-form-body {
        grid-template-columns: 1fr;
    }

    .tjc-form-status-field select {
        max-width: none;
    }

    .tjc-builder-field-editor-controls,
    .tjc-new-job-template-option,
    .tjc-form-attach-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tjc-builder-field {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .tjc-builder-field-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 43px;
    }

    .tjc-builder-field-summary strong {
        white-space: normal;
    }

    .tjc-builder-field-editor-actions,
    .tjc-form-builder-actions,
    .tjc-job-form-actions,
    .tjc-form-signature-dialog-actions {
        width: 100%;
    }

    .tjc-builder-field-editor-actions .tjc-button,
    .tjc-form-builder-actions .tjc-button,
    .tjc-job-form-actions .tjc-button,
    .tjc-form-signature-dialog-actions .tjc-button {
        flex: 1 1 auto;
    }

    .tjc-new-job-template-option > a {
        margin-left: 29px;
    }

    .tjc-form-signature-overlay {
        align-items: stretch;
        padding: 0;
    }

    .tjc-form-signature-dialog {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100%;
        border-radius: 0;
    }

    .tjc-form-signature-canvas-wrap {
        display: flex;
        flex: 1 1 auto;
        padding: 12px;
    }

    .tjc-form-signature-canvas {
        height: auto;
        min-height: 320px;
        flex: 1 1 auto;
    }
}

/* V5 compact attachment workflow */
.tjc-new-job-forms-head{align-items:center}.tjc-new-job-form-picker{display:flex;align-items:center;gap:10px;margin:12px 0}.tjc-new-job-form-picker select{flex:1;min-height:42px}.tjc-new-job-selected-list{display:grid;gap:8px}.tjc-new-job-selected-item{display:flex;align-items:center;gap:12px;padding:11px 13px;border:1px solid #dce5ef;border-radius:12px;background:#f8fafc}.tjc-new-job-selected-item>span{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px}.tjc-new-job-selected-item small{color:#64748b}.tjc-job-form-list{display:grid;gap:10px}.tjc-job-form-card-compact{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:13px 14px;border:1px solid #dce5ef;border-radius:13px;background:#fff}.tjc-job-form-card-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:#eef6ff;font-size:19px}.tjc-job-form-summary-copy{display:flex;min-width:0;flex-direction:column;gap:3px}.tjc-job-form-summary-copy strong{font-size:15px}.tjc-job-form-summary-copy small{color:#64748b;line-height:1.35}.tjc-job-form-card-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.tjc-job-form-card-actions .tjc-button{min-height:38px;padding:8px 12px}.tjc-job-form-completion-card{border:0;border-radius:0;background:transparent}.tjc-job-form-completion-card .tjc-job-form-field{margin-bottom:14px}.tjc-job-form-completion-card .tjc-job-form-heading{margin:18px 0 10px}.tjc-job-form-completion-card input,.tjc-job-form-completion-card select,.tjc-job-form-completion-card textarea{width:100%}

/* Stronger custom form library */
.tjc-form-template-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.tjc-form-template-card{position:relative;display:grid;grid-template-columns:1fr;align-content:space-between;min-height:180px;padding:18px 18px 15px;border-radius:16px;box-shadow:0 5px 16px rgba(15,23,42,.04)}.tjc-form-template-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;border-radius:16px 0 0 16px;background:#65b846}.tjc-form-template-card h3{font-size:18px}.tjc-form-template-card p{line-height:1.45}.tjc-form-template-actions{justify-content:flex-end;padding-top:12px;border-top:1px solid #edf2f7}.tjc-form-template-meta{display:inline-flex;margin-top:5px;padding:4px 8px;border-radius:999px;background:#f1f5f9}
@media(max-width:900px){.tjc-form-template-list{grid-template-columns:1fr}}@media(max-width:700px){.tjc-new-job-forms-head,.tjc-job-forms-head{align-items:stretch;flex-direction:column}.tjc-new-job-form-picker{align-items:stretch;flex-direction:column}.tjc-job-form-card-compact{grid-template-columns:auto minmax(0,1fr);align-items:start}.tjc-job-form-card-compact>.tjc-form-status-badge{justify-self:start}.tjc-job-form-card-actions{grid-column:1/-1}.tjc-job-form-card-actions .tjc-button{flex:1}.tjc-form-template-card{min-height:0}}

/* V5.1 attached-form card layout correction */
.tjc-job-form-card-compact {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.tjc-job-form-card-compact .tjc-job-form-card-icon {
    grid-column: 1;
    grid-row: 1;
}

.tjc-job-form-card-compact .tjc-job-form-summary-copy {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
}

.tjc-job-form-card-compact .tjc-job-form-summary-copy strong {
    display: block;
    min-width: 0;
    font-size: 16px;
    line-height: 1.3;
    overflow-wrap: normal;
    word-break: normal;
}

.tjc-job-form-card-compact .tjc-job-form-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    min-width: 0;
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.35;
}

.tjc-job-form-card-compact .tjc-job-form-meta span {
    display: inline-flex;
    align-items: center;
    white-space: normal;
}

.tjc-job-form-card-compact .tjc-job-form-meta span + span::before {
    content: "•";
    margin-right: 8px;
    color: #94a3b8;
}

.tjc-job-form-card-compact > .tjc-form-status-badge {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    white-space: nowrap;
}

.tjc-job-form-card-compact .tjc-job-form-card-actions {
    grid-column: 2 / 4;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-button,
.tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-link-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

.tjc-job-form-card-compact .tjc-form-message {
    flex-basis: 100%;
}

@media (max-width: 700px) {
    .tjc-job-form-card-compact {
        grid-template-columns: 38px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        padding: 12px;
    }

    .tjc-job-form-card-compact .tjc-job-form-card-icon {
        grid-column: 1;
        grid-row: 1;
    }

    .tjc-job-form-card-compact .tjc-job-form-summary-copy {
        grid-column: 2;
        grid-row: 1;
    }

    .tjc-job-form-card-compact > .tjc-form-status-badge {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
    }

    .tjc-job-form-card-compact .tjc-job-form-card-actions {
        grid-column: 1 / -1;
        grid-row: 3;
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-button {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }

    .tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-link-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .tjc-job-form-card-compact .tjc-job-form-meta {
        display: grid;
        gap: 2px;
    }

    .tjc-job-form-card-compact .tjc-job-form-meta span + span::before {
        content: none;
    }
}


/* V5.2 mobile polish and signature reliability */
.tjc-form-signature-preview[hidden],
.tjc-form-signature-overlay[hidden],
.tjc-new-job-form-picker[hidden],
.tjc-form-attach-row[hidden] { display: none !important; }

.tjc-form-template-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tjc-form-template-card {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: stretch;
    gap: 12px;
    min-height: 170px;
    padding: 16px 16px 12px;
    overflow: hidden;
}
.tjc-form-template-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #65b846;
}
.tjc-form-template-copy { padding-left: 2px; }
.tjc-form-template-title-row { gap: 8px; }
.tjc-form-template-card h3 { font-size: 17px; line-height: 1.3; }
.tjc-form-template-card p { margin: 7px 0 10px; font-size: 14px; line-height: 1.45; }
.tjc-form-template-actions {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #e8eef5;
}
.tjc-form-template-actions .tjc-link-btn {
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid #d6e1ec;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1;
    text-decoration: none !important;
}
.tjc-form-template-actions .tjc-link-btn-danger { border-color: #f0c7c3; }

.tjc-new-job-forms-head,
.tjc-job-forms-head { margin-bottom: 10px; }
.tjc-new-job-form-picker,
.tjc-form-attach-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    margin: 10px 0 12px;
    padding: 10px;
    border: 1px solid #dce5ef;
    border-radius: 12px;
    background: #f8fafc;
}
.tjc-new-job-form-picker select,
.tjc-form-attach-row select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    height: 42px;
    margin: 0;
    padding: 7px 36px 7px 11px;
    border: 1px solid #cfd9e5;
    border-radius: 9px;
    background-color: #fff;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.2;
}
.tjc-new-job-form-picker .tjc-button,
.tjc-form-attach-row .tjc-button {
    min-height: 42px;
    height: 42px;
    padding: 8px 15px;
    white-space: nowrap;
}
.tjc-form-attach-row .tjc-form-message { grid-column: 1 / -1; }

.tjc-job-form-card-compact > .tjc-form-status-badge {
    width: auto;
    min-width: 0;
    max-width: max-content;
    padding: 5px 9px;
}
.tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-link-btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d6e1ec;
    border-radius: 8px;
    text-decoration: none !important;
}

.tjc-form-signature-preview { min-height: 80px; }
.tjc-form-signature-preview img[src=""] { display: none; }
.tjc-form-signature-actions .tjc-button { min-height: 40px; }

.tjc-form-complete-actions .tjc-form-action-draft {
    background: #eaf2ff;
    border-color: #bdd3f5;
    color: #145da0;
}
.tjc-form-complete-actions .tjc-form-action-submit {
    background: #35a844;
    border-color: #35a844;
    color: #fff;
}
.tjc-form-complete-actions .tjc-form-action-exit {
    background: #fff1f0;
    border: 1px solid #efc4c0;
    color: #b42318;
}

@media (max-width: 760px) {
    .tjc-forms-manager { overflow: hidden; }
    .tjc-forms-manager-head { gap: 12px; margin-bottom: 14px; }
    .tjc-forms-manager-head h2 { font-size: 23px; line-height: 1.2; }
    .tjc-forms-manager-head p { font-size: 15px; line-height: 1.45; }
    .tjc-forms-manager-head .tjc-button { width: 100%; min-height: 46px; }
    .tjc-form-template-list { grid-template-columns: 1fr; gap: 10px; }
    .tjc-form-template-card {
        min-height: 0;
        padding: 14px 13px 11px 16px;
        border-radius: 14px;
    }
    .tjc-form-template-card h3 { font-size: 16px; overflow-wrap: anywhere; }
    .tjc-form-template-card p { font-size: 13px; margin-bottom: 8px; }
    .tjc-form-template-title-row { align-items: flex-start; }
    .tjc-form-status-badge { min-height: 21px; padding: 4px 7px; font-size: 10px; }
    .tjc-form-template-actions {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .tjc-form-template-actions .tjc-link-btn { width: 100%; justify-content: center; padding: 6px 4px; }

    .tjc-new-job-forms-head,
    .tjc-job-forms-head { display: block; }
    .tjc-new-job-form-picker,
    .tjc-form-attach-row {
        grid-template-columns: 1fr;
        padding: 9px;
        gap: 8px;
    }
    .tjc-new-job-form-picker select,
    .tjc-form-attach-row select {
        min-height: 44px;
        height: 44px;
        border-radius: 10px;
        font-size: 16px;
    }
    .tjc-new-job-form-picker .tjc-button,
    .tjc-form-attach-row .tjc-button {
        width: 100%;
        min-height: 44px;
        height: 44px;
    }

    .tjc-job-form-card-compact > .tjc-form-status-badge {
        justify-self: start;
        width: auto !important;
        max-width: max-content;
    }
    .tjc-job-form-card-compact .tjc-job-form-card-actions {
        gap: 7px;
    }
    .tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-button {
        min-height: 42px;
    }
    .tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-link-btn {
        min-height: 36px;
        font-size: 12px;
    }

    .tjc-form-complete-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 9px !important;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    }
    .tjc-form-complete-actions .tjc-form-action-draft,
    .tjc-form-complete-actions .tjc-form-action-submit {
        width: 100%;
        min-height: 46px;
        justify-content: center;
    }
    .tjc-form-complete-actions .tjc-form-action-exit {
        grid-column: 1 / -1;
        justify-self: center;
        width: min(180px, 70%);
        min-height: 40px;
        justify-content: center;
    }
    .tjc-form-complete-actions .tjc-form-message { grid-column: 1 / -1; }

    .tjc-form-signature-preview { min-height: 72px; }
    .tjc-form-signature-actions { gap: 8px; }
    .tjc-form-signature-actions .tjc-button { width: auto; flex: 0 0 auto; }
}


/* V5.3 final mobile signature and completion controls */
.tjc-form-signature-preview {
    min-height: 116px;
    justify-content: center;
}
.tjc-form-signature-preview img {
    width: 100%;
    max-width: 420px;
    max-height: 104px;
    object-fit: contain;
    object-position: center;
}
.tjc-form-signature-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tjc-form-signature-dialog-actions [data-tjc-clear-form-signature-pad] {
    background: #eaf2ff;
    border-color: #bdd3f5;
    color: #145da0;
}
.tjc-form-signature-dialog-actions [data-tjc-use-form-signature] {
    background: #35a844;
    border-color: #35a844;
    color: #fff;
}
.tjc-form-complete-actions {
    grid-template-columns: 1fr 1fr !important;
}

@media (max-width: 760px) {
    .tjc-form-signature-dialog {
        min-height: 100dvh;
        height: 100dvh;
    }
    .tjc-form-signature-dialog-actions {
        flex: 0 0 auto;
        width: 100%;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
        background: #fff;
        box-sizing: border-box;
    }
    .tjc-form-signature-dialog-actions .tjc-button {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        margin: 0;
        justify-content: center;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 700;
    }
    .tjc-form-signature-canvas-wrap {
        min-height: 0;
        padding-bottom: 8px;
    }
    .tjc-form-signature-preview {
        min-height: 104px;
        padding: 10px;
    }
    .tjc-form-signature-preview img {
        max-height: 92px;
    }
    .tjc-form-complete-actions {
        grid-template-columns: 1fr 1fr !important;
    }
}


/* Part 5: technician mobile attached-form card refinement. */
@media (max-width: 760px) {
    .tjc-job-forms-section .tjc-job-form-card-compact {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 16px 18px;
        column-gap: 14px;
        row-gap: 10px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .tjc-job-forms-section .tjc-job-form-card-compact .tjc-job-form-card-icon {
        grid-column: 1;
        grid-row: 1;
        width: 40px;
        height: 40px;
        margin: 2px 0 0 2px;
        align-self: start;
        box-sizing: border-box;
    }

    .tjc-job-forms-section .tjc-job-form-card-compact .tjc-job-form-summary-copy {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        padding: 0;
    }

    .tjc-job-forms-section .tjc-job-form-card-compact > .tjc-form-status-badge {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        margin: 0;
    }

    .tjc-job-forms-section .tjc-job-form-card-compact .tjc-job-form-card-actions {
        grid-column: 2;
        grid-row: 3;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        width: auto;
        min-width: 0;
        margin: 0;
    }

    .tjc-job-forms-section .tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-button,
    .tjc-job-forms-section .tjc-job-form-card-compact .tjc-job-form-card-actions .tjc-link-btn {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: auto !important;
        max-width: 100%;
        min-width: 112px;
        min-height: 40px;
        margin: 0;
        padding: 8px 14px;
        box-sizing: border-box;
        text-align: center;
        white-space: nowrap;
    }
}

/* V5.4 compact mobile custom forms manager and builder */
@media (max-width: 760px) {
    .tjc-form-template-card {
        gap: 9px;
        padding: 13px 12px 10px 20px;
        overflow: hidden;
    }

    .tjc-form-template-card::before {
        width: 4px;
    }

    .tjc-form-template-copy {
        padding-left: 0;
    }

    .tjc-form-template-title-row {
        gap: 7px;
    }

    .tjc-form-template-card h3 {
        line-height: 1.25;
    }

    .tjc-form-template-card p {
        margin: 5px 0 7px;
        line-height: 1.4;
    }

    .tjc-form-template-meta {
        margin-top: 2px;
    }

    .tjc-form-template-actions {
        gap: 5px;
        padding-top: 8px;
    }

    .tjc-form-template-actions .tjc-link-btn {
        min-height: 36px;
        padding: 5px 6px;
        border-radius: 7px;
        font-size: 12px;
    }

    .tjc-form-builder-heading {
        gap: 6px;
        margin-bottom: 12px;
    }

    .tjc-form-builder-heading h3 {
        margin-bottom: 4px;
        font-size: 22px;
        line-height: 1.2;
    }

    .tjc-form-builder-heading p,
    .tjc-form-builder-toolbar p {
        font-size: 14px;
        line-height: 1.4;
    }

    .tjc-builder-fields {
        gap: 8px;
        margin-top: 10px;
    }

    .tjc-builder-field {
        grid-template-columns: 32px minmax(0, 1fr);
        align-items: start;
        gap: 8px 10px;
        min-height: 0;
        padding: 10px;
        border-radius: 10px;
    }

    .tjc-builder-field-index {
        width: 30px;
        height: 30px;
    }

    .tjc-builder-field-summary {
        align-self: center;
        padding-top: 1px;
    }

    .tjc-builder-field-summary strong {
        font-size: 14px;
        line-height: 1.25;
    }

    .tjc-builder-field-meta {
        gap: 5px;
        margin-top: 3px;
        font-size: 10px;
    }

    .tjc-builder-field-type {
        min-height: 19px;
        padding: 2px 6px;
    }

    .tjc-builder-field-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(54px, 1fr) 38px 38px minmax(64px, 1fr);
        align-items: center;
        justify-content: stretch;
        gap: 5px;
        width: 100%;
        padding: 7px 0 0;
        border-top: 1px solid #edf2f7;
    }

    .tjc-builder-field-actions .tjc-link-btn {
        width: 100%;
        min-width: 0;
        min-height: 32px;
        padding: 4px 5px;
        border: 1px solid #d6e1ec;
        border-radius: 7px;
        font-size: 11px;
        line-height: 1;
        text-align: center;
        text-decoration: none !important;
    }

    .tjc-builder-field-actions [data-move-field-up],
    .tjc-builder-field-actions [data-move-field-down] {
        font-size: 0;
    }

    .tjc-builder-field-actions [data-move-field-up]::before {
        content: "\2191";
        font-size: 18px;
        line-height: 1;
    }

    .tjc-builder-field-actions [data-move-field-down]::before {
        content: "\2193";
        font-size: 18px;
        line-height: 1;
    }

    .tjc-builder-field-actions .tjc-link-btn-danger {
        border-color: #f0c7c3;
    }
}

/* V5.5 premium mobile form-card and builder-field refinement */
@media (max-width: 760px) {
    .tjc-forms-manager .tjc-form-template-card {
        box-sizing: border-box;
        width: 100%;
        margin: 0;
        padding: 14px 14px 12px 24px !important;
        gap: 10px;
        border-radius: 14px;
        overflow: hidden;
    }

    .tjc-forms-manager .tjc-form-template-card::before {
        left: 7px;
        top: 12px;
        bottom: 12px;
        width: 4px;
        border-radius: 999px;
    }

    .tjc-forms-manager .tjc-form-template-copy,
    .tjc-forms-manager .tjc-form-template-title-row,
    .tjc-forms-manager .tjc-form-template-actions {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        margin-left: 0 !important;
        padding-left: 0 !important;
    }

    .tjc-forms-manager .tjc-form-template-title-row {
        align-items: center;
        column-gap: 8px;
        row-gap: 6px;
    }

    .tjc-forms-manager .tjc-form-template-card h3 {
        min-width: 0;
        font-size: 16px;
        line-height: 1.28;
        overflow-wrap: anywhere;
    }

    .tjc-forms-manager .tjc-form-template-card p {
        margin: 6px 0 8px;
        font-size: 13px;
        line-height: 1.42;
    }

    .tjc-forms-manager .tjc-form-template-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        padding-top: 9px !important;
    }

    .tjc-forms-manager .tjc-form-template-actions .tjc-link-btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 38px;
        margin: 0 !important;
        padding: 6px 8px !important;
        border-radius: 9px;
        font-size: 12px;
        line-height: 1;
        white-space: nowrap;
    }

    .tjc-form-builder .tjc-builder-fields {
        gap: 9px;
    }

    .tjc-form-builder .tjc-builder-field {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 8px 10px;
        min-height: 0;
        padding: 10px 11px 9px;
        border-radius: 12px;
    }

    .tjc-form-builder .tjc-builder-field-summary {
        min-width: 0;
        padding-top: 1px;
    }

    .tjc-form-builder .tjc-builder-field-summary strong {
        font-size: 14px;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .tjc-form-builder .tjc-builder-field-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(72px, 1fr) 40px 40px minmax(82px, 1fr);
        gap: 6px;
        width: 100%;
        padding: 8px 0 0 !important;
        margin: 0 !important;
        border-top: 1px solid #edf2f7;
    }

    .tjc-form-builder .tjc-builder-field-actions .tjc-link-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 34px;
        margin: 0 !important;
        padding: 5px 7px !important;
        border: 1px solid #d6e1ec;
        border-radius: 8px;
        font-size: 11px;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-decoration: none !important;
    }

    .tjc-form-builder .tjc-builder-field-actions [data-move-field-up],
    .tjc-form-builder .tjc-builder-field-actions [data-move-field-down] {
        position: relative;
        color: transparent !important;
        font-size: 0 !important;
        padding: 0 !important;
    }

    .tjc-form-builder .tjc-builder-field-actions [data-move-field-up]::before,
    .tjc-form-builder .tjc-builder-field-actions [data-move-field-down]::before {
        position: static;
        display: block;
        color: #1f5f8b;
        font-size: 19px !important;
        font-weight: 800;
        line-height: 1;
    }

    .tjc-form-builder .tjc-builder-field-actions [data-move-field-up]::before {
        content: "\2191" !important;
    }

    .tjc-form-builder .tjc-builder-field-actions [data-move-field-down]::before {
        content: "\2193" !important;
    }

    .tjc-form-builder .tjc-builder-field-actions .tjc-link-btn:disabled::before {
        opacity: .4;
    }

    .tjc-form-builder .tjc-builder-field-actions .tjc-link-btn-danger {
        border-color: #efc4c0;
        color: #b42318;
    }
}


/* V5.6 final mobile polish: compact cards and single-line field controls */
.tjc-action-label-mobile{display:none}
@media (max-width:760px){
.tjc-forms-manager .tjc-form-template-card{display:block!important;width:100%!important;min-height:0!important;padding:14px!important;overflow:hidden!important;border-radius:14px!important}
.tjc-forms-manager .tjc-form-template-card::before{display:none!important;content:none!important}
.tjc-forms-manager .tjc-form-template-copy{width:100%!important;padding:0!important}
.tjc-forms-manager .tjc-form-template-title-row{display:flex!important;align-items:flex-start!important;justify-content:flex-start!important;gap:7px 9px!important;width:100%!important}
.tjc-forms-manager .tjc-form-template-card h3{flex:0 1 auto!important;max-width:100%!important;margin:0!important;font-size:16px!important;line-height:1.25!important}
.tjc-forms-manager .tjc-form-status-badge{flex:0 0 auto!important;min-height:22px!important;padding:4px 8px!important;font-size:10px!important}
.tjc-forms-manager .tjc-form-template-card p{margin:7px 0 9px!important;font-size:13px!important;line-height:1.4!important}
.tjc-forms-manager .tjc-form-template-meta{margin:0!important;padding:4px 8px!important;font-size:11px!important}
.tjc-forms-manager .tjc-form-template-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;width:100%!important;margin:12px 0 0!important;padding:10px 0 0!important;border-top:1px solid #e7edf4!important}
.tjc-forms-manager .tjc-form-template-actions .tjc-link-btn{box-sizing:border-box!important;width:100%!important;min-width:0!important;min-height:38px!important;height:38px!important;margin:0!important;padding:0 8px!important;border:1px solid #d6e1ec!important;border-radius:9px!important;background:#fff!important;font-size:12px!important;line-height:1!important;text-decoration:none!important}
.tjc-forms-manager .tjc-form-template-actions .tjc-link-btn-danger{border-color:#efc4c0!important}
.tjc-form-builder .tjc-builder-fields{gap:9px!important}
.tjc-form-builder .tjc-builder-field{display:grid!important;grid-template-columns:34px minmax(0,1fr)!important;align-items:start!important;gap:7px 10px!important;min-height:0!important;padding:10px!important;border-radius:12px!important}
.tjc-form-builder .tjc-builder-field-index{width:30px!important;height:30px!important}
.tjc-form-builder .tjc-builder-field-summary{min-width:0!important;padding:0!important}
.tjc-form-builder .tjc-builder-field-summary strong{display:block!important;font-size:14px!important;line-height:1.25!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
.tjc-form-builder .tjc-builder-field-meta{gap:5px!important;margin-top:4px!important;font-size:10px!important}
.tjc-form-builder .tjc-builder-field-actions{grid-column:1/-1!important;display:grid!important;grid-template-columns:minmax(64px,1fr) 40px 40px minmax(72px,1fr)!important;align-items:center!important;gap:6px!important;width:100%!important;margin:0!important;padding:8px 0 0!important;border-top:1px solid #e7edf4!important}
.tjc-form-builder .tjc-builder-field-actions .tjc-link-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:100%!important;min-width:0!important;min-height:34px!important;height:34px!important;margin:0!important;padding:0 7px!important;overflow:hidden!important;border:1px solid #d6e1ec!important;border-radius:8px!important;background:#fff!important;color:#1f5f8b!important;font-size:11px!important;line-height:1!important;white-space:nowrap!important;text-decoration:none!important}
.tjc-form-builder .tjc-builder-field-actions [data-move-field-up],.tjc-form-builder .tjc-builder-field-actions [data-move-field-down]{padding:0!important;color:#1f5f8b!important;font-size:16px!important}
.tjc-form-builder .tjc-builder-field-actions [data-move-field-up]::before,.tjc-form-builder .tjc-builder-field-actions [data-move-field-down]::before{display:none!important;content:none!important}
.tjc-action-label-full{display:none!important}.tjc-action-label-mobile{display:inline!important;color:currentColor!important;font-size:18px!important;font-weight:800!important;line-height:1!important}
.tjc-form-builder .tjc-builder-field-actions .tjc-link-btn-danger{border-color:#efc4c0!important;color:#b42318!important}
}
