/* =========================================================
   THEABS - POST CONSOLE
   Professional publishing UI / responsive
========================================================= */

.post-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.post-page-header h1 {
    margin: 4px 0 5px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.post-page-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.post-eyebrow,
.post-section-kicker {
    display: block;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.post-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--primary-hover);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.post-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
    gap: 18px;
    align-items: start;
}

.post-editor-card,
.post-recent-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--panel-border-soft);
    border-radius: 14px;
    background: var(--surface-panel);
    box-shadow: 0 10px 30px rgba(0,0,0,.16);
}

.post-recent-card {
    position: sticky;
    top: 16px;
}

.post-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--panel-border);
}

.post-card-header h3 {
    margin: 4px 0 3px;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 750;
}

.post-card-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.post-card-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid var(--accent-border);
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--primary-hover);
    font-size: 12px;
}

.post-editor-card .card-body {
    padding: 0;
}

#postForm {
    width: 100%;
}

.post-form-section {
    padding: 19px 20px 4px;
}

.post-form-section + .post-form-section {
    margin-top: 4px;
    border-top: 1px solid var(--panel-border);
    padding-top: 19px;
}

.post-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.post-section-title::after {
    content: "";
    height: 1px;
    flex: 1;
    background: color-mix(in srgb, var(--surface) 94%, var(--text) 6%);
}

.post-form-section .form-group,
.post-conditional {
    margin-bottom: 16px;
}

.post-conditional {
    padding: 0 20px;
}

.post-conditional[hidden] {
    display: none !important;
}

.post-editor-card label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
}

.post-editor-card .form-control {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 9px;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
    line-height: 1.45;
    box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.post-editor-card .form-control::placeholder {
    color: var(--text-muted);
}

.post-editor-card .form-control:hover {
    border-color: rgba(255,255,255,.16);
}

.post-editor-card .form-control:focus {
    border-color: rgba(36,95,143,.75);
    background: var(--input-bg);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.post-editor-card select.form-control {
    cursor: pointer;
}

.post-editor-card textarea.form-control {
    min-height: 132px;
    resize: vertical;
    line-height: 1.55;
}

.post-field-hint {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 9px;
}

.form-help {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.45;
}

.post-upload-zone {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    padding: 12px;
    border: 1px dashed var(--panel-border);
    border-radius: 10px;
    background: var(--surface-strong);
    transition: border-color .18s, background .18s, transform .18s;
}

.post-upload-zone:hover {
    border-color: rgba(36,95,143,.55);
    background: color-mix(in srgb, var(--surface) 97%, var(--primary) 3%);
}

.post-upload-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid var(--accent-border);
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--primary-hover);
    font-size: 14px;
}

.post-upload-copy {
    min-width: 0;
    flex: 1;
}

.post-upload-copy strong,
.post-upload-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-upload-copy strong {
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
}

.post-upload-copy span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.4;
}

.post-browse-btn {
    min-height: 34px !important;
    padding: 0 12px !important;
    border-radius: 8px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    white-space: nowrap;
    cursor: pointer;
}

.post-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.post-url-zone {
    margin-bottom: 9px;
}

.post-file-preview,
.post-gallery-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--panel-border-soft);
    border-radius: 9px;
    background: var(--surface-strong);
}

.post-file-preview-thumb,
.post-gallery-preview-media {
    width: 58px;
    height: 48px;
    flex: 0 0 58px;
    object-fit: cover;
    border-radius: 7px;
    background: var(--bg);
}

.post-file-preview-info,
.post-gallery-preview-info {
    min-width: 0;
    flex: 1;
}

.post-file-preview-info strong,
.post-file-preview-info span,
.post-gallery-preview-info strong,
.post-gallery-preview-info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-file-preview-info strong,
.post-gallery-preview-info strong {
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 700;
}

.post-file-preview-info span,
.post-gallery-preview-info span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.post-preview-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 auto;
    min-height: 29px;
    padding: 0 9px;
    border: 1px solid rgba(255,92,92,.2);
    border-radius: 7px;
    background: rgba(189,101,75,.055);
    color: #bd654b;
    font-size: 9px;
    cursor: pointer;
}

.post-preview-remove:hover {
    background: rgba(189,101,75,.11);
}

.post-gallery-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 96%, var(--text) 4%);
    color: var(--text-muted);
    font-size: 9px;
}

.post-gallery-summary strong {
    color: var(--text-primary);
    font-size: 10px;
}

.post-gallery-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.post-upload-progress {
    margin: 16px 20px 0;
    padding: 11px 12px;
    border: 1px solid rgba(36,95,143,.18);
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface) 97%, var(--primary) 3%);
}

.post-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-muted);
    font-size: 10px;
}

.post-progress-head strong {
    color: var(--primary-hover);
}

.post-progress-track {
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
}

.post-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg,var(--primary-active),var(--primary-hover));
    transition: width .12s linear;
}

.post-progress-status {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 9px;
}

.post-form-message {
    margin: 14px 20px 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.45;
}

