body[class*="post-type-governdocs_"] #poststuff .postbox {
    position: relative;
    min-width: 255px;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    background: #fff;
    border-radius: 5px;
}
body[class*="post-type-governdocs_"] #poststuff #major-publishing-actions {
    padding: 7px 10px;
    background: #f9fafb;
}
body[class*="post-type-governdocs_"] #poststuff input[type=date], body[class*="post-type-governdocs_"] #poststuff input[type=datetime-local], body[class*="post-type-governdocs_"] #poststuff input[type=datetime], body[class*="post-type-governdocs_"] #poststuff input[type=email], body[class*="post-type-governdocs_"] #poststuff input[type=month], body[class*="post-type-governdocs_"] #poststuff input[type=number], body[class*="post-type-governdocs_"] #poststuff input[type=password], body[class*="post-type-governdocs_"] #poststuff input[type=search], body[class*="post-type-governdocs_"] #poststuff input[type=tel], body[class*="post-type-governdocs_"] #poststuff input[type=text], body[class*="post-type-governdocs_"] #poststuff input[type=time], body[class*="post-type-governdocs_"] #poststuff input[type=url], body[class*="post-type-governdocs_"] #poststuff input[type=week], body[class*="post-type-governdocs_"] #poststuff select, body[class*="post-type-governdocs_"] #poststuff textarea {
    padding: 4px 8px;
    border: 2px solid #d4dadf;
    margin: 0;
    box-shadow: none;
}
body[class*="post-type-governdocs_"] input.regular-text:focus, body[class*="post-type-governdocs_"] select:focus, body[class*="post-type-governdocs_"] textarea:focus, body[class*="post-type-governdocs_"] input.cmb2-text-small:focus {
    border-color: #d4dadf;
    box-shadow: 0 0 10px 0px #0086f230;
}

.governdocs-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.governdocs-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.governdocs-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccd0d4;
    transition: .2s;
    border-radius: 24px;
}

.governdocs-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: #fff;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.governdocs-switch input:checked + .governdocs-slider {
    background-color: #2271b1;
}

