/* Support workspace: authenticated conversations, matching both existing themes. */
.support-profile-footer{margin-top:25px;padding-top:18px;border-top:1px solid var(--line)}
.support-profile-actions{display:flex;justify-content:space-between;align-items:stretch;gap:10px;flex-wrap:wrap}
.support-profile-right{display:flex;gap:8px;margin-left:auto;flex-wrap:wrap}
.runtime .support-profile-button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;text-align:left;min-height:53px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font-size:11px;line-height:1.5}
.support-profile-button small{font-size:10px;color:var(--muted)}
.runtime .support-profile-button:hover:not(:disabled){border-color:var(--pink);color:var(--pink)}
.runtime .support-profile-button:disabled{opacity:.5;cursor:not-allowed}
.runtime .support-preview-note{font-size:10px;line-height:1.7;color:var(--muted);margin:12px 0;padding:10px 12px;border:1px dashed var(--line);border-radius:8px;background:var(--surface)}
.support-dialog{width:min(760px,calc(100vw - 28px));max-width:calc(100vw - 28px);box-sizing:border-box}
.support-dialog .dialog-head h2{font-size:23px;letter-spacing:-.6px}
.support-tabs{display:flex;gap:8px;margin:16px 0;flex-wrap:wrap}
.runtime .support-tab,.runtime .support-back,.runtime .support-secondary{font-size:11px;padding:8px 11px;min-height:34px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);white-space:normal;max-width:100%;overflow-wrap:anywhere}
.runtime .support-secondary:hover,.runtime .support-tab:hover{border-color:var(--pink);color:var(--pink)}
.support-fee-box{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;border:1px solid var(--line);border-radius:12px;padding:16px;margin:15px 0 20px;background:var(--surface);font-size:12px}
.support-fee-box>strong{color:var(--pink);font-size:15px;white-space:nowrap}
.support-fee-box>small{grid-column:1/-1;color:var(--muted);font-size:11px;line-height:1.7}
.support-compose-form,.support-reply-form{display:grid;gap:14px;margin-top:18px}
.support-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.support-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.runtime .support-field label{font-size:11px;color:var(--muted);margin:0}
.runtime .support-field input,.runtime .support-field textarea{min-width:0;width:100%;box-sizing:border-box;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;font:13px/1.6 Arial,sans-serif;padding:11px 12px}
.runtime .support-field textarea{min-height:118px;resize:vertical}
.runtime .support-field input:focus,.runtime .support-field textarea:focus{outline:2px solid color-mix(in srgb,var(--pink) 25%,transparent);border-color:var(--pink)}
.runtime .support-primary{padding:11px 15px;min-height:41px;border:1px solid var(--pink);border-radius:8px;color:#fff;background:var(--pink);font-size:12px;line-height:1.6;white-space:normal}
.support-muted,.runtime .support-muted{font-size:11px;color:var(--muted);line-height:1.8;margin:10px 0;overflow-wrap:anywhere}
.support-form-status{font-size:11px;line-height:1.7;color:var(--green);margin:0}
.support-form-status:empty{display:none}
.support-form-status[data-error=true]{color:var(--red)}
.support-closed-notice{font-size:12px;padding:13px;border:1px solid var(--line);border-radius:9px;background:var(--surface);line-height:1.8;color:var(--muted);margin:15px 0}
.support-ticket-list{display:grid;gap:12px;margin-top:18px}
.support-ticket-card{padding:15px;border:1px solid var(--line);border-radius:12px;background:var(--card);min-width:0}
.support-ticket-card-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.support-ticket-card-heading>strong{font-size:13px;overflow-wrap:anywhere;color:var(--text)}
.support-ticket-badge,.support-example-badge{font-size:9px;border:1px solid var(--line);padding:3px 7px;border-radius:6px;color:var(--muted);background:var(--surface);white-space:nowrap}
.support-example-badge{display:inline-block;margin:0 0 10px}
.support-wallet{font:10px/1.7 ui-monospace,monospace;word-break:break-all;overflow-wrap:anywhere;color:var(--muted);margin:8px 0}
.support-thread-meta{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.support-thread-meta>span{font-size:10px;color:var(--muted);background:var(--surface);padding:5px 8px;border-radius:6px;overflow-wrap:anywhere;max-width:100%}
.support-message-log{display:flex;flex-direction:column;gap:12px;margin:18px 0;max-height:330px;overflow-y:auto;min-width:0;padding:2px}
.support-message{max-width:88%;border:1px solid var(--line);border-radius:12px;padding:11px 13px;background:var(--surface);align-self:flex-start;box-sizing:border-box}
.runtime .support-message.from-self{align-self:flex-end;border-color:var(--line);background:var(--surface);color:var(--text)}
.runtime .support-message.from-other{align-self:flex-start;border-color:var(--line);background:var(--card);color:var(--text)}
.support-message small{font-size:9px;color:var(--muted)}
.support-message p{font-size:12px;line-height:1.8;margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text)}
.support-thread-actions{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0 0}
.support-thread-actions button{font-size:11px;padding:8px 11px;min-height:34px;white-space:normal}
.runtime .support-close{color:var(--red);border-color:var(--red);background:var(--redbg)}
.support-request-details{padding:13px;border:1px solid var(--line);border-radius:10px;background:var(--surface);margin:12px 0}
.support-request-details>div{display:flex;gap:10px;justify-content:space-between;flex-wrap:wrap;font-size:11px;line-height:1.7;padding:5px 0}
.support-request-details span{color:var(--muted)}
.support-request-details strong{color:var(--text);font-weight:500;overflow-wrap:anywhere;max-width:100%}
.support-settings-toggle{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border:1px solid var(--line);border-radius:12px;padding:15px;margin-top:18px;font-size:12px;background:var(--surface)}
.support-settings-toggle button{font-size:11px;padding:9px 12px;min-height:36px;white-space:normal}
.runtime .support-settings-toggle .is-open{color:var(--green);background:var(--greenbg);border-color:var(--green)}
.runtime .support-settings-toggle .is-closed{color:var(--red);background:var(--redbg);border-color:var(--red)}
.support-income-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:20px 0}
.support-income-grid>div{display:flex;flex-direction:column;gap:10px;padding:14px 10px;border:1px solid var(--line);border-radius:10px;min-width:0;background:var(--surface)}
.support-income-grid span,.support-income-grid small{font-size:10px;line-height:1.6;color:var(--muted)}
.support-income-grid strong{font-size:15px;color:var(--green);overflow-wrap:anywhere}
.support-income-total{font-size:13px;color:var(--green);font-weight:600}
@media(max-width:600px){.support-profile-actions,.support-profile-right{width:100%;margin-left:0}.support-profile-right{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.runtime .support-profile-button{font-size:10px;min-width:0}.support-form-grid{grid-template-columns:minmax(0,1fr)}.support-fee-box{padding:13px}.support-dialog .dialog-head h2{font-size:21px}.support-income-grid{grid-template-columns:minmax(0,1fr)}.support-income-grid>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}.support-income-grid small{grid-column:1/-1}.support-message{max-width:95%}}