.post-form-message.success {
    border: 1px solid rgba(36,95,143,.22);
    background: rgba(36,95,143,.055);
    color: #245f8f;
}

.post-form-message.error {
    border: 1px solid rgba(255,92,92,.22);
    background: rgba(189,101,75,.055);
    color: #bd654b;
}

.post-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--panel-border);
}

.post-form-actions .btn {
    min-height: 39px;
    padding: 0 15px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}

.post-list {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding: 0 !important;
}

.post-list::-webkit-scrollbar {
    width: 6px;
}

.post-list::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: color-mix(in srgb, var(--surface) 88%, var(--text) 12%);
}

.post-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    border-bottom: 1px solid rgba(255,255,255,.055);
}

.post-list-item:last-child {
    border-bottom: 0;
}

.post-list-item:hover {
    background: color-mix(in srgb, var(--surface) 96%, var(--text) 4%);
}

.post-list-item-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.post-list-item-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--primary-hover);
    font-size: 11px;
}

.post-list-item-copy {
    min-width: 0;
}

.post-list-item-copy strong {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-list-item-copy span {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.post-list-item-copy p {
    display: -webkit-box;
    margin: 5px 0 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.post-delete-btn {
    min-height: 29px !important;
    padding: 0 9px !important;
    border-radius: 7px !important;
    font-size: 8px !important;
    flex: 0 0 auto;
}

.post-delete-btn:hover {
    transform: none !important;
}

.post-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    min-height: 180px;
    padding: 24px;
    color: var(--text-muted);
    text-align: center;
    font-size: 10px;
}

.post-empty strong {
    color: var(--text);
    font-size: 11px;
}

.post-error {
    color: #bd654b;
}

@media (max-width: 1180px) {
    .post-page-grid {
        grid-template-columns: minmax(0, 1fr) minmax(300px, .55fr);
    }
}

@media (max-width: 980px) {
    .post-page-grid {
        grid-template-columns: 1fr;
    }

    .post-recent-card {
        position: static;
    }

    .post-list {
        max-height: 520px;
    }
}

@media (max-width: 640px) {
    .post-page-header {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 15px;
    }

    .post-page-header h1 {
        font-size: 23px;
    }

    .post-header-badge {
        align-self: flex-start;
    }

    .post-card-header {
        min-height: 70px;
        padding: 14px;
    }

    .post-card-header h3 {
        font-size: 15px;
    }

    .post-form-section {
        padding: 16px 14px 2px;
    }

    .post-conditional {
        padding: 0 14px;
    }

    .post-upload-zone {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .post-upload-copy {
        flex: 1 1 calc(100% - 54px);
    }

    .post-browse-btn {
        width: 100%;
    }

    .post-form-actions {
        flex-direction: column-reverse;
        padding: 13px 14px 15px;
    }

    .post-form-actions .btn {
        width: 100%;
    }

    .post-upload-progress,
    .post-form-message {
        margin-left: 14px;
        margin-right: 14px;
    }

    .post-file-preview,
    .post-gallery-preview-item {
        align-items: center;
    }

    .post-preview-remove span {
        display: none;
    }

    .post-preview-remove {
        width: 30px;
        padding: 0;
    }

    .post-list-item {
        padding: 11px 12px;
    }

    .post-list-item-copy p {
        display: none;
    }
}

/* =========================================================
   POST APPROVAL / MULTI URL EXTENSIONS
========================================================= */
.post-url-list{display:grid;gap:10px;margin-bottom:10px}.post-url-row{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:8px}.post-url-remove{display:flex;align-items:center;justify-content:center;padding:0}.post-add-url-btn{margin-top:2px}.post-mixed-url-box{margin-top:18px;padding:16px;border:1px solid var(--border-color,#eee9df);border-radius:14px;background:color-mix(in srgb, var(--surface) 98%, var(--text) 2%)}.post-mixed-url-title{font-weight:700;margin-bottom:10px}.post-author-line{display:block!important;color:var(--text-muted,#66727e)!important;font-size:12px}.post-list-item-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}.post-status-badge{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.status-pending{background:rgba(183,137,67,.14);color:#b78943}.status-published{background:rgba(36,95,143,.14);color:#245f8f}.status-deleted,.status-rejected{background:rgba(189,101,75,.14);color:#bd654b}.post-gallery-summary{display:flex;gap:12px;flex-wrap:wrap;margin:10px 0;font-size:12px;color:var(--text-muted,#66727e)}
@media(max-width:640px){
    .post-url-row{grid-template-columns:minmax(0,1fr) 38px}

    /* Archived/transaction list rows stack cleanly on small screens. */
    .post-list-item{
        flex-direction:column;
        align-items:stretch;
        gap:10px;
        width:100%;
    }

    .post-list-item-main{
        width:100%;
        max-width:100%;
        flex:0 0 auto;
    }

    .post-list-item-copy{
        min-width:0;
        width:100%;
    }

    .post-list-item-actions{
        width:100%;
        justify-content:flex-start;
        align-items:center;
        flex:0 0 auto;
        padding-left:42px;
    }

    .post-list-item-actions .btn{
        flex:0 0 auto;
    }
}



.post-page{
    --post-card:var(--surface);
    --post-card-hover:var(--surface-light);
    --post-field:var(--bg);
    --post-field-focus:var(--surface);
    --post-border:var(--border);
    --post-text:var(--text);
    --post-muted:var(--text-muted);
    --post-accent:var(--primary);
    --post-accent-soft:var(--accent-soft);
}

.post-page-header h1{
    color:var(--post-text);
}

.post-page-header p,
.post-card-header p,
.post-field-hint,
.form-help,
.post-upload-copy span,
.post-file-preview-info span,
.post-gallery-preview-info span,
.post-progress-status,
.post-list-item-copy span,
.post-list-item-copy p,
.post-empty,
.post-author-line{
    color:var(--post-muted);
}

.post-editor-card,
.post-recent-card{
    border-color:var(--post-border);
    background:var(--post-card);
    box-shadow:var(--shadow);
}

.post-card-header{
    border-bottom-color:var(--post-border);
}

.post-card-header h3,
.post-list-item-copy strong,
.post-file-preview-info strong,
.post-gallery-preview-info strong,
.post-upload-copy strong{
    color:var(--post-text);
}

.post-card-icon,
.post-upload-icon,
.post-list-item-icon{
    border-color:var(--accent-border);
    background:var(--post-accent-soft);
    color:var(--post-accent);
}

.post-section-title{
    color:var(--post-accent);
}

.post-section-title::after,
.post-form-section + .post-form-section,
.post-form-actions{
    border-color:var(--post-border);
}

.post-editor-card label{
    color:var(--post-text);
}

.post-editor-card .form-control{
    border-color:var(--post-border);
    background:var(--post-field);
    color:var(--post-text);
}

.post-editor-card .form-control::placeholder{
    color:var(--post-muted);
}

.post-editor-card .form-control:hover{
    border-color:rgba(36,95,143,.38);
}

.post-editor-card .form-control:focus{
    border-color:var(--primary);
    background:var(--post-field-focus);
    box-shadow:0 0 0 3px var(--focus-ring);
}

.post-upload-zone,
.post-file-preview,
.post-gallery-preview-item,
.post-gallery-summary,
.post-mixed-url-box{
    border-color:var(--post-border);
    background:var(--post-field);
}

.post-upload-zone:hover{
    border-color:rgba(36,95,143,.55);
    background:var(--post-accent-soft);
}

.post-upload-progress{
    border-color:rgba(36,95,143,.20);
    background:var(--post-accent-soft);
}

.post-progress-head{
    color:var(--post-text);
}

.post-progress-track{
    background:var(--surface-light);
}

.post-form-message{
    border-color:var(--post-border);
}

.post-list-item{
    border-bottom-color:var(--post-border);
}

.post-list-item:hover{
    background:var(--post-card-hover);
}

.post-empty strong{
    color:var(--post-text);
}

.post-error{
    color:var(--danger);
}

.post-list::-webkit-scrollbar-thumb{
    background:var(--border);
}










@media(max-width:640px){
    .post-page-grid{
        gap:12px;
    }

    .post-editor-card,
    .post-recent-card{
        border-radius:12px;
    }
}

/* THEABS archive/transaction enhancements */
.archive-post-card{padding:24px;border:1px solid var(--border,#eee9df);border-radius:16px;margin-bottom:16px;background:rgba(255,255,255,.02)}
.archive-post-head{display:flex;justify-content:space-between;gap:20px}.archive-post-head h3{margin:8px 0}.archive-post-head p{color:var(--text-muted,#66727e)}.archive-post-dates{display:grid;gap:3px;min-width:190px;text-align:right}.archive-post-dates span{font-size:11px;text-transform:uppercase;color:#66727e}.archive-media-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:18px 0}.archive-media-grid img,.archive-media-grid video{width:100%;max-height:300px;object-fit:cover;border-radius:12px;background:#000}.archive-video-link{padding:14px;border:1px solid var(--border,#eee9df);border-radius:12px;color:inherit;text-decoration:none}.archive-actions{display:flex;gap:10px;flex-wrap:wrap}.transaction-toolbar{display:flex;gap:14px;align-items:center}.transaction-filters{display:grid;grid-template-columns:minmax(220px,1fr) 190px 190px;gap:10px;flex:1}.transaction-detail-card{margin-top:18px}.transaction-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:18px}.transaction-detail-grid>div{padding:13px;border:1px solid var(--border,#eee9df);border-radius:10px}.transaction-detail-grid span{display:block;font-size:11px;text-transform:uppercase;color:#66727e;margin-bottom:6px}.transaction-type{font-size:11px;text-transform:uppercase;font-weight:700}.transaction-type.donation{color:#245f8f}.transaction-type.membership{color:#245f8f}.post-schedule-toggle{display:flex;align-items:center;gap:9px;font-weight:700}.post-schedule-toggle input{width:18px;height:18px}
@media(max-width:800px){.archive-post-head{flex-direction:column}.archive-post-dates{text-align:left}.transaction-toolbar{align-items:stretch;flex-direction:column}.transaction-filters{grid-template-columns:1fr}.transaction-detail-grid{grid-template-columns:1fr}}

/* Payment screenshot viewer */
.payment-screenshot-viewer{display:flex;align-items:center;justify-content:center;min-height:280px;max-height:72vh;padding:4px;overflow:auto;border:1px solid var(--border,#eee9df);border-radius:14px;background:rgba(0,0,0,.18)}
.payment-screenshot-image{display:block;width:auto;max-width:100%;height:auto;max-height:68vh;object-fit:contain;border-radius:10px;box-shadow:0 12px 40px rgba(0,0,0,.28)}
.payment-screenshot-meta{margin-top:10px;text-align:center;color:var(--text-muted,#66727e);font-size:10px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}
@media(max-width:800px){.payment-screenshot-viewer{min-height:220px;max-height:68vh}.payment-screenshot-image{max-height:62vh}}


/* =========================================================
   ARCHIVED POST — INFO & PUBLICATION VIEWER
   Full-screen publication viewer used by Archived Post
========================================================= */

body.archive-preview-open {
    overflow: hidden;
}

.archive-preview-shell {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    box-sizing: border-box;
}

.archive-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23,37,54,.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.archive-preview-modal {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    max-height: min(900px, calc(100vh - 44px));
    overflow: hidden;
    outline: none;
    border: 1px solid var(--panel-border-soft, rgba(255,255,255,.09));
    border-radius: 18px;
    background: var(--surface-panel, #172536);
    color: var(--text-primary, #fbfaf7);
    box-shadow: 0 30px 100px rgba(0,0,0,.55);
}

.archive-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex: 0 0 auto;
    padding: 20px 22px;
    border-bottom: 1px solid var(--panel-border, rgba(255,255,255,.08));
    background: var(--surface-panel, #172536);
}

.archive-preview-heading {
    min-width: 0;
}

.archive-preview-heading h2 {
    margin: 5px 0 10px;
    color: var(--text-primary, #fbfaf7);
    font-size: clamp(20px, 2.5vw, 30px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.archive-preview-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 650;
}

.archive-preview-meta > span:not(.post-status-badge) {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.archive-preview-close {
    flex: 0 0 auto;
}

.archive-preview-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    min-height: 0;
    overflow: hidden;
}

.archive-preview-publication {
    min-width: 0;
    overflow: auto;
    padding: 24px;
}

.archive-preview-description {
    color: var(--text-primary, #eee9df);
    font-size: 13px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.archive-preview-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
    margin: 25px 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--panel-border, rgba(255,255,255,.08));
}

.archive-preview-section-title span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-primary, #fbfaf7);
    font-size: 12px;
    font-weight: 800;
}

.archive-preview-section-title span i {
    color: var(--primary);
}

.archive-preview-section-title small {
    color: var(--text-muted);
    font-size: 9px;
}

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

.archive-media-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--panel-border-soft, rgba(255,255,255,.08));
    border-radius: 13px;
    background: var(--surface-strong, #172536);
}

.archive-media-item img,
.archive-media-item video {
    display: block;
    width: 100%;
    max-height: 430px;
    min-height: 180px;
    object-fit: contain;
    background: #172536;
}

.archive-media-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    padding: 8px 10px;
    border-top: 1px solid var(--panel-border-soft, rgba(255,255,255,.08));
}

.archive-media-type {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.archive-media-view {
    color: var(--primary-hover, #245f8f);
    font-size: 9px;
    font-weight: 750;
    text-decoration: none;
}

.archive-media-view:hover {
    text-decoration: underline;
}

.archive-external-list {
    display: grid;
    gap: 9px;
    margin-top: 12px;
}

.archive-external-video {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--panel-border-soft, rgba(255,255,255,.08));
    border-radius: 10px;
    background: var(--surface-strong, #172536);
    color: inherit;
    text-decoration: none;
}

.archive-external-video:hover {
    border-color: var(--accent-border, rgba(56,189,248,.3));
    background: var(--accent-soft, rgba(36,95,143,.05));
}

.archive-external-video-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 8px;
    background: rgba(189,101,75,.08);
    color: #bd654b;
}

.archive-external-video span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.archive-external-video strong,
.archive-external-video small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-external-video strong {
    color: var(--text-primary, #fbfaf7);
    font-size: 10px;
}

.archive-external-video small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.archive-preview-info {
    min-width: 0;
    overflow: auto;
    padding: 22px;
    border-left: 1px solid var(--panel-border, rgba(255,255,255,.08));
    background: var(--surface-strong, #172536);
}

.archive-preview-info-title h3 {
    margin: 4px 0 18px;
    color: var(--text-primary, #fbfaf7);
    font-size: 16px;
    font-weight: 800;
}

.archive-info-list {
    display: grid;
    gap: 9px;
}

.archive-info-list > div {
    padding: 11px 12px;
    border: 1px solid var(--panel-border-soft, rgba(255,255,255,.07));
    border-radius: 9px;
    background: rgba(255,255,255,.018);
}

.archive-info-list span,
.archive-info-list strong {
    display: block;
}

.archive-info-list span {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.archive-info-list strong {
    color: var(--text-primary, #fbfaf7);
    font-size: 10px;
    overflow-wrap: anywhere;
}

.archive-post-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.archive-media-empty {
    display: grid;
    place-items: center;
    min-height: 170px;
    padding: 20px;
    border: 1px dashed var(--panel-border, rgba(255,255,255,.1));
    border-radius: 12px;
    color: var(--text-muted);
    text-align: center;
    font-size: 10px;
}

.archive-media-empty i {
    margin-bottom: 8px;
    font-size: 22px;
    opacity: .7;
}

.archive-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    flex: 0 0 auto;
    padding: 13px 18px;
    border-top: 1px solid var(--panel-border, rgba(255,255,255,.08));
    background: var(--surface-panel, #172536);
}

/* Permanent deletion must always look destructive. */
.archive-delete-btn,
button[data-permanent-delete],
.btn[data-permanent-delete] {
    border: 1px solid rgba(189,101,75,.55) !important;
    background: #bd654b !important;
    color: #fff !important;
    box-shadow: none !important;
}

.archive-delete-btn:hover,
button[data-permanent-delete]:hover,
.btn[data-permanent-delete]:hover {
    border-color: #bd654b !important;
    background: #bd654b !important;
    color: #fff !important;
}

.archive-delete-btn:focus-visible,
button[data-permanent-delete]:focus-visible,
.btn[data-permanent-delete]:focus-visible {
    outline: 2px solid rgba(248,113,113,.7);
    outline-offset: 2px;
}

.archive-delete-btn:disabled,
button[data-permanent-delete]:disabled,
.btn[data-permanent-delete]:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .archive-preview-shell {
        padding: 10px;
    }

    .archive-preview-modal {
        max-height: calc(100vh - 20px);
        border-radius: 14px;
    }

    .archive-preview-body {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .archive-preview-publication {
        overflow: visible;
        padding: 18px;
    }

    .archive-preview-info {
        border-top: 1px solid var(--panel-border, rgba(255,255,255,.08));
        border-left: 0;
        overflow: visible;
        padding: 18px;
    }

    .archive-media-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .archive-preview-shell {
        padding: 0;
    }

    .archive-preview-modal {
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .archive-preview-header {
        padding: 15px;
    }

    .archive-preview-publication,
    .archive-preview-info {
        padding: 15px;
    }

    .archive-preview-section-title {
        display: block;
    }

    .archive-preview-section-title small {
        display: block;
        margin-top: 4px;
    }

    .archive-preview-actions {
        padding: 11px 13px;
    }
}


/* =========================================================
   ARCHIVED POST — WEBSITE-STYLE PUBLICATION MEDIA VIEWER
========================================================= */

.archive-publication-viewer {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.archive-publication-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    max-height: 500px;
    overflow: hidden;
    border: 1px solid var(--panel-border-soft, rgba(255,255,255,.08));
    border-radius: 14px;
    background: #172536;
}

.archive-publication-main-media {
    width: 100%;
    height: 100%;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.archive-publication-main-media img,
.archive-publication-main-media video,
.archive-publication-main-media iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    max-height: 500px;
    border: 0;
    object-fit: contain;
    background: #172536;
}

.archive-publication-main-media video {
    object-fit: contain;
}

.archive-publication-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    backdrop-filter: blur(8px);
}

.archive-publication-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 1px 5px;
    scrollbar-width: thin;
}

.archive-publication-thumb {
    position: relative;
    flex: 0 0 72px;
    width: 72px;
    height: 58px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--panel-border-soft, rgba(255,255,255,.08));
    border-radius: 9px;
    background: #172536;
    cursor: pointer;
    opacity: .68;
    transition: opacity .18s ease, border-color .18s ease, transform .18s ease;
}

.archive-publication-thumb:hover {
    opacity: .95;
    transform: translateY(-1px);
}

.archive-publication-thumb.active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.archive-publication-thumb img,
.archive-publication-thumb video,
.archive-media-youtube-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-media-youtube-thumb {
    display: grid;
    place-items: center;
    background: rgba(189,101,75,.08);
    color: #bd654b;
    font-size: 24px;
}

.archive-publication-thumb > span:last-child {
    position: absolute;
    right: 4px;
    bottom: 4px;
    min-width: 17px;
    padding: 2px 4px;
    border-radius: 5px;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
}

.archive-media-unavailable {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 360px;
    width: 100%;
    color: var(--text-muted);
    font-size: 11px;
}

.archive-media-unavailable i {
    color: #bd654b;
    font-size: 30px;
}

.archive-preview-section-title small {
    white-space: nowrap;
}

/* The website-style viewer does not use direct media links. */
.archive-media-view,
.archive-external-list,
.archive-external-video,
.archive-media-toolbar {
    display: none !important;
}

@media (max-width: 900px) {
    .archive-publication-stage,
    .archive-publication-main-media,
    .archive-publication-main-media img,
    .archive-publication-main-media video,
    .archive-publication-main-media iframe {
        min-height: 300px;
        max-height: 420px;
    }
}

@media (max-width: 600px) {
    .archive-publication-stage,
    .archive-publication-main-media,
    .archive-publication-main-media img,
    .archive-publication-main-media video,
    .archive-publication-main-media iframe {
        min-height: 240px;
        max-height: 360px;
    }

    .archive-publication-thumb {
        flex-basis: 64px;
        width: 64px;
        height: 52px;
    }

    .archive-preview-section-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .archive-preview-section-title small {
        white-space: normal;
    }
}

/* =========================================================
   PAYMENTS / TRANSACTIONS + POST ARCHIVE SCHEDULE
   Responsive refinement
========================================================= */
.transaction-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
}

.transaction-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) minmax(150px, .75fr) minmax(170px, .85fr);
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.transaction-filters .form-control {
    width: 100%;
    min-width: 0;
    min-height: 42px;
}

#transactionRefresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
}

#transactionRefresh i {
    font-size: 13px;
}

/* Public Feed — Archive Schedule */
.post-auto-archive-section {
    margin: 18px 20px 4px;
    padding: 18px;
    border: 1px solid var(--post-border, var(--panel-border));
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(36,95,143,.045), rgba(255,255,255,.012));
}

.post-auto-archive-section .post-section-title {
    margin-bottom: 16px;
}

.post-auto-archive-section .form-group {
    margin-bottom: 12px;
}

.post-auto-archive-section .form-group:last-child {
    margin-bottom: 0;
}

.post-schedule-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    margin: 0;
    cursor: pointer;
    color: var(--post-text, var(--text-primary));
    font-size: 12px;
    font-weight: 750;
}

.post-schedule-toggle input {
    appearance: none;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    margin: 0;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
    transition: border-color .18s, background .18s, box-shadow .18s;
}

.post-schedule-toggle input:checked {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.post-schedule-toggle input:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.post-auto-archive-section .form-help {
    max-width: 720px;
    margin: 7px 0 0 29px;
    line-height: 1.55;
}

.post-auto-archive-section #postAutoArchiveDateField {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--post-border, var(--panel-border));
}

.post-auto-archive-section #postAutoArchiveAt {
    max-width: 420px;
    min-height: 44px;
}

@media (max-width: 900px) {
    .transaction-filters {
        grid-template-columns: minmax(180px, 1.2fr) minmax(140px, .8fr) minmax(150px, .9fr);
    }
}

@media (max-width: 700px) {
    .transaction-toolbar {
        gap: 10px;
        padding: 12px;
    }

    .transaction-filters {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .transaction-filters .form-control,
    #transactionRefresh {
        min-height: 44px;
        height: 44px;
    }

    #transactionRefresh {
        width: 100%;
    }

    .post-auto-archive-section {
        margin: 14px 14px 2px;
        padding: 15px;
        border-radius: 11px;
    }

    .post-auto-archive-section .post-section-title {
        margin-bottom: 13px;
    }

    .post-auto-archive-section .form-help {
        margin-left: 0;
        padding-left: 29px;
    }

    .post-auto-archive-section #postAutoArchiveAt {
        max-width: none;
        width: 100%;
    }
}

/* =========================================================
   PUBLIC FEED — ARCHIVE SCHEDULE TOGGLE FINAL
========================================================= */

.post-auto-archive-section {
    position: relative;
    margin: 20px 20px 6px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--post-border, var(--panel-border));
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(36,95,143,.045), rgba(255,255,255,.012)),
        var(--surface, transparent);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.post-auto-archive-section::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), rgba(36,95,143,.25));
    pointer-events: none;
}

.post-auto-archive-section .post-section-title {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin: 0;
    padding: 0 18px;
    border-bottom: 1px solid var(--post-border, var(--panel-border));
    background: rgba(255,255,255,.018);
    color: var(--text-primary, var(--text));
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.2;
}

.post-auto-archive-section > .form-group {
    margin: 0;
    padding: 16px 18px;
}

.post-auto-archive-section > .form-group + .form-group {
    padding-top: 0;
}

/* Keep the toggle and label text in the same label — no extra wrapper needed. */
.post-schedule-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 13px;
    width: auto;
    min-height: 24px;
    margin: 0;
    cursor: pointer;
    color: var(--post-text, var(--text-primary));
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    user-select: none;
}

/* Checkbox remains for the existing JS logic, but is rendered as a toggle switch. */
.post-schedule-toggle input {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 42px;
    height: 23px;
    flex: 0 0 42px;
    margin: 0;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    background: rgba(102,114,126,.22);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.post-schedule-toggle input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,.25);
    transition: transform .18s ease;
}

.post-schedule-toggle input:hover {
    border-color: color-mix(in srgb, var(--primary) 48%, var(--panel-border));
}

.post-schedule-toggle input:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring, rgba(36,95,143,.14));
}

.post-schedule-toggle input:active::after {
    transform: scale(.92);
}

.post-schedule-toggle input:checked {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.post-schedule-toggle input:checked::after {
    transform: translateX(19px);
}

.post-auto-archive-section .form-help {
    display: block;
    max-width: 760px;
    margin: 9px 0 0 55px;
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.6;
}

.post-auto-archive-section #postAutoArchiveDateField {
    margin-top: 0;
    padding-top: 15px;
    padding-bottom: 18px;
    border-top: 1px solid var(--post-border, var(--panel-border));
}

.post-auto-archive-section #postAutoArchiveDateField > label {
    display: block;
    margin: 0 0 7px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.post-auto-archive-section #postAutoArchiveAt {
    display: block;
    width: min(420px, 100%);
    min-height: 44px;
    margin: 0;
    border-radius: 9px;
}