.governdocs-switch input:checked + .governdocs-slider:before {
    transform: translateX(22px);
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-page {
    max-width: 1240px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 20px;
    margin: 20px 0 20px;
    background: #fff;
    border: 1px solid #b4bdce;
    border-radius: 8px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-hero__brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-hero__logo {
    width: 32px;
    height: auto;
    flex: 0 0 auto;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-hero h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    padding: 0;
    font-weight: 600;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-hero p {
    margin: 0;
    max-width: 720px;
    font-size: 14px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-badge.is-free {
    color: #50575e;
    background: #f0f0f1;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-badge.is-pro {
    color: #0a4b78;
    background: #e7f3ff;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-notices {
    margin: 0 0 20px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-notices .notice,
body.toplevel_page_governdocs-document-governance .governdocs-settings-notices .update-nag,
body.toplevel_page_governdocs-document-governance .governdocs-settings-notices .error {
    margin: 0 0 12px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-tabs {
    margin-bottom: 0;
    border-bottom-color: transparent;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-tabs .nav-tab {
    padding: 10px 16px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-tabs .nav-tab-active {
    border-bottom-color: #fff;
    background: #fff;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-main,
body.toplevel_page_governdocs-document-governance .governdocs-settings-sidebar {
    min-width: 0;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-sidebar {
    display: grid;
    gap: 16px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-card {
    margin: 0 0 20px;
    padding: 24px 28px;
    background: #fff;
    border: 1px solid #b4bdce;
    border-radius: 8px;
    box-sizing: border-box;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-card--sidebar {
    margin-bottom: 0;
    padding: 20px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-card--placeholder {
    min-height: 220px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-card__header {
    margin-bottom: 16px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-card__header h2,
body.toplevel_page_governdocs-document-governance .governdocs-settings-card--sidebar h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-card__header p,
body.toplevel_page_governdocs-document-governance .governdocs-settings-card--sidebar p {
    margin: 0;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-upgrade-note, body.toplevel_page_governdocs-document-governance .governdocs-settings-inline-section {
    margin-top: 5px;
    padding-top: 15px;
    border-top: 1px solid #dcdcde;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-inline-section h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-inline-section p {
    margin-top: 0;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-actions {
    padding-top: 4px;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-main .form-table {
    margin-top: 0;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-main .form-table th {
    width: 240px;
    padding-left: 0;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-main .form-table td {
    padding-right: 0;
}

body.toplevel_page_governdocs-document-governance .governdocs-settings-main .button-primary {
    min-width: 140px;
}

@media (max-width: 960px) {
    body.toplevel_page_governdocs-document-governance .governdocs-settings-hero,
    body.toplevel_page_governdocs-document-governance .governdocs-settings-hero__brand {
        display: block;
    }

    body.toplevel_page_governdocs-document-governance .governdocs-settings-hero__logo {
        display: block;
        margin: 0 0 16px;
    }

    body.toplevel_page_governdocs-document-governance .governdocs-settings-hero__status {
        margin-top: 16px;
    }

    body.toplevel_page_governdocs-document-governance .governdocs-settings-layout {
        grid-template-columns: 1fr;
    }
}
body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row.governdocs-switch .cmb-td {
  position: relative;
}

/* Hide native checkbox */
body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row.governdocs-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* Switch container */
body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row.governdocs-switch input[type="checkbox"] + label {
  display: inline-block;
  position: relative;
  padding-left: 56px;
  cursor: pointer;
  line-height: 24px;
  font-weight: 600;
}

/* Track */
body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row.governdocs-switch input[type="checkbox"] + label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 40px;
  height: 20px;
  background: #c3c4c7;
  border-radius: 999px;
  transition: background .2s ease;
}

/* Knob */
body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row.governdocs-switch input[type="checkbox"] + label::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .2s ease;
}

/* Checked state */
body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row.governdocs-switch input[type="checkbox"]:checked + label::before {
  background: #2271b1;
}

body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row.governdocs-switch input[type="checkbox"]:checked + label::after {
  transform: translateX(20px);
}

body[class*="post-type-governdocs_"] #side-sortables .cmb2-wrap .cmb-row.governdocs-switch input[type="checkbox"] + label > .cmb2-metabox-description {
    display: block;
    padding-left: 56px;
    padding-top: 0;
    margin: 0;
    line-height: 1.4;
}

body.toplevel_page_governdocs,
body[class*="post-type-governdocs_"],
body[class*="post-type-governdocs_"] #wp-content-editor-tools {
    background: #f8fafb;
}

body[class*="post-type-governdocs_"] div.mce-toolbar-grp {
    background: #fff;
}
.governdocs-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 0;
}
.governdocs-col {
    flex: 1 1 0;
    min-width: 90px;
}
body[class*="post-type-governdocs_"] .governdocs-pro-upsell .button-primary {
    background: #0055ff;
    border-color: #0055ff;
}
body[class*="post-type-governdocs_"] .button-secondary {
    background: #fff;
}
body[class*="post-type-governdocs_"] .cmb-type-group .cmb-repeatable-group:not(:last-of-type), 
body[class*="post-type-governdocs_"] .cmb-type-group .cmb-row:not(:last-of-type), 
body[class*="post-type-governdocs_"] .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), 
body[class*="post-type-governdocs_"] .cmb2-postbox .cmb-row:not(:last-of-type) {
    border-bottom: none;
}
body[class*="post-type-governdocs_"] .cmb-th,
body[class*="post-type-governdocs_"] .cmb-td,
body[class*="post-type-governdocs_"] #side-sortables .cmb-th,
body[class*="post-type-governdocs_"] #side-sortables .cmb-td,
body[class*="post-type-governdocs_"] .cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-th {
    width: 100%;
    float: none;
    padding: 0;
    border: none;
}
body[class*="post-type-governdocs_"] #side-sortables .cmb-th label {
    margin: 0;
    padding: 0;
    font-size: 13px;
}
body[class*="post-type-governdocs_"] .cmb-repeatable-group:last-of-type, 
body[class*="post-type-governdocs_"] .cmb-row:last-of-type, 
body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row:last-of-type,
body[class*="post-type-governdocs_"] #side-sortables .cmb-repeatable-group:last-of-type, 
body[class*="post-type-governdocs_"] #side-sortables .cmb-row:last-of-type, 
body[class*="post-type-governdocs_"] #side-sortables .cmb2-wrap .cmb-row:last-of-type {
    border-bottom: 0;
    padding: 0;
}
body[class*="post-type-governdocs_"] .repeatable .cmb-repeatable-grouping {
    padding-bottom: 10px;
}
body[class*="post-type-governdocs_"] #side-sortables .cmb-th+.cmb-td, 
body[class*="post-type-governdocs_"] #side-sortables .cmb-th+.cmb-td,
body[class*="post-type-governdocs_"] .cmb-th+.cmb-td, 
body[class*="post-type-governdocs_"] .cmb-th+.cmb-td {
    width: 100%;
}
body[class*="post-type-governdocs_"] .cmb-type-group .cmb2-wrap>.cmb-field-list>.cmb-row, 
body[class*="post-type-governdocs_"] .cmb2-postbox .cmb2-wrap>.cmb-field-list>.cmb-row {
    padding: 10px 0 0;
    border: none;
    margin: 0;
}
body[class*="post-type-governdocs_"] #side-sortables .cmb2-wrap>.cmb-field-list>.cmb-row, body[class*="post-type-governdocs_"] .inner-sidebar .cmb2-wrap>.cmb-field-list>.cmb-row {
    padding: 16px 0 0;
    border: none;
}

body[class*="post-type-governdocs_"] .cmb2-metabox-description, body[class*="post-type-governdocs_"] #side-sortables .cmb2-metabox-description, body[class*="post-type-governdocs_"] .cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description {
    margin-top: 4px;
    padding: 0;
    color: #999;
    font-weight: 400;
    opacity: 1;
    letter-spacing: 0;
    font-size: 14px;
}
body[class*="post-type-governdocs_"] #poststuff input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]),
body[class*="post-type-governdocs_"] #poststuff textarea,
body[class*="post-type-governdocs_"] #poststuff select {
    width: 100%;
}
body[class*="post-type-governdocs_"] .cmb-repeatable-group .cmb-group-title {
    background-color: #f9fafb;
    border-bottom: 1px solid #ddd;
}
body[class*="post-type-governdocs_"] .cmb-repeatable-group .cmb2-upload-button {
    float:none;
}
body[class*="post-type-governdocs_"] .cmb-repeatable-grouping {
    border: 1px solid #d3d3d3 !important;
}
body[class*="post-type-governdocs_"] .cmb-row.cmb-remove-field-row {
    margin: 10px 0;
}
body[class*="post-type-governdocs_"] .cmb-remove-row button, body[class*="post-type-governdocs_"] .cmb-remove-row .button-secondary {
    min-height: unset;
    line-height: 1;
    font-size: 12px;
    background: #fff;
    padding: 0 5px;
    height: auto;
    margin-right: 5px;
    vertical-align: middle;
}
body[class*="post-type-governdocs_"] button.alignright {
    margin: 0 !important;
}
body[class*="post-type-governdocs_"] .cmb-remove-row span.dashicons {
    font-size: 14px;
}
body[class*="post-type-governdocs_"] button.cmb-remove-group-row.cmb-remove-group-row-button.alignright.button-secondary {
    line-height: 1.7;
    border: 1px solid #e74d4d;
    color: #e74d4d;
    background: #fff;
    padding: 0 12px;
}
#cmb2-metabox-governdocs_report_core .cmb2-upload-button.button-secondary,
#cmb2-metabox-governdocs_meeting_agenda .cmb2-upload-button.button-secondary,
#cmb2-metabox-governdocs_meeting_minutes .cmb2-upload-button.button-secondary,
#cmb2-metabox-governdocs_policy_core .cmb2-upload-button.button-secondary {
    padding: 0 25px;
    font-size: 0.9rem;
    margin: 15px 20px 10px 0;
    font-weight: 500;
}
#cmb2-metabox-governdocs_report_core .cmb2-media-status,
#cmb2-metabox-governdocs_meeting_agenda .cmb2-media-status,
#cmb2-metabox-governdocs_meeting_minutes .cmb2-media-status,
#cmb2-metabox-governdocs_policy_core .cmb2-media-status {
    display: inline-block;
    margin-top: 0px;
}
#cmb2-metabox-governdocs_report_core .cmb2-media-status .file-status, #cmb2-metabox-governdocs_meeting_agenda .cmb2-media-status .file-status, #cmb2-metabox-governdocs_meeting_minutes .cmb2-media-status .file-status, #cmb2-metabox-governdocs_policy_core .cmb2-media-status .file-status {
    margin: 0 10px 0 0;
    background: #f0f4f8;
    padding: 5px 15px;
    border-radius: 35px;
    border: 1px solid #e6eaef;
    font-size: 0.8rem;
}
input#governdocs_primary_external_url:disabled {
    background: #f0f4f8;
    opacity: 0.6;
}
/* Generic toggle utility */
.governdocs-hidden {
    display: none !important;
}
/* Tighten spacing inside CMB2 sections */
.governdocs-section .cmb-row:last-child {
    margin-bottom: 0;
}
/* Document-only mode adjustments (Classic editor) */
body.governdocs-is-document #postdivrich {
    display: none;
}
/* Default: hide content editor if needed for specific CPT */
body.post-type-governdocs_policy.governdocs-is-document #postdivrich {
    display: none;
}
/* Optional: cleaner app-style layout for Classic editor */
body[class*="post-type-governdocs_"] #poststuff {
    margin: 0 auto;
}
body[class*="post-type-governdocs_"] #post-body-content {
    margin-bottom: 20px;
}


body[class*="post-type-governdocs_"] .governdocs-audit-metabox {
    margin-top: 15px;
}
body[class*="post-type-governdocs_"] #governdocs_audit_log th,
body[class*="post-type-governdocs_"] .form-table th {
    background: #f9fafb;
    font-weight: 500;
    padding: 8px 10px;
}
body[class*="post-type-governdocs_"] .governdocs-prev-versions tr td,
body[class*="post-type-governdocs_"] tr.governdocs-audit-event td {
    border-top: 1px solid #c3c4c7;
    margin-bottom: 0;
    padding: 8px 10px;
}
body[class*="post-type-governdocs_"] .governdocs-prev-versions tr:first-child td,
body[class*="post-type-governdocs_"] tr.governdocs-audit-event:first-child td {
    border-top: none;
}
body[class*="post-type-governdocs_"] a.governdocs-audit-toggle {
    font-size: 12px;
    margin: 0;
}
body[class*="post-type-governdocs_"] code {
    background: #eee3c6;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
}
body[class*="post-type-governdocs_"] .updated code {
    background: #c6eec6;
}
body[class*="post-type-governdocs_"] .created code {
    background: #7ef17e;
}
/* ------------------------------------------------------------------
 * Classic Editor (TinyMCE) toolbar fix
 * Prevent vertical-stacked formatting buttons caused by global admin CSS
 * ------------------------------------------------------------------ */
/* Force toolbar rows to behave like rows again */
body[class*="post-type-governdocs_"] #postdivrich .mce-toolbar .mce-btn-group,
body[class*="post-type-governdocs_"] #postdivrich .mce-toolbar .mce-flow-layout,
body[class*="post-type-governdocs_"] #postdivrich .mce-toolbar .mce-flow-layout-item {
    display: inline-block !important;
    vertical-align: top !important;
    width: auto !important;
}

/* TinyMCE buttons should be inline-block (not block / full width) */
body[class*="post-type-governdocs_"] #postdivrich .mce-btn,
body[class*="post-type-governdocs_"] #postdivrich .mce-btn button,
body[class*="post-type-governdocs_"] #postdivrich .mce-btn-group .mce-btn {
    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
}

/* If any generic CSS is setting all buttons to full width, neutralize it here */
body[class*="post-type-governdocs_"] #postdivrich button,
body[class*="post-type-governdocs_"] #postdivrich .button {
    width: auto !important;
}

.governdocs_status span {
    padding: 4px 8px;
    border-radius: 3px;
}
.governdocs-status-published, 
.governdocs-status-approved {
    background: #9ff79f;
    color: #2a8e2b;
}
.governdocs-status-draft {
    background: #9fe5f7;
    color: #448596;
}
.governdocs-status-review {
    background: #f7f39f;
    color: #888216;
}
.governdocs-status-archived {
    background: #f8ba9f;
    color: #9a4a27;
}