[data-contract-v2], [data-contract-templates-v2] { color: #172b4d; }
.cv2-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(245px, 1fr); gap: 20px; align-items: start; }
.cv2-form { min-width: 0; display: grid; gap: 20px; }
.cv2-card, [data-contract-templates-v2] .ctv2-card { min-width: 0; border: 1px solid #dce5f0; border-radius: 12px; background: #fff; padding: 24px; box-shadow: 0 2px 10px rgba(19,49,85,.035); }
.cv2-card h2, [data-contract-templates-v2] h2 { margin: 0 0 18px; color: #14345c; font-size: 18px; }
.cv2-card h3 { margin: 6px 0 13px; font-size: 15px; color: #214b80; }
.cv2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.cv2-grid > label { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: #244d80; font-size: 14px; font-weight: 600; }
.cv2-grid .cv2-full, .cv2-field-group, .cv2-money-rule { grid-column: 1 / -1; }
.cv2-grid input, .cv2-grid select, .cv2-grid textarea { width: 100%; min-height: 42px; box-sizing: border-box; border: 1px solid #cfdced; border-radius: 7px; background: #fff; color: #172b4d; padding: 8px 10px; font: inherit; font-weight: 400; }
.cv2-grid textarea { min-height: 74px; resize: vertical; }
.cv2-grid input[readonly] { background: #f5f8fc; }
.cv2-grid input:focus-visible, .cv2-grid select:focus-visible, .cv2-grid textarea:focus-visible,
.cv2-page button:focus-visible, [data-contract-templates-v2] button:focus-visible { outline: 2px solid #206ad7; outline-offset: 2px; }
.cv2-grid small { color: #7386a1; font-weight: 400; line-height: 1.4; }
.cv2-picker-page { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cv2-picker-page small { margin-right: auto; }
.cv2-picker-page button { border: 1px solid #d5e2f0; background: #f7faff; border-radius: 5px; padding: 2px 7px; color: #315d92; font-size: 11px; }
.cv2-picker-page button:disabled { opacity: .45; cursor: default; }
.cv2-company-fill { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #dce7f5; background: #f7faff; border-radius: 7px; }
.cv2-company-fill label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cv2-company-fill input[type=checkbox] { width: auto; min-height: auto; }
.cv2-company-fill button { border: 1px solid #bdd3ee; background: #fff; border-radius: 6px; padding: 6px 9px; color: #215b9b; }
.cv2-company-fill small { width: 100%; }
.cv2-payment-display { display: grid; gap: 5px; padding: 11px 13px; border: 1px solid #dce7f5; background: #f7faff; border-radius: 7px; color: #315d92; font-size: 13px; }
.cv2-payment-display strong { color: #244d80; }
.cv2-payment-display small { margin-top: 4px; }
.cv2-inline { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; }
.cv2-inline input[type=checkbox] { width: auto; min-height: auto; }
.cv2-grid details { color: #315d92; font-size: 13px; }
.cv2-grid details > summary { cursor: pointer; }
.cv2-grid details > .cv2-grid { padding: 14px 0 4px; }
.cv2-field-group { border-top: 1px solid #e7edf5; margin-top: 4px; padding-top: 14px; }
.cv2-muted, .cv2-version-hint, .cv2-summary-state { color: #788ca6; font-size: 13px; line-height: 1.5; }
.cv2-error { color: #b43b3b; }
.cv2-status { min-height: 20px; color: #b43b3b; font-size: 13px; }
.cv2-status.ok { color: #1c7b4c; }
.cv2-actions { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 13px 0; background: rgba(250,252,255,.96); border-top: 1px solid #e1e9f4; }
.cv2-action-spacer { flex: 1; }
.cv2-page button, [data-contract-templates-v2] button { cursor: pointer; }
.cv2-summary { position: sticky; top: 16px; color: #172b4d; }
.cv2-summary dl { margin: 0; }
.cv2-summary dl > div, .cv2-summary-secondary > div { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid #ebf0f6; }
.cv2-summary dt { color: #7286a1; font-size: 12px; }
.cv2-summary dd { margin: 0; color: #183967; text-align: right; overflow-wrap: anywhere; font-weight: 600; font-size: 13px; }
.cv2-summary-secondary { margin-top: 16px; }
.cv2-summary-secondary > div { font-size: 12px; }
.cv2-manual-flag { color: #a45216; font-weight: 600; }
.cv2-money-rule { padding: 10px 12px; background: #f2f7ff; border-radius: 7px; color: #315d92; font-size: 13px; }
.cv2-fee-fields { margin: 12px 0 20px; }
.cv2-allocation { padding: 14px; border: 1px solid #dce5f0; border-radius: 8px; margin: 15px 0; }
.cv2-money-actions { display: flex; gap: 8px; margin: 16px 0; }
.cv2-money-result { margin-top: 14px; padding: 13px; background: #f5f8fc; border-radius: 8px; }
.cv2-money-result table { width: 100%; border-collapse: collapse; }
.cv2-money-result th, .cv2-money-result td { padding: 8px; text-align: left; border-bottom: 1px solid #dce5f0; }
.cv2-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(85vh, 850px); border: 1px solid #cfdaea; border-radius: 12px; padding: 20px; box-shadow: 0 14px 45px rgba(8,31,60,.25); }
.cv2-dialog::backdrop { background: rgba(19,36,59,.48); }
.cv2-dialog-head, .cv2-dialog-actions, .cv2-draft-item, .cv2-draft-buttons { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cv2-dialog-head h3 { margin: 0; }
.cv2-draft-item { padding: 12px 0; border-top: 1px solid #e7edf5; }
.cv2-draft-item small { display: block; margin-top: 5px; color: #788ca6; }
.cv2-preview-dialog { width: min(920px, calc(100vw - 32px)); }
.cv2-preview-pages { min-height: 240px; max-height: min(65vh, 720px); overflow: auto; padding: 12px; border: 1px solid #dce5f0; background: #f4f7fb; }
.cv2-preview-pages > p { margin: 0; }
.cv2-preview-toolbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 8px; border: 1px solid #dce5f0; background: #fff; }
.cv2-preview-toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.cv2-preview-toolbar input { width: 64px; padding: 5px; text-align: center; }
.cv2-preview-pages figure { margin: 14px 0 0; text-align: center; }
.cv2-preview-pages img { display: block; width: auto; max-width: 100%; height: auto; margin: auto; background: #fff; box-shadow: 0 2px 12px #aab4c5; }
.cv2-dialog-actions { justify-content: flex-end; margin-top: 10px; }
.cv2-dialog-actions a { padding: 7px 12px; border: 1px solid #adc7e8; border-radius: 6px; }
.ctv2-page { display: grid; gap: 14px; }
.ctv2-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.ctv2-list, .ctv2-editor { min-width: 0; padding: 20px; border: 1px solid #dce5f0; border-radius: 12px; background: #fff; }
.ctv2-list-head, .ctv2-editor-head, .ctv2-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ctv2-list-head h2, .ctv2-editor-head h2 { margin-bottom: 6px; }
.ctv2-list-head p, .ctv2-editor-head p, .ctv2-editor-head small, .ctv2-help { color: #788ca6; font-size: 13px; line-height: 1.45; }
.ctv2-filters, .ctv2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.ctv2-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 15px 0; }
.ctv2-filters label, .ctv2-grid label, .ctv2-field-row label, .ctv2-payment-row label { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: #244d80; font-size: 13px; font-weight: 600; }
.ctv2-filters input, .ctv2-filters select, .ctv2-grid input, .ctv2-grid select, .ctv2-grid textarea,
.ctv2-field-row input, .ctv2-field-row select, .ctv2-payment-row input, .ctv2-tab-panel textarea { box-sizing: border-box; width: 100%; min-height: 36px; padding: 6px 9px; border: 1px solid #cfdced; border-radius: 6px; background: #fff; color: #172b4d; font: inherit; font-weight: 400; }
.ctv2-grid textarea { min-height: 70px; resize: vertical; }
.ctv2-grid .wide, .ctv2-fieldset { grid-column: 1 / -1; }
.ctv2-table-wrap { overflow-x: auto; }
.ctv2-table-wrap table { min-width: 820px; width: 100%; border-collapse: collapse; }
.ctv2-table-wrap th, .ctv2-table-wrap td { padding: 10px 9px; border-bottom: 1px solid #e7edf5; text-align: left; font-size: 12px; vertical-align: top; }
.ctv2-table-wrap th { color: #5c7391; background: #f7faff; }
.ctv2-table-wrap td small { display: block; margin-top: 3px; color: #8797ac; }
.ctv2-link { border: 0; background: transparent; color: #1766bc; padding: 0; text-align: left; font-weight: 600; cursor: pointer; }
.ctv2-link:hover { text-decoration: underline; }
.ctv2-link:focus-visible { outline: 2px solid #1766bc; outline-offset: 3px; border-radius: 2px; }
.ctv2-editor { display: grid; gap: 14px; scroll-margin-top: 12px; }
.ctv2-readonly { padding: 10px 12px; background: #edf5ff; border: 1px solid #c7def9; border-radius: 7px; color: #245e9a; font-size: 13px; }
.ctv2-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid #dae5f2; }
.ctv2-tabs button { border: 0; background: transparent; padding: 9px 13px; color: #657d9b; }
.ctv2-tabs button[aria-selected=true] { color: #175ba6; border-bottom: 3px solid #2a75ca; font-weight: 700; }
.ctv2-tab-panel { min-height: 220px; }
.ctv2-tab-panel h3, .ctv2-history h3 { color: #214b80; font-size: 15px; }
.ctv2-field-row, .ctv2-binding-row, .ctv2-payment-row, .ctv2-word-pair section { border: 1px solid #e0e8f2; border-radius: 8px; padding: 13px; margin: 11px 0; }
.ctv2-field-row .ctv2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ctv2-field-row .ctv2-check, .ctv2-fieldset label { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; }
.ctv2-field-row .ctv2-check input, .ctv2-fieldset input[type=checkbox] { width: auto; min-height: 0; }
.ctv2-row-actions, .ctv2-actions, .ctv2-version-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ctv2-actions { padding-top: 13px; border-top: 1px solid #e1e9f4; }
.ctv2-word-pair { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.ctv2-word-pair section { min-width: 0; overflow-wrap: anywhere; }
.ctv2-word-preview { margin: 14px 0; min-width: 0; }
.ctv2-word-preview .ctv2-section-head { margin-bottom: 10px; }
.ctv2-word-preview .ctv2-section-head p { margin: 5px 0 0; color: #627997; font-size: 13px; }
.ctv2-word-preview .ctv2-section-head a { flex: 0 0 auto; }
.ctv2-word-preview summary { color: #175ba6; font-weight: 600; cursor: pointer; margin-bottom: 10px; }
.ctv2-page-preview { min-height: 240px; padding: 12px; border: 1px solid #dce5f0; background: #f4f7fb; }
.ctv2-page-toolbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 8px; background: #fff; border: 1px solid #dce5f0; }
.ctv2-page-toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.ctv2-page-toolbar input { width: 64px; padding: 5px; text-align: center; }
.ctv2-page-preview figure { margin: 14px 0 0; text-align: center; }
.ctv2-page-preview img { display: block; width: auto; max-width: 100%; height: auto; margin: auto; background: #fff; box-shadow: 0 2px 12px #aab4c5; }
.contract-layout-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.contract-layout-preview-head h2 { margin: 0 0 6px; }
.contract-layout-preview-head p { margin: 0; }
.contract-layout-preview-pages .attachment-preview-body { display: block; max-height: min(76vh, 900px); overflow: auto; }
.contract-layout-preview > .formhelp { margin-top: 9px; }
.contract-text-record > .formhelp { color: #9a5b1f; }
.ctv2-fieldset { border: 1px solid #dce5f0; border-radius: 7px; }
.ctv2-fieldset label { margin-right: 12px; }
.ctv2-trial-output iframe { display: block; width: 100%; height: 520px; border: 1px solid #dce5f0; }
.ctv2-status { min-height: 20px; color: #b43b3b; font-size: 13px; }
.ctv2-status.ok { color: #1c7b4c; }
.ctv2-error { color: #b43b3b; }
.ctv2-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: #627997; font-size: 12px; }
.ctv2-pagination button { border: 1px solid #d5e2f0; background: #f7faff; border-radius: 5px; padding: 5px 9px; color: #315d92; }
.ctv2-pagination button:disabled { opacity: .45; cursor: default; }
.ctv2-common-mapping, .ctv2-conditions { padding: 12px; border: 1px solid #dce7f5; border-radius: 8px; background: #f7faff; }
.ctv2-condition-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 9px 0; }
.ctv2-condition-row > label { flex: 1 1 130px; }
@media (max-width: 1023px) { .cv2-layout { grid-template-columns: minmax(0, 1fr); } .cv2-summary { position: static; grid-row: auto; } }
@media (max-width: 780px) { .ctv2-filters, .ctv2-field-row .ctv2-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 767px) { .cv2-card, .ctv2-list, .ctv2-editor { padding: 16px; } .cv2-grid, .ctv2-grid, .ctv2-filters, .ctv2-field-row .ctv2-grid, .ctv2-word-pair { grid-template-columns: minmax(0,1fr); } .cv2-actions { position: static; } .cv2-draft-item { align-items: flex-start; flex-direction: column; } }