.post-auto-archive-section #postAutoArchiveAt:focus {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

@media (max-width: 700px) {
    .post-auto-archive-section {
        margin: 14px 14px 4px;
        border-radius: 12px;
    }

    .post-auto-archive-section .post-section-title {
        min-height: 45px;
        padding: 0 15px;
    }

    .post-auto-archive-section > .form-group {
        padding: 14px 15px;
    }

    .post-schedule-toggle {
        gap: 13px;
    }

    .post-auto-archive-section .form-help {
        margin: 9px 0 0 55px;
        max-width: none;
    }

    .post-auto-archive-section #postAutoArchiveDateField {
        padding-top: 13px;
        padding-bottom: 15px;
    }

    .post-auto-archive-section #postAutoArchiveAt {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 420px) {
    .post-auto-archive-section {
        margin: 12px 10px 3px;
        border-radius: 11px;
    }

    .post-auto-archive-section .post-section-title {
        min-height: 42px;
        padding: 0 13px;
        font-size: 10px;
    }

    .post-auto-archive-section > .form-group {
        padding: 13px;
    }

    .post-schedule-toggle {
        gap: 12px;
        font-size: 11.5px;
    }

    .post-schedule-toggle input {
        width: 40px;
        height: 22px;
        flex-basis: 40px;
    }

    .post-schedule-toggle input::after {
        width: 14px;
        height: 14px;
    }

    .post-schedule-toggle input:checked::after {
        transform: translateX(18px);
    }

    .post-auto-archive-section .form-help {
        margin-left: 52px;
        font-size: 10px;
    }
}

