/* Shared listing join/split: create Document view + Draft/Pending Document sheet.
 * One contract everywhere: field root is flow-root; the field name stays floated in
 * BOTH line and section modes (same as Post an Announcement / create Designer).
 * Line mode has no leading break (first body line beside the name; later wrap lines
 * return to the field-title column under the name — never a flex content column).
 * Section mode uses a zero-height clearing .cc-ad-flow-break so the first body line
 * starts under the name — never unfloat the title or clear the whole editor.
 */

.cc-ad-body [data-cc-ad-key].cc-ad-look-line,
.cc-ad-company [data-cc-ad-key].cc-ad-look-line,
.cc-ad-body [data-cc-ad-key].cc-ad-look-section,
.cc-ad-company [data-cc-ad-key].cc-ad-look-section {
    display: flow-root !important;
    clear: both;
    width: 100%;
    /* relative: Optional Fields × (.cc-ad-remove) is position:absolute on the field */
    position: relative;
}

.job-tab-content .cc-doc-flow-field,
.job-tab-content .cc-doc-added-field {
    display: flow-root !important;
    clear: both;
    width: 100%;
    /* relative: Optional Fields × (.cc-ad-remove) needs a containing block */
    position: relative;
}

.job-tab-content .cc-doc-flow-field:has(> .cc-ad-remove),
.job-tab-content .cc-doc-added-field:has(> .cc-ad-remove) {
    padding-right: 1.6rem;
}

.job-tab-content .cc-doc-flow-field:hover > .cc-ad-remove,
.job-tab-content .cc-doc-flow-field:focus-within > .cc-ad-remove,
.job-tab-content .cc-doc-added-field:hover > .cc-ad-remove,
.job-tab-content .cc-doc-added-field:focus-within > .cc-ad-remove {
    opacity: 0.85;
}

.cc-ad-body [data-cc-ad-key].cc-ad-look-line > .cc-ad-listing-h4,
.cc-ad-company [data-cc-ad-key].cc-ad-look-line > .cc-ad-listing-h4,
.cc-ad-body [data-cc-ad-key].cc-ad-look-section > .cc-ad-listing-h4,
.cc-ad-company [data-cc-ad-key].cc-ad-look-section > .cc-ad-listing-h4,
.job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-line,
.job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-section {
    float: left !important;
    display: inline !important;
    position: static !important;
    flex: none !important;
    margin: 0 0.35rem 0 0 !important;
    white-space: nowrap;
    pointer-events: auto !important;
    cursor: text;
    user-select: none;
    outline: none;
    z-index: auto;
}

.cc-ad-body [data-cc-ad-key].cc-ad-look-line .cc-ad-editor,
.cc-ad-company [data-cc-ad-key].cc-ad-look-line .cc-ad-editor,
.cc-ad-body [data-cc-ad-key].cc-ad-look-section .cc-ad-editor,
.cc-ad-company [data-cc-ad-key].cc-ad-look-section .cc-ad-editor,
.cc-ad-body [data-cc-ad-key].cc-ad-look-line .cc-ad-prose,
.cc-ad-company [data-cc-ad-key].cc-ad-look-line .cc-ad-prose,
.cc-ad-body [data-cc-ad-key].cc-ad-look-line .cc-ad-meta-editor,
.cc-ad-company [data-cc-ad-key].cc-ad-look-line .cc-ad-meta-editor,
.job-tab-content .cc-doc-flow-field > [data-cc-job-translate-field].cc-doc-flow-joined,
.job-tab-content .cc-doc-flow-field > [data-cc-job-translate-field].cc-doc-flow-section,
.job-right .cc-doc-flow-field > [data-cc-job-translate-field][contenteditable="true"].cc-doc-flow-joined,
.job-right .cc-doc-flow-field > [data-cc-job-translate-field][contenteditable="true"].cc-doc-flow-section {
    display: block !important;
    flex: none !important;
    float: none !important;
    min-width: 0;
    min-height: 0 !important;
    overflow: visible !important;
    width: auto;
    max-width: none;
    padding-left: 0;
    margin-left: 0;
    text-indent: 0 !important;
    clear: none;
}

/*
 * Leading flow-break must CLEAR the floated field name.
 * An inline <br> only wraps within the shortened line beside the float, so the first
 * body line stays indented under the end of the label. Block + clear starts body text
 * on the field-name column (Designer + Document section mode).
 */