.support-limit-window-note{font-size:10px;line-height:1.7;margin:10px 0;color:var(--red)}
.support-limit-window-note[data-open=true]{color:var(--green)}

.runtime .support-thread-actions .step{min-height:38px;padding:8px 12px;font-size:11px;white-space:normal}.support-thread-actions button:disabled{opacity:.55;cursor:wait}

.support-ticket-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.runtime .support-delete{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;min-height:36px;padding:8px;border:1px solid var(--red);border-radius:8px;background:var(--redbg);color:var(--red);cursor:pointer}
.runtime .support-delete:hover,.runtime .support-delete:focus-visible{color:var(--red);border-color:var(--red);background:var(--redbg)}
.support-delete svg{display:block;pointer-events:none}

/* Keep each help control separate from the request button, including when requests are closed. */
.support-action-item{position:relative;min-width:0;display:flex;align-items:stretch}
.runtime .support-action-item>.support-profile-button{width:100%;box-sizing:border-box;padding-right:23px}
.runtime .support-profile-help.info{position:absolute;top:5px;right:5px;width:14px;height:14px;min-width:14px;min-height:14px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:50%;font:9px/1 Arial,sans-serif;color:var(--muted);background:var(--card);cursor:pointer;z-index:1}
.runtime .support-profile-help.info:hover,.runtime .support-profile-help.info:focus-visible{border-color:var(--pink);color:var(--pink)}
.support-history-item{display:inline-flex;margin-top:10px;max-width:100%}
.runtime .support-history-item>.support-secondary{padding-right:28px}
@media(max-width:600px){
 .support-profile-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:100%;flex-wrap:nowrap}
 .support-profile-right{display:contents}
 .support-profile-actions>.support-action-item,.support-profile-right>.support-action-item{min-width:0;max-width:100%}
 .runtime .support-action-item>.support-profile-button{align-items:center;justify-content:space-between;text-align:center;min-height:85px;height:100%;gap:6px;padding:23px 5px 8px;font-size:clamp(8px,2.45vw,10px);line-height:1.45;white-space:normal;overflow-wrap:anywhere}
 .support-profile-button>span{max-width:100%;min-width:0}
 .support-profile-button small{font-size:clamp(8px,2.4vw,10px);white-space:nowrap}
 .runtime .support-profile-help.info{top:5px;right:5px;width:13px;height:13px;min-width:13px;min-height:13px;font-size:9px}
}