/* =========================================================
   ARCHIVE SCHEDULE — TOGGLE ROW ONLY
   Scoped only to the Auto Archive form-group.
========================================================= */
.post-auto-archive-section > .form-group > .post-schedule-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 18px !important;
    width: auto !important;
    min-height: 26px;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    vertical-align: middle;
    color: var(--post-text, var(--text-primary));
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    white-space: nowrap;
}

.post-auto-archive-section > .form-group > .post-schedule-toggle > input {
    display: block !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 24px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    margin: 0 !important;
}

.post-auto-archive-section > .form-group > .post-schedule-toggle > span {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 24px;
}

.post-auto-archive-section > .form-group > .form-help {
    display: block;
    max-width: 720px;
    margin: 9px 0 0 62px !important;
    padding: 0;
    line-height: 1.55;
}

@media (max-width: 700px) {
    .post-auto-archive-section > .form-group > .post-schedule-toggle {
        gap: 16px !important;
        white-space: normal;
    }

    .post-auto-archive-section > .form-group > .form-help {
        margin-left: 60px !important;
    }
}

@media (max-width: 420px) {
    .post-auto-archive-section > .form-group > .post-schedule-toggle {
        gap: 15px !important;
        font-size: 11.5px;
    }

    .post-auto-archive-section > .form-group > .form-help {
        margin-left: 59px !important;
        font-size: 10px;
    }
}

