/* 4.23 — engagement, readable controls, consistent responsive modal and dashboard surfaces. */
.qh23-footer-bottom{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:14px!important;flex-wrap:wrap!important;min-height:74px!important;border-top:1px solid rgba(255,255,255,.12);color:#d8e6f8!important}
.qh23-footer-bottom p{margin:0!important;font-size:13px!important;line-height:1.9!important;color:inherit!important}
.qh23-footer-bottom a{font-size:12px!important;color:#b9d2f6!important;white-space:nowrap}
.qh23-engagement{display:grid;gap:24px;border-top:1px solid var(--border,#dce4f0);margin-top:28px;padding-top:25px}
.qh23-engagement h2{font-size:clamp(18px,2vw,23px);margin:0 0 10px;color:var(--ink,#14294a)}
.qh23-votes{display:flex;align-items:center;justify-content:space-between;gap:22px;flex-wrap:wrap;padding:22px;border-radius:20px;background:var(--surface-2,#f5f9fc);border:1px solid var(--border,#dde6f0)}
.qh23-votes p{margin:0 0 4px}.qh23-votes small{color:var(--muted,#63758c);font-size:13px}
.qh23-votes form,.qh23-comment-actions,.qh23-comment-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:9px}
.qh23-comments{padding:20px;border-radius:20px;border:1px solid var(--border,#dde5ee);background:var(--surface,#fff)}
.qh23-comment{padding:16px 0;border-bottom:1px solid var(--border,#ddd)}
.qh23-comment header{display:flex;align-items:center;gap:12px;justify-content:space-between;font-size:14px}.qh23-comment time{font-size:12px;color:var(--muted)}
.qh23-comment p{white-space:normal;overflow-wrap:anywhere;font-size:14px;line-height:1.95;margin:9px 0 0}
.qh23-comment-form{margin-top:22px;display:grid;gap:12px}.qh23-comment-form label,.qh23-media-edit-form label{display:grid;gap:6px;font-weight:650;font-size:13px}
.qh23-comment-form input,.qh23-comment-form textarea,.qh23-media-edit-form input,.qh23-media-edit-form textarea{width:100%;min-width:0;border:1px solid var(--border,#ddd);border-radius:11px;background:var(--surface,#fff);color:var(--ink,#123);padding:11px 13px;font:inherit}
.qh23-comment-form button{justify-self:start}.qh23-hp{position:absolute;left:-9999px;pointer-events:none}
.qh23-comment-admin-list{display:grid;gap:12px}.qh23-comment-tabs{margin:12px 0 18px}.qh23-comment-admin-top{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.qh23-comment-admin-top a{margin-inline-start:auto}
.qh23-media-edit{border-top:1px solid var(--border,#ddd);padding:9px 12px;background:var(--surface,#fff)}.qh23-media-edit summary{cursor:pointer;font-size:12px;font-weight:750;color:var(--ink)}
.qh23-media-edit-form{display:grid;gap:12px;padding-top:12px}.qh23-media-edit-form button{justify-self:start}
.qh23-metric-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin-bottom:17px}
.qh23-metric-row article{display:grid;gap:13px;min-width:0;padding:23px;background:var(--surface,#fff);border:1px solid var(--border,#ddd);border-radius:17px}
.qh23-metric-row span{font-size:13px;color:var(--muted,#718099)}.qh23-metric-row strong{font-size:clamp(26px,3vw,41px);line-height:1.2;color:var(--brand,#0a3676)}
.qh23-analytics-controls{display:flex;align-items:center;gap:11px;flex-wrap:wrap;margin:14px 0}.qh23-analytics-controls select{max-width:170px}
.qh23-chart-card{margin:0 0 18px}.qh23-chart{position:relative;width:100%;min-height:270px;overflow:hidden}
.qh23-chart svg{display:block;width:100%;height:auto;max-height:330px;overflow:visible}.qh23-chart path{vector-effect:non-scaling-stroke}
.qh23-chart-legend{display:flex;gap:20px;flex-wrap:wrap;font-size:12px;color:var(--muted)}.qh23-chart-legend span:first-child{color:#1461b1}.qh23-chart-legend span:last-child{color:#168149}
.qh23-post-options{display:grid;gap:12px}.qh23-post-options label{display:flex;align-items:center;gap:10px;cursor:pointer;background:var(--surface-2,#f5f8fc);border:1px solid var(--border,#ddd);border-radius:12px;padding:13px;font-size:14px!important;color:var(--ink,#123)}.qh23-post-options input{width:20px;height:20px;flex:none;accent-color:#1463a5}
.qh23-username-feedback{display:block;min-height:23px;font-size:12px;color:var(--muted,#667);line-height:1.6}.qh23-username-feedback.is-error{color:#b21b26}.qh23-username-feedback.is-ok{color:#086d37}
.qh23-file-input{display:none!important}.qh23-file-control{display:flex;gap:10px;align-items:center;justify-content:flex-start;flex-wrap:wrap;max-width:100%;border:1px dashed var(--border,#bcc9d7);border-radius:13px;background:var(--surface-2,#f5f8fb);padding:12px}
.qh23-file-control button{font:inherit;padding:9px 15px;border-radius:9px;border:1px solid var(--border,#ced8e7);background:var(--surface,#fff);color:var(--ink,#172e49);cursor:pointer}
.qh23-file-control span{font-size:12px;color:var(--muted,#697990);max-width:100%;overflow-wrap:anywhere}
/* Date input: Persian visible calendar, stable Gregorian hidden storage. */
.qh23-persian-field{position:relative;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.qh23-jalali-display{flex:1 1 180px;min-width:0!important;direction:rtl;text-align:right;cursor:pointer;font-variant-numeric:tabular-nums}
.qh23-calendar-trigger{flex:none}
.qh23-calendar-popover{z-index:1000;position:absolute;inset-inline-start:0;top:calc(100% + 8px);width:min(360px,92vw);padding:14px;border:1px solid var(--border,#d0d9e5);border-radius:18px;background:var(--surface,#fff);color:var(--ink,#123);box-shadow:0 20px 55px rgba(0,0,0,.18)}
.qh23-calendar-popover[hidden]{display:none!important}.qh23-calendar-head{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-bottom:8px}.qh23-calendar-head button{width:36px;height:36px;border-radius:9px;border:1px solid var(--border,#dde);background:var(--surface-2,#eee);color:var(--ink,#123);cursor:pointer}
.qh23-calendar-week,.qh23-calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}.qh23-calendar-week{color:var(--muted);font-size:12px;padding-bottom:6px}.qh23-calendar-days button{border:1px solid transparent;border-radius:8px;min-height:38px;padding:4px 0;background:none;color:var(--ink,#123);cursor:pointer;font:inherit;font-size:13px}
.qh23-calendar-days button:hover,.qh23-calendar-days button:focus-visible{background:var(--surface-2,#e9f2ff);border-color:var(--brand,#285995)}.qh23-calendar-days button.is-selected{background:var(--brand,#164883);color:white}.qh23-calendar-days button.is-holiday{color:#b91f2c;border-bottom:2px solid #cf2033}.qh23-calendar-days button.is-selected.is-holiday{color:#fff}
.qh23-calendar-time{display:flex;gap:9px;align-items:center;padding-top:12px;margin-top:10px;border-top:1px solid var(--border,#ddd)}.qh23-calendar-time input{width:115px;min-height:40px}.qh23-calendar-time button{margin-inline-start:auto}
.qh23-calendar-note{font-size:11px!important;color:var(--muted)!important;line-height:1.7;margin:9px 0 0}
.qh23-calendar-settings{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.qh23-calendar-settings label{display:grid;gap:6px;flex:1 1 250px}.qh23-calendar-settings input{width:100%}
/* Layers and dialogs: separate panel from backdrop, prevent disabled menu overlays. */
.admin-body #adminSidebar{z-index:1500!important}.admin-body .admin-backdrop{z-index:1450!important;pointer-events:none!important}.admin-body:has(#adminSidebar.is-open) .admin-backdrop,.admin-body:has(#adminSidebar.open) .admin-backdrop{pointer-events:auto!important}
.admin-body .block-inserter-modal,.admin-body .smart-modal-backdrop{z-index:2600!important}
.admin-body .block-inserter-dialog{max-height:min(88dvh,800px);max-width:min(700px,calc(100vw - 30px));overflow:auto}
/* Lightbox: coherent light and dark modes; never let controls overflow mobile viewport. */
body.public-site .qh22-lightbox{width:min(1120px,96vw)!important;height:min(90dvh,980px)!important;max-width:96vw!important;max-height:90dvh!important;border-radius:18px!important;overflow:hidden!important;background:#fff!important;border:1px solid #d9e5f2!important;color:#122947!important;padding:0!important;box-shadow:0 30px 80px #0006!important}
body.public-site .qh22-lightbox::backdrop{background:rgba(16,30,55,.64)!important;backdrop-filter:blur(3px)}
body.public-site .qh22-lightbox-toolbar,body.public-site .qh22-lightbox-hint{background:#f2f6fb!important;color:#244264!important;border-bottom:1px solid #dae3ed!important}
body.public-site .qh22-lightbox-caption,body.public-site .qh22-lightbox-hint,body.public-site .qh22-lightbox .qh22-zoom-value{color:#244264!important}
body.public-site .qh22-lightbox-actions button{background:#fff!important;color:#172c48!important;border-color:#c6d4e7!important;flex:none!important}
body.public-site .qh22-lightbox-actions button:hover{background:#e5effb!important;color:#0b3a80!important}
body.public-site .qh22-lightbox-stage{background:#f8fafc!important;scrollbar-color:#a5bad4 #f1f5f9!important}
html[data-theme="dark"] body.public-site .qh22-lightbox{background:#0e2039!important;color:#eef4fd!important;border-color:#314861!important}
html[data-theme="dark"] body.public-site .qh22-lightbox-toolbar,html[data-theme="dark"] body.public-site .qh22-lightbox-hint{background:#132a49!important;color:#ebf4fc!important;border-color:#345074!important}
html[data-theme="dark"] body.public-site .qh22-lightbox-caption,html[data-theme="dark"] body.public-site .qh22-lightbox-hint,html[data-theme="dark"] body.public-site .qh22-lightbox .qh22-zoom-value{color:#e2effd!important}
html[data-theme="dark"] body.public-site .qh22-lightbox-actions button{background:#1c395d!important;color:#fff!important;border-color:#446184!important}
html[data-theme="dark"] body.public-site .qh22-lightbox-stage{background:#0b182e!important}
/* Dark admin: brand navy surfaces, readable text; override legacy hardcoded black backgrounds. */
html[data-theme="dark"] body.admin-body{--bg:#08182c!important;--surface:#10233b!important;--surface-2:#162d49!important;--surface-3:#1b3857!important;--border:#304761!important;--ink:#f0f6ff!important;--ink-2:#d6e3f3!important;--muted:#b1c6dd!important;--brand:#8ab8ff!important;color:#f0f6ff!important;background:#08182c!important}
html[data-theme="dark"] body.admin-body .admin-workspace,html[data-theme="dark"] body.admin-body .admin-content,html[data-theme="dark"] body.admin-body #adminMain{background:#08182c!important;color:#edf4fd!important}
html[data-theme="dark"] body.admin-body :is(.admin-topbar,.panel,.wizard-card,.toolbar,.table-wrap,.admin-area-tabs,.admin-stepper,.settings-stage-nav,.settings-stage,.setting-switch,.media-card,.qh-dialog,.block-inserter-dialog,.block-library>button,.quick-admin,.metric,.subtle-card,.settings-hub-card,.search-form,.admin-content .card){background:#10233b!important;border-color:#344d67!important;color:#f0f6ff!important}
html[data-theme="dark"] body.admin-body :is(.panel,.wizard-card,.toolbar,.table-wrap,.admin-area-tabs,.admin-stepper,.settings-stage-nav,.setting-switch) :is(h1,h2,h3,h4,strong,label,th){color:#f0f6ff!important}
html[data-theme="dark"] body.admin-body :is(.admin-step,.admin-nav-search input,.editor-toolbar,.wizard-card-head,.data-table th,.data-table td,.data-table,.admin-area-tabs a,.wizard-summary,.field input,.field select,.field textarea,.form-grid input,.form-grid textarea,.form-grid select,.qh23-calendar-popover,.qh23-file-control){color:#e9f4ff!important;background-color:#10233b!important;border-color:#344d67!important}
html[data-theme="dark"] body.admin-body :is(.data-table tbody tr:hover td,.admin-step.active,.admin-area-tabs a.active,.admin-area-tabs a:hover,.settings-stage-cards>a:hover){background:#1b3857!important;color:#fff!important}
html[data-theme="dark"] body.admin-body :is(.muted,.help,small,.admin-page-intro p,.wizard-card-head p,.qh23-chart-legend){color:#b9c9df!important}
html[data-theme="dark"] body.admin-body .btn-ghost{background:#19314f!important;color:#f4f8ff!important;border:1px solid #405a77!important}
html[data-theme="dark"] body.admin-body .btn-primary{background:#2256a0!important;color:#fff!important;border-color:#376bb3!important}
html[data-theme="dark"] body.admin-body .block-inserter-modal{background:rgba(0,0,0,.65)!important}
html[data-theme="dark"] body.admin-body .block-library>button:hover{background:#1d3a5e!important}
html[data-theme="dark"] body.admin-body input::placeholder,html[data-theme="dark"] body.admin-body textarea::placeholder{color:#a2b7cf!important}
@media(max-width:800px){.qh23-metric-row{grid-template-columns:repeat(2,minmax(0,1fr))}.qh23-votes{padding:16px}.qh23-footer-bottom{justify-content:center!important;text-align:center}.qh23-calendar-popover{width:min(350px,calc(100vw - 42px))}.qh23-chart{min-height:180px}}
@media(max-width:600px){.qh23-metric-row{grid-template-columns:1fr}.qh23-votes form{width:100%}.qh23-votes form .btn{flex:1 1 100%}.qh23-comment-form{width:100%}.qh23-footer-bottom a{white-space:normal}.qh23-calendar-popover{position:fixed;inset:auto 8px 8px!important;width:auto!important;max-height:80dvh;overflow:auto;border-radius:18px;z-index:2600}.qh23-calendar-time input{max-width:100px}body.public-site .qh22-lightbox{width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important}body.public-site .qh22-lightbox-toolbar{flex-wrap:wrap!important;gap:3px!important;padding:8px!important;min-height:70px!important}.qh22-lightbox-caption{flex:1 1 100%;font-size:12px!important}body.public-site .qh22-lightbox-actions{width:100%!important;justify-content:center!important}body.public-site .qh22-lightbox button{width:36px!important;height:36px!important;min-width:36px!important}.qh22-lightbox-hint{display:none!important}.qh22-lightbox-stage{padding:9px!important}.admin-body .block-inserter-dialog{width:calc(100vw - 20px)!important;max-width:none!important;max-height:88dvh!important}.qh23-analytics-controls{flex-direction:column;align-items:stretch}}
@media(prefers-reduced-motion:reduce){.qh23-chart *,.qh23-calendar-popover *{transition:none!important;animation:none!important}}
/* Keep file input accessible and focusable so native form validation never fails on a hidden required field. */
.qh23-file-input{display:block!important;position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;opacity:0!important;clip-path:inset(50%)!important;pointer-events:none!important;padding:0!important;border:0!important}
.qh23-file-control:focus-within{outline:2px solid #5c9bdd;outline-offset:2px}