.cc-ad-editor > .cc-ad-flow-break,
.job-tab-content [data-cc-job-translate-field] > .cc-ad-flow-break,
.job-tab-content [data-cc-job-translate-field] > .cc-doc-flow-break,
.job-tab-content .cc-doc-flow-field > [data-cc-job-translate-field] > .cc-ad-flow-break,
.job-tab-content .cc-doc-flow-field > [data-cc-job-translate-field] > .cc-doc-flow-break {
    display: block !important;
    clear: both !important;
    width: 100%;
    height: 0;
    line-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
}

/* Posted / read-only listing: same float wrap contract as Document (never unfloat section titles). */
.job-tab-content h4.cc-listing-flow-line {
    clear: none;
    display: inline !important;
    float: left;
    margin-right: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
}

.job-tab-content h4.cc-listing-flow-section {
    clear: none;
}

.job-tab-content h4.cc-listing-flow-line + .cc-job-translate-value,
.job-tab-content h4.cc-listing-flow-line + [data-cc-job-translate-field],
.job-tab-content h4.cc-listing-flow-section + .cc-job-translate-value,
.job-tab-content h4.cc-listing-flow-section + [data-cc-job-translate-field] {
    display: block;
}

/* Section + line titles stay floated inside the shared field root (create Document contract). */
.job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-section,
.job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-line,
.job-tab-content h4.cc-listing-flow-section {
    float: left !important;
    display: inline !important;
    clear: none !important;
    margin: 0 0.35rem 0 0 !important;
}

.job-tab-content .cc-doc-flow-field {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 21px;
}

/* Application Procedures credit used to sit outside the field (zero p margin),
 * so Attachments sat flush against it. Keep credit inside the procedures field;
 * restore the old gap between procedures body and the credit line. */
.job-tab-content .cc-doc-flow-field > .cc-doc-procedures-credit {
    clear: both;
    margin: 21px 0 0;
}

/* Beat Assets theme h4 18px/1.2 so float height matches body line boxes
 * (create Document view + Pending Document sheet). */
html[data-theme="light"] .job-right .job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-line,
html[data-theme="dark"] .job-right .job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-line,
html[data-theme="light"] .job-right .job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-section,
html[data-theme="dark"] .job-right .job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-section,
.job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-line,
.job-tab-content .cc-doc-flow-field > h4.cc-listing-flow-section {
    clear: none !important;
    overflow: hidden;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.job-tab-content .cc-doc-flow-field > [data-cc-job-translate-field] {
    display: block;
    padding-left: 0;
    text-indent: 0;
    margin-left: 0;
    clear: none;
    font-size: 14px;
    line-height: 1.4;
}

.job-tab-content .cc-doc-flow-field > [data-cc-job-translate-field].cc-doc-flow-joined,
.job-tab-content .cc-doc-flow-field > [data-cc-job-translate-field].cc-doc-flow-section,
.job-right .cc-doc-flow-field > [data-cc-job-translate-field][contenteditable="true"].cc-doc-flow-joined,
.job-right .cc-doc-flow-field > [data-cc-job-translate-field][contenteditable="true"].cc-doc-flow-section,
.cc-ad-body [data-cc-ad-key].cc-ad-look-line .cc-ad-editor,
.cc-ad-company [data-cc-ad-key].cc-ad-look-line .cc-ad-editor {
    white-space: pre-wrap !important;
}

/* Company tab (public + Document): hidden until upper meta Company: click. */
.job-right .cc-ad-company-tab[hidden] {
    display: none !important;
}

.job-right .cc-job-meta-label[data-cc-ad-company-tab-trigger] {
    pointer-events: auto !important;
    cursor: pointer;
}

.job-right .cc-job-meta-label .cc-ad-meta-company-tab-word {
    display: inline;
    line-height: inherit;
    border-bottom: 0 !important;
    text-decoration: underline dotted transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.14em;
}

.job-right .cc-job-meta-label[data-cc-ad-company-tab-trigger]:hover .cc-ad-meta-company-tab-word,
.job-right.is-cc-ad-company-pane .cc-job-meta-label .cc-ad-meta-company-tab-word {
    text-decoration-color: currentColor;
}