/* =========================================================
   ARCHIVE SCHEDULE — FINAL UI POLISH
   Keeps the existing HTML/JS contract unchanged.
========================================================= */
.post-auto-archive-section > .form-group > .post-schedule-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 16px !important;
    width: fit-content !important;
    max-width: 100%;
    min-height: 30px;
    margin: 0 !important;
    padding: 2px 0 !important;
    cursor: pointer;
    color: var(--post-text, var(--text-primary, #fbfaf7));
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    letter-spacing: .005em;
    white-space: nowrap;
    user-select: none;
}

/* Native checkbox is retained for JS functionality; it is styled as a switch. */
.post-auto-archive-section > .form-group > .post-schedule-toggle > input {
    appearance: none !important;
    -webkit-appearance: none !important;
    position: relative;
    display: block !important;
    flex: 0 0 46px !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 26px !important;
    min-height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(102,114,126,.28) !important;
    border-radius: 999px !important;
    outline: none !important;
    background: rgba(102,114,126,.30) !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.24) !important;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.post-auto-archive-section > .form-group > .post-schedule-toggle > input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.28);
    transform: translateX(0);
    transition: transform .18s ease;
}

.post-auto-archive-section > .form-group > .post-schedule-toggle > input:checked {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--focus-ring, rgba(36,95,143,.10)) !important;
}