/* A compact, centered contact menu replaces the profile footer. */
dialog.runtime.contact-dialog{width:min(520px,calc(100vw - 28px));max-width:calc(100vw - 28px);max-height:calc(100dvh - 40px);margin:auto;padding:24px;box-sizing:border-box;overflow:auto}
#contactDialog .dialog-head{gap:12px;margin-bottom:20px}
#contactDialog .dialog-head h2{font-size:23px;line-height:1.3}
#contactDialog .support-profile-footer{margin:0;padding:0;border:0}
#contactDialog .support-profile-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%}
#contactDialog .support-profile-right{display:contents}
#contactDialog .support-action-item{min-width:0;max-width:100%;margin:0}
#contactDialog .support-action-item>.support-profile-button,#contactDialog .support-history-item>.support-secondary{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:92px;height:100%;gap:6px;padding:24px 12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);box-sizing:border-box;font-size:12px;line-height:1.5;text-align:center;white-space:normal;overflow-wrap:anywhere}
#contactDialog .support-profile-button small{font-size:11px}
#contactDialog .support-action-item>button:hover:not(:disabled){border-color:var(--pink);color:var(--pink)}
#contactDialog .support-limit-window-note{margin-bottom:0}
@media(max-width:480px){dialog.runtime.contact-dialog{padding:20px 16px}#contactDialog .support-profile-actions{gap:8px}#contactDialog .support-action-item>.support-profile-button,#contactDialog .support-history-item>.support-secondary{font-size:11px;padding-left:9px;padding-right:9px}}

/* Align the application fields after removing email. */
.support-compose-form .support-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.support-compose-form .support-field{min-width:0}
.support-compose-form .support-field-wide{grid-column:1/-1}
.support-compose-form .support-field input,.support-compose-form .support-field textarea{width:100%;box-sizing:border-box}
@media(max-width:480px){.support-compose-form .support-form-grid{gap:12px}.support-compose-form .support-field label{font-size:12px}}

#walletPersonDialog{width:min(540px,calc(100vw - 28px))}
#walletPersonDialog .dialog-head{gap:12px;align-items:flex-start}
#walletPersonDialog .dialog-head h2{min-width:0;overflow-wrap:anywhere;font-size:21px;line-height:1.4}
#walletPersonDialog .support-person-controls{display:flex;align-items:center;gap:7px;flex-shrink:0}
#walletPersonDialog .support-person-controls button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;min-height:34px;padding:6px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);cursor:pointer}
#walletPersonDialog .support-person-controls .support-person-edit{color:var(--pink)}
#walletPersonDialog .support-request-details strong{overflow-wrap:anywhere;word-break:break-word;min-width:0}

#walletPersonDialog .support-person-controls svg{display:block;width:20px!important;height:20px!important;flex:none;fill:none;stroke:currentColor}
#walletPersonDialog .support-person-actions{display:flex;gap:10px;margin-top:18px}
#walletPersonDialog .support-person-actions button{flex:1;min-width:0}
#walletPersonDialog .support-person-wallet{overflow-wrap:anywhere;font-size:11px;color:var(--muted)}
#walletPersonDialog input{width:100%;min-width:0;box-sizing:border-box}

#supportApplicationsRoot{margin-bottom:20px}
.support-income-actions{display:flex;align-items:center;gap:8px;margin:14px 0}
.support-income-actions>button:first-child{flex:1}
.support-income-refresh,.support-fee-edit{display:inline-flex;align-items:center;justify-content:center;width:32px!important;min-width:32px;height:32px;padding:4px!important;font-size:20px;flex:none}
.support-income-heading{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px}
.support-current-fee{font-size:11px;color:var(--muted)}
#supportRealIncome .support-income-grid{grid-template-columns:1fr}
#supportFeeDialog{width:min(420px,calc(100vw - 28px))}
#supportFeeDialog .step{width:100%;margin-top:16px}

.otc-person-card{padding:14px;border:1px solid var(--line);border-radius:10px;margin:12px 0;overflow-wrap:anywhere}
.otc-person-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.otc-person-profile{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:4px!important}
.otc-person-profile svg{width:20px!important;height:20px!important;fill:none;stroke:currentColor;flex:none}

/* Match the moderator profile pencil in both themes. */
#walletPersonDialog .support-person-controls .support-person-edit{background:var(--surface);color:var(--text);border-color:var(--line)}

/* Shared decision state for administrator and applicant views. */
.support-review-badge{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;padding:6px 9px;border:1px solid;border-radius:8px;font-size:10px;font-weight:600;line-height:1.4;white-space:nowrap}
.support-review-badge::before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor;flex-shrink:0}
.support-review-badge[data-review-state=pending]{background:var(--yellow);border-color:#c39a43;color:#8b630d}
html[data-theme=dark] .support-review-badge[data-review-state=pending]{color:#e6c36c;border-color:#a88a48}
.support-review-badge[data-review-state=approved]{background:var(--greenbg);color:var(--green);border-color:var(--green)}
.support-review-badge[data-review-state=rejected]{background:var(--redbg);color:var(--red);border-color:var(--red)}
#limitRequestsRoot .support-limit-request-heading{flex-wrap:wrap;align-items:center}
#limitRequestsRoot .support-limit-request-heading h4{flex:1 1 100px}
.support-limit-request-summary{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-left:auto;flex-shrink:0}
.support-review-heading-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.support-review-heading-actions>button{width:33px;height:33px;padding:0;border:1px solid var(--line);border-radius:9px;background:var(--surface);font-size:20px}
.support-ticket-card-heading>.support-review-badge{margin-left:auto}
@media(max-width:480px){.support-limit-request-summary{gap:8px}.support-review-badge{font-size:9px;padding:5px 7px}.support-review-heading-actions{gap:7px}#supportThreadDialog .dialog-head:has(.support-review-heading-actions){flex-wrap:wrap;gap:12px}#supportThreadDialog .support-review-heading-actions{margin-left:auto}}

/* One clear route back to the four contact choices. */
.support-heading-title{display:flex;align-items:center;gap:11px;min-width:0;flex:1}
.support-heading-title h2{min-width:0;margin:0;overflow-wrap:anywhere}
.runtime .support-heading-title .support-back-contact{display:inline-flex;align-items:center;justify-content:center;flex:0 0 33px;width:33px;height:33px;min-height:33px;padding:6px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text)}
.support-back-contact svg{display:block;flex:none;pointer-events:none}
@media(max-width:480px){.support-heading-title{gap:8px}.runtime .support-heading-title h2{font-size:22px}}

.runtime .support-field .support-telegram-label{display:flex;align-items:center;gap:7px}
.runtime .support-telegram-label .info{position:static;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;min-width:16px;height:16px;min-height:16px;padding:0;margin:0;border:1px solid var(--line);border-radius:50%;font-size:10px;line-height:1;cursor:pointer;background:var(--surface);color:var(--text)}

/* Request-period status stays inside its contact action. */
#contactDialog .support-profile-button .support-request-period{display:inline-flex;align-items:center;justify-content:center;gap:6px;margin:1px 0 0;max-width:100%;font-size:9px;line-height:1.4;color:var(--muted)}
#contactDialog .support-period-state{display:inline-flex;align-items:center;justify-content:center;gap:4px;flex-shrink:0;padding:3px 5px;border:1px solid var(--line);border-radius:6px;font-size:8px;font-weight:600;line-height:1.2;white-space:nowrap;background:var(--surface);color:var(--muted)}
#contactDialog .support-period-state::before{content:'';width:4px;height:4px;border-radius:50%;background:currentColor;flex-shrink:0}
#contactDialog .support-period-state[data-state=open]{color:var(--green);background:var(--greenbg);border-color:var(--green)}
#contactDialog .support-period-state[data-state=closed]{color:var(--red);background:var(--redbg);border-color:var(--red)}
#contactDialog #supportAskLimit:disabled{opacity:1;cursor:not-allowed}
#contactDialog #supportAskLimit:disabled>span:first-child,#contactDialog #supportAskLimit:disabled>small{color:var(--muted)}

#contactDialog #supportAskLimit{position:relative;padding-bottom:38px}
#contactDialog .support-profile-button .support-request-period{position:absolute;right:9px;bottom:8px;margin:0;justify-content:flex-end}

/* Commission cards keep the edit control at the far right in either theme. */
#supportSettingsRoot .support-income-actions{justify-content:flex-end}
#supportSettingsRoot .support-income-actions>button:first-child{flex:none}
#supportRealIncome .support-income-grid>div{display:flex;flex-direction:column}
#supportRealIncome .support-income-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;width:100%}
#supportRealIncome .support-income-label{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px;min-width:0;overflow-wrap:anywhere}
#supportRealIncome .support-fee-edit{justify-self:end;margin-left:0}

#contactDialog #supportAskAdmin,#contactDialog #supportAskModerator{position:relative;padding-bottom:37px}#contactDialog #supportAskAdmin .support-request-period,#contactDialog #supportAskModerator .support-request-period{position:absolute;right:10px;bottom:10px;pointer-events:none}

#contactDialog #supportAskAdmin:disabled,#contactDialog #supportAskModerator:disabled{opacity:1;cursor:not-allowed}#contactDialog #supportAskAdmin:disabled>span:first-child,#contactDialog #supportAskAdmin:disabled>small,#contactDialog #supportAskModerator:disabled>span:first-child,#contactDialog #supportAskModerator:disabled>small{color:var(--muted)}

/* Payment receipt wait: follows the notice text in both themes. */
.support-payment-waiting::after{content:"";display:inline-block;width:12px;height:12px;margin-inline-start:8px;vertical-align:-2px;border:2px solid currentColor;border-inline-end-color:transparent;border-radius:50%;animation:support-payment-spin .8s linear infinite}
@keyframes support-payment-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.support-payment-waiting::after{animation:none}}

/* Contact tile prices stay in the lower-left corner; period badges get their own row. */
#contactDialog .support-action-item>.support-profile-button,
#contactDialog .support-history-item>.support-secondary{position:relative;min-height:128px;padding-bottom:62px}
#contactDialog .support-profile-button>small{position:absolute;left:12px;bottom:10px;margin:0;text-align:left;line-height:1.5}
#contactDialog .support-profile-button .support-request-period,
#contactDialog #supportAskAdmin .support-request-period,
#contactDialog #supportAskModerator .support-request-period{right:10px;bottom:32px}
