.rhm-dialog {
    --rhm-ink: #172e28;
    --rhm-green: #23594b;
    --rhm-dark: #173c32;
    --rhm-muted: #4e675d;
    --rhm-line: #dbe6dc;
    --rhm-sage: #edf5ee;
    --rhm-serif: var(--rhh-serif, Georgia, serif);
    --rhm-sans: var(--rhh-sans, system-ui, sans-serif);
    box-sizing: border-box;
    padding: 0;
    border: 0;
    margin: auto;
    color: var(--rhm-ink);
    font: 400 14px/1.5 var(--rhm-sans);
}
.rhm-dialog *, .rhm-dialog *::before, .rhm-dialog *::after { box-sizing: border-box; }
.rhm-dialog[open] { display: flex; flex-direction: column; }
.rhm-dialog:not([open]), .rhm-dialog [hidden] { display: none !important; }
.rhm-dialog::backdrop { background: #122c25a8; }
.rhm-dialog :focus-visible { outline: 2px solid #448368; outline-offset: 3px; }
.rhm-dialog h2, .rhm-dialog p { margin: 0; }
.rhm-dialog h2 { font: 700 clamp(25px, 3vw, 34px)/1.15 var(--rhm-serif); letter-spacing: -.02em; }
.rhm-dialog button, .rhm-dialog input, .rhm-dialog select, .rhm-dialog textarea { font: inherit; }
.rhm-icon-button, .rhm-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #e7f0e7;
    color: var(--rhm-dark);
    font: 700 13px/1.2 var(--rhm-sans);
    text-decoration: none;
    cursor: pointer;
}
.rhm-button:hover { filter: brightness(.96); }
.rhm-icon-button { padding: 0; width: 40px; flex: 0 0 auto; font-size: 24px !important; }
.rhm-button:disabled, .rhm-icon-button:disabled { opacity: .46; cursor: default; }
.rhm-dialog .rhm-primary { background: var(--rhm-green); color: #fff; font-weight: 700; }
.rhm-outline { border-color: var(--rhm-line); background: #fff; }
.rhm-sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.rhm-library {
    width: min(980px, calc(100% - 34px));
    max-width: none;
    height: min(740px, calc(100dvh - 46px));
    max-height: none;
    border-radius: 18px;
    background: #fafcf9;
    box-shadow: 0 24px 72px #061d147a;
    overflow: hidden;
}
.rhm-library-header {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
    padding: 22px 24px 20px;
    background: linear-gradient(112deg, #193d33, #245549);
    color: #fff;
}
.rhm-library-header h2 { color: #fff; }
.rhm-library-header p { margin: 4px 0 0; color: #e0eee6; font-size: 13px; }
.rhm-library-header .rhm-icon-button { border-color: #bdd5c360; background: #ffffff12; color: #fff; }
.rhm-library-header .rhm-icon-button:hover { background: #ffffff24; }
.rhm-library-tools {
    display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 9px;
    padding: 18px 24px 10px;
}
.rhm-search {
    display: flex; align-items: center; gap: 9px;
    min-height: 42px; padding: 0 11px; border: 1px solid var(--rhm-line);
    border-radius: 9px; background: #fff;
}
.rhm-search:focus-within { outline: 2px solid #448368; outline-offset: 1px; }
.rhm-search-icon {
    position: relative; width: 13px; height: 13px; flex: 0 0 13px; margin: 0 4px 2px 0;
    color: var(--rhm-muted); border: 1.5px solid currentColor; border-radius: 50%;
}
.rhm-search-icon::after {
    position: absolute; content: ""; width: 6px; height: 1.5px; left: 9px; top: 10px;
    background: currentColor; transform: rotate(45deg);
}
.rhm-search input {
    width: 100%; min-width: 0; padding: 6px 0; border: 0 !important; outline: 0 !important;
    appearance: none; background: transparent; box-shadow: none !important; color: var(--rhm-ink);
}
.rhm-rank select {
    width: 100%; height: 100%; min-height: 42px; padding: 6px 9px;
    border: 1px solid var(--rhm-line); border-radius: 9px;
    background: #fff; color: var(--rhm-ink);
}
.rhm-kinds {
    display: flex; gap: 5px; align-items: center; overflow: auto;
    padding: 3px 24px 8px; scrollbar-width: thin;
}
.rhm-kinds button {
    flex: 0 0 auto; min-height: 34px; padding: 6px 11px; border: 1px solid transparent;
    border-radius: 99px; background: transparent; color: var(--rhm-muted); font-size: 13px; cursor: pointer;
}
.rhm-kinds button:hover { background: #f0f5ef; }
.rhm-kinds button[aria-pressed=true] {
    border-color: #cde2d1; background: #e6f1e7; color: var(--rhm-dark); font-weight: 700;
}
.rhm-feedback { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 24px 8px; min-height: 26px; }
.rhm-feedback p { color: var(--rhm-muted); font-size: 12px; overflow-wrap: anywhere; }
.rhm-feedback .is-error { color: #902b28; }
.rhm-feedback progress { width: min(150px, 100%); accent-color: var(--rhm-green); }
.rhm-library-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 24px 15px; scrollbar-gutter: stable; }
.rhm-library-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
    margin: 0; padding: 0; list-style: none;
}
.rhm-media-card {
    position: relative; min-width: 0; border: 1px solid var(--rhm-line); border-radius: 11px; background: #fff;
    overflow: hidden;
}
.rhm-media-card:has(.rhm-media-check:checked) { border-color: #3c805d; box-shadow: inset 0 0 0 1px #3c805d; }
.rhm-media-label { display: block; min-height: 100%; cursor: pointer; }
.rhm-media-check { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rhm-media-card:has(.rhm-media-check:focus-visible) { outline: 2px solid #448368; outline-offset: 2px; }
.rhm-card-media {
    position: relative; display: grid; place-items: center; height: clamp(90px, 13vh, 128px);
    margin: 4px; border-radius: 7px; background: linear-gradient(140deg,#e9f2e9,#dbe9df);
    overflow: hidden;
}
.rhm-card-media img { width: 100%; height: 100%; display: block; object-fit: contain; }
.rhm-card-media .rhm-file-type {
    display: grid; place-items: center; min-width: 40px; min-height: 48px; padding: 4px;
    border: 1px solid #c2d6c7; border-radius: 6px 10px 6px 6px;
    background: #fbfdfb; color: #285747; font-size: 11px; font-weight: 700;
}
.rhm-card-media img + .rhm-file-type {
    position: absolute; bottom: 5px; left: 5px; min-width: 0; min-height: 0; padding: 2px 5px;
    border: 0; border-radius: 4px; background: #14372bdf; color: #fff; font-size: 9px;
}
.rhm-check-indicator {
    display: grid; place-items: center; position: absolute; right: 5px; top: 5px;
    width: 22px; height: 22px; border: 1px solid #9eb5a7; border-radius: 6px;
    background: #fff; color: transparent; font-weight: 700;
}
.rhm-media-check:checked + .rhm-card-media .rhm-check-indicator { border-color: #23594b; background: #23594b; color: #fff; }
.rhm-card-info { display: block; padding: 5px 9px 29px; min-height: 68px; }
.rhm-card-name {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; font-size: 13px; color: var(--rhm-ink);
}
.rhm-card-info small { display: block; margin: 2px 0 0; color: var(--rhm-muted); font-size: 11px; }
.rhm-card-open {
    position: absolute; bottom: 5px; right: 7px;
    min-height: 24px; padding: 2px 4px;
    color: var(--rhm-green); font-weight: 650; font-size: 11px; text-decoration: underline;
}
.rhm-library-body .rhm-empty { padding: 26px 11px; text-align: center; color: var(--rhm-muted); }
.rhm-more { display: flex; margin: 16px auto 0; width: max-content; }
.rhm-layout-options {
    flex: 0 0 auto; max-height: 38dvh; overflow: auto;
    margin: 5px 24px 9px; padding: 9px 12px;
    border: 1px solid var(--rhm-line); border-radius: 9px; background: #fff;
}
.rhm-layout-options summary { cursor: pointer; font-weight: 700; }
.rhm-layout-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding-block-start: 8px; }
.rhm-layout-fields label { display: grid; gap: 3px; color: var(--rhm-muted); font-size: 13px; }
.rhm-layout-fields :is(input[type=text], input[type=url], textarea) {
    width: 100%; min-width: 0; padding: 6px 8px; color: var(--rhm-ink);
    border: 1px solid var(--rhm-line); border-radius: 6px; background: #fafcf9;
}
.rhm-layout-fields :is(.rhm-layout-border, .rhm-layout-side) { grid-column: 1 / -1; }
.rhm-layout-fields .rhm-layout-border { display: flex; align-items: center; gap: 6px; }
.rhm-layout-fields textarea { resize: vertical; }
.rhm-library-footer {
    display: flex; justify-content: space-between; gap: 10px; align-items: center;
    padding: 12px 24px; border-top: 1px solid var(--rhm-line); background: #fff;
}
.rhm-selection { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 9px; color: var(--rhm-muted); font-size: 12px; }
.rhm-selection [data-rhm-selected] { color: var(--rhm-dark); font-weight: 700; }
.rhm-clear { border: 0; padding: 2px; background: none; color: var(--rhm-green); text-decoration: underline; cursor: pointer; }
.rhm-library-footer .rhm-primary { flex: 0 0 auto; }
.rhm-drop {
    pointer-events: none; position: absolute; z-index: 1; inset: 10px;
    display: grid; place-items: center; border: 2px dashed #70a586; border-radius: 13px;
    background: #e5f3e9ed; color: var(--rhm-dark); font: 700 26px/1.2 var(--rhm-serif);
}

.rhm-viewer {
    width: min(1200px, calc(100% - 32px)); max-width: none;
    height: min(880px, calc(100dvh - 32px)); max-height: none;
    overflow: hidden; border-radius: 16px; background: #14241f; color: #fff;
    box-shadow: 0 20px 65px #07191288;
}
.rhm-viewer::backdrop { background: #0d1713d9; }
.rhm-viewer-header, .rhm-viewer-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 15px; background: #20382f;
}
.rhm-viewer-header > div:first-child { min-width: 0; }
.rhm-viewer-header h2 { color: #fff; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rhm-viewer-header p { margin-top: 2px; color: #c8ded0; font-size: 12px; }
.rhm-viewer-tools { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.rhm-viewer .rhm-icon-button, .rhm-view-original { border-color: #738c7e70; background: #eaf4ed0f; color: #fff; }
.rhm-viewer .rhm-icon-button:hover, .rhm-view-original:hover { background: #eaf4ed24; }
.rhm-viewer .rhm-fit { font-size: 13px !important; }
.rhm-viewer-footer { padding: 8px 15px; }
.rhm-view-original { margin-inline-start: auto; }
.rhm-image-frame {
    min-height: 0; display: flex; flex: 1; overflow: auto; padding: 10px;
    background: #14241f; touch-action: pan-x pan-y pinch-zoom;
}
.rhm-image-frame img { flex: 0 0 auto; display: block; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.rhm-image-frame img.rhm-zoomed { max-width: none; max-height: none; height: auto; }
.rhm-image-frame p { margin: auto; color: #e0ece3; text-align: center; }

#wpforo #wpforo-wrap .wpf_attach_button.rhm-picker-trigger {
    display: inline-flex; align-items: center; min-height: 34px; padding: 4px 10px;
    border: 1px solid #cbded0; border-radius: 7px;
    color: #205748; background: #eff6ef; font-weight: 650; text-decoration: none; cursor: pointer;
}
#wpforo #wpforo-wrap .wpf_attach_button.rhm-picker-trigger:hover { background: #e6f2e6; }
#wpforo #wpforo-wrap .wpf_attach_button.rhm-picker-trigger:focus-visible { outline: 2px solid #448368; outline-offset: 2px; }
#wpforo #wpforo-wrap figure[data-attachids] {
    max-width: 100%;
    vertical-align: top;
    margin-block: 8px;
}
#wpforo #wpforo-wrap figure[data-attachids]:has(a[data-gallery]) { margin-inline: 0; }
#wpforo #wpforo-wrap figure[data-attachids]:has(.wpfa-item + .wpfa-item a[data-gallery]) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item:is(.wpfa-img,.wpfa-img-boxed,.wpfa-img-caption) {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid #d3e2d8;
    border-radius: 12px;
    box-shadow: 0 2px 4px #1a413512;
    background: #fff;
    min-width: 0 !important;
    min-height: 0 !important;
    opacity: 1;
    vertical-align: top;
    overflow: hidden;
}
#wpforo #wpforo-wrap figure[data-attachids]:has(.wpfa-item + .wpfa-item) .wpfa-item:has(a[data-gallery]) {
    flex: 0 1 clamp(132px, 30%, 232px);
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item a[data-gallery] {
    display: block; position: relative;
    background: #edf3ee; cursor: zoom-in; overflow: hidden;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item a[data-gallery] img {
    display: block; width: auto; height: auto !important; max-width: 100% !important; max-height: min(75vh, 720px) !important;
    min-width: 0; min-height: 0; margin: 0; object-fit: contain;
}
#wpforo #wpforo-wrap figure[data-attachids]:has(.wpfa-item + .wpfa-item) .wpfa-item a[data-gallery] {
    display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 5px;
}
#wpforo #wpforo-wrap figure[data-attachids]:has(.wpfa-item + .wpfa-item) .wpfa-item a[data-gallery] img {
    width: 100%; height: 100% !important; max-height: 100% !important;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item a[data-gallery]::after {
    content: '⤢'; position: absolute; inset-block-end: 8px; inset-inline-end: 8px;
    display: grid; place-items: center; width: 27px; height: 27px; line-height: 1;
    border-radius: 8px; color: #fff; background: #193e34ed; font: 750 17px/1 system-ui, sans-serif;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item a[data-gallery]:hover { background: #e3efe5; }
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item a[data-gallery]:focus-visible { outline: 3px solid #347756; outline-offset: -3px; }
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-info { padding: 5px 8px; color: #4f695d; font-size: 12px; overflow-wrap: anywhere; }
#wpforo #wpforo-wrap figure[data-attachids][data-rhm-borderless] .wpfa-item.wpfa-img {
    border: 0; border-radius: 0; box-shadow: none; background: transparent;
}
#wpforo #wpforo-wrap figure[data-attachids][data-rhm-borderless] .wpfa-item a[data-gallery] { background: transparent; }
#wpforo #wpforo-wrap figure[data-attachids] .rhm-image-caption {
    padding: 4px 0 0; color: #4f695d; font-size: .92em; text-align: start; overflow-wrap: anywhere;
}
#wpforo #wpforo-wrap figure[data-attachids] .rhm-image-caption a { text-decoration: underline; }
#wpforo #wpforo-wrap figure[data-attachids] .rhm-side-copy {
    margin-block-start: 7px; white-space: pre-line; overflow-wrap: anywhere;
}
@media (min-width: 900px) {
    #wpforo #wpforo-wrap figure[data-attachids][data-rhm-side] {
        display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        grid-template-rows: max-content auto; align-items: start; gap: 0 16px;
    }
    #wpforo #wpforo-wrap figure[data-attachids][data-rhm-side] .rhm-side-copy {
        grid-area: 1 / 2 / span 2; margin: 0;
    }
    #wpforo #wpforo-wrap figure[data-attachids][data-rhm-side] .rhm-image-caption { grid-area: 2 / 1; }
}
#wpforo #wpforo-wrap .wpforo-post-content figure[data-attachids] .wpfa-item.wpfa-file:has(a[download]),
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item.wpfa-file:has(a[download]) {
    display: inline-block; padding: 0; margin: 3px 5px 5px 0; opacity: 1;
    overflow: hidden; border: 1px solid #d6e4d9; border-radius: 9px; background: #f3f8f3; box-shadow: none;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item.wpfa-file a[download] {
    display: flex; gap: 8px; align-items: center; min-height: 41px; padding: 7px 10px;
    color: #205748; white-space: normal; text-align: start; text-decoration: none;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item.wpfa-file a[download]:hover { background: #e8f2e9; }
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item.wpfa-file a[download] > span:not(.rhm-post-filetype) {
    width: auto; min-width: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item.wpfa-file a[download]:has(.rhm-post-filetype) i { display: none; }
#wpforo #wpforo-wrap figure[data-attachids] .rhm-post-filetype {
    display: inline-flex; flex: 0 0 auto; align-items: center; padding: 2px 5px;
    width: auto; border-radius: 4px; white-space: nowrap;
    background: #dcece0; color: #214e3d; font: 700 10px/1.5 system-ui, sans-serif;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item.wpfa-file a[download]::after {
    content: '↓'; display: block; flex: 0 0 auto; margin-inline-start: auto;
    font: 700 14px/1 system-ui, sans-serif;
}
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item :is(video,audio) { border-radius: 8px; max-width: 100% !important; }
#wpforo #wpforo-wrap figure[data-attachids] .wpfa-item video { background: #243930; }

@media (max-width: 620px) {
    #wpforo #wpforo-wrap figure[data-attachids]:has(.wpfa-item + .wpfa-item) .wpfa-item:has(a[data-gallery]) {
        flex-basis: calc((100% - 8px) / 2);
    }
    .rhm-library, .rhm-viewer { width: calc(100% - 14px); height: calc(100dvh - 14px); border-radius: 11px; }
    .rhm-library-header { padding: 14px; }
    .rhm-library-tools { grid-template-columns: minmax(0,1fr) auto; padding: 11px 12px 6px; }
    .rhm-library-tools .rhm-search { grid-column: 1 / -1; }
    .rhm-kinds { padding-inline: 10px; }
    .rhm-feedback, .rhm-library-body, .rhm-library-footer { padding-inline: 12px; }
    .rhm-layout-options { margin-inline: 12px; }
    .rhm-library-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
    .rhm-library-footer { padding-block: 8px; }
    .rhm-limit { display: none; }
    .rhm-viewer-header, .rhm-viewer-footer { padding: 7px 8px; gap: 6px; }
    .rhm-viewer .rhm-icon-button { width: 34px; min-height: 38px; }
    .rhm-viewer-tools { gap: 3px; }
    .rhm-viewer-header h2 { font-size: 15px; }
}