.post-auto-archive-section > .form-group > .post-schedule-toggle > input:checked::after {
    transform: translateX(20px);
}

.post-auto-archive-section > .form-group > .post-schedule-toggle > input:focus-visible {
    box-shadow: 0 0 0 3px var(--focus-ring, rgba(36,95,143,.16)) !important;
}

.post-auto-archive-section > .form-group > .post-schedule-toggle:hover > input:not(:checked) {
    border-color: rgba(102,114,126,.48) !important;
    background: rgba(102,114,126,.40) !important;
}

.post-auto-archive-section > .form-group > .post-schedule-toggle > span {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: 1.35 !important;
}

.post-auto-archive-section > .form-group > .form-help {
    display: block !important;
    max-width: 680px;
    margin: 8px 0 0 62px !important;
    padding: 0 !important;
    color: var(--text-muted);
    font-size: 11px !important;
    font-weight: 450;
    line-height: 1.55 !important;
}

/* Make the complete datetime field the click target for the native picker. */
.post-auto-archive-section #postAutoArchiveDateField {
    margin-top: 14px !important;
    padding-top: 16px !important;
}

.post-auto-archive-section #postAutoArchiveDateField > label {
    display: block;
    margin: 0 0 8px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
}

.post-auto-archive-section #postAutoArchiveAt {
    display: block !important;
    width: min(440px, 100%) !important;
    min-width: 0 !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 46px;
    letter-spacing: .01em;
    cursor: pointer;
    color-scheme: light;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.post-auto-archive-section #postAutoArchiveAt:hover {
    border-color: color-mix(in srgb, var(--primary) 38%, var(--border, #66727e)) !important;
    background: rgba(255,255,255,.035);
}

.post-auto-archive-section #postAutoArchiveAt:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px var(--focus-ring) !important;
}

.post-auto-archive-section #postAutoArchiveAt::-webkit-calendar-picker-indicator {
    width: 20px;
    height: 20px;
    margin-left: 8px;
    padding: 2px;
    cursor: pointer;
    opacity: .78;
}

@media (max-width: 700px) {
    .post-auto-archive-section > .form-group > .post-schedule-toggle {
        gap: 15px !important;
        width: 100% !important;
        font-size: 13px !important;
    }

    .post-auto-archive-section > .form-group > .form-help {
        margin: 8px 0 0 61px !important;
        max-width: calc(100% - 61px);
        font-size: 10.5px !important;
    }

    .post-auto-archive-section #postAutoArchiveAt {
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 420px) {
    .post-auto-archive-section > .form-group > .post-schedule-toggle {
        gap: 14px !important;
        font-size: 12px !important;
    }

    .post-auto-archive-section > .form-group > .post-schedule-toggle > input {
        flex-basis: 44px !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 25px !important;
        min-height: 25px !important;
    }

    .post-auto-archive-section > .form-group > .post-schedule-toggle > input::after {
        width: 17px;
        height: 17px;
    }

    .post-auto-archive-section > .form-group > .post-schedule-toggle > input:checked::after {
        transform: translateX(19px);
    }

    .post-auto-archive-section > .form-group > .form-help {
        margin-left: 58px !important;
        max-width: calc(100% - 58px);
        font-size: 10px !important;
    }
}


/* =========================================================
   POST MEDIA — BROWSE BUTTON POLISH
   ========================================================= */
.post-upload-zone .post-browse-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 108px !important;
    min-height: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 15px !important;
    border: 1px solid var(--border, rgba(102,114,126,.22)) !important;
    border-radius: 9px !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    letter-spacing: .01em;
    white-space: nowrap !important;
    cursor: pointer;
    user-select: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease,
                box-shadow .18s ease, transform .12s ease;
}
.post-upload-zone .post-browse-btn:hover {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border, #66727e)) !important;
    background: color-mix(in srgb, var(--primary) 10%, var(--surface, #172536)) !important;
    box-shadow: 0 5px 16px rgba(0,0,0,.16);
}
.post-upload-zone .post-browse-btn:focus-visible {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--focus-ring, rgba(36,95,143,.14));
}
.post-upload-zone .post-browse-btn:active { transform: translateY(1px); }

@media (max-width: 640px) {
    .post-upload-zone { align-items: flex-start; flex-wrap: wrap; }
    .post-upload-zone .post-browse-btn {
        width: 100%;
        min-width: 0 !important;
        margin-top: 2px !important;
    }
}

/* =========================================================
   POST MEDIA — SIZE USAGE PROGRESS
   Visual-only styling; preserves existing summary data/layout.
========================================================= */
.post-gallery-summary {
    position: relative;
}

.post-gallery-summary-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.post-gallery-size-progress {
    width: 100%;
    height: 5px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(102,114,126,.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
}

.post-gallery-size-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 72%, #245f8f));
    transition: width .25s ease, background .2s ease;
}

.post-gallery-size-progress-fill[style*="width:100"] {
    background: #bd654b;
}

@media (max-width: 560px) {
    .post-gallery-summary {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .post-gallery-summary-meta {
        flex-wrap: wrap;
        justify-content: flex-start;
        row-gap: 4px;
    }

    .post-gallery-size-progress {
        margin-top: 6px;
        height: 6px;
    }
}
