/* Shared controls for desktop lightweight forms and the touch composer. */
.compose-dialog { box-sizing:border-box; width:460px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); margin:auto; padding:20px; border:1px solid var(--dm-line, var(--dz-BOR-ed, #C6D2DF)); border-radius:10px; background:var(--dm-surface, var(--dz-BG-0, #FFF)); color:var(--dm-text, var(--dz-FC-333, #263747)); overflow:auto; font:15px/1.6 sans-serif; }
.compose-dialog::backdrop { background:rgba(0,0,0,.4); }
.compose-dialog h2 { margin:0 0 12px; font-size:18px; }
.compose-dialog label { display:block; margin:10px 0 4px; }
.compose-dialog input, .compose-dialog textarea, .compose-dialog select, .compose-drafts select { box-sizing:border-box; width:100%; min-width:0; padding:8px; border:1px solid var(--dm-field-line, var(--dz-BOR-ccc, #ADBCCB)); border-radius:5px; background:var(--dm-field, var(--dz-BG-0, #FFF)); color:var(--dm-text, var(--dz-FC-333, #263747)); font:inherit; }
.compose-dialog textarea { resize:vertical; }
.compose-tool-hint { margin:6px 0; font-size:13px; color:var(--dm-muted, var(--dz-FC-666, #526475)); }
.compose-friends { display:flex; flex-wrap:wrap; gap:6px; max-height:180px; overflow:auto; margin:8px 0; padding:0; list-style:none; }
.compose-friends li, .compose-friends button { max-width:100%; overflow-wrap:anywhere; }
.compose-dialog details { margin:12px 0; }
.compose-dialog [hidden], .compose-drafts [hidden], .compose-preview[hidden] { display:none; }
.compose-actions, .compose-tools { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.compose-actions { justify-content:flex-end; }
.compose-dialog button, .compose-drafts button, .compose-recovery button, .compose-tools button { min-height:38px; padding:6px 12px; border:1px solid var(--dm-field-line, var(--dz-BOR-ccc, #ADBCCB)); border-radius:5px; background:var(--dm-surface, var(--dz-BG-0, #FFF)); color:var(--dm-accent, var(--dz-FC-color, #1764A1)); font:inherit; cursor:pointer; }
.compose-dialog button[type="submit"] { background:var(--dm-primary, var(--dz-BG-color, #176DB2)); border-color:var(--dm-primary, var(--dz-BG-color, #176DB2)); color:var(--dm-primary-text, var(--dz-FC-fff, #FFF)); }
.compose-dialog :focus-visible, .compose-drafts :focus-visible, .compose-recovery :focus-visible, .compose-tools :focus-visible { outline:2px solid var(--dm-accent, var(--dz-FC-color, #176DB2)); outline-offset:2px; }
.compose-drafts { padding:10px 0; font-size:13px; line-height:1.6; color:var(--dm-muted, var(--dz-FC-666, #526475)); }
.compose-drafts p { margin:4px 0; }
.compose-drafts summary { cursor:pointer; padding:6px 0; }
.compose-drafts select { margin:8px 0; }
.compose-error, .compose-drafts [data-state="error"] { color:#A52D27; }
.compose-error:empty { display:none; }
.compose-recovery { margin-top:8px; }
.compose-preview { white-space:pre-wrap; overflow-wrap:anywhere; padding:14px; border:1px solid var(--dm-line, var(--dz-BOR-ed, #CCD6E1)); border-radius:6px; line-height:1.7; background:var(--dm-surface, var(--dz-BG-0, #FFF)); color:var(--dm-text, var(--dz-FC-333, #263747)); }
.compose-preview img { display:block; max-width:100%; max-height:320px; object-fit:contain; }
.compose-preview blockquote { margin:8px 0; padding:8px 12px; border-left:3px solid var(--dm-accent, var(--dz-FC-color, #9BB0C6)); background:var(--dm-soft, var(--dz-BG-5, #F3F6F9)); }
.compose-preview pre { white-space:pre-wrap; padding:10px; background:var(--dm-soft, var(--dz-BG-5, #F3F6F9)); }
.compose-preview a { color:var(--dm-accent, var(--dz-FC-color, #1764A1)); text-decoration:underline; }
@media(pointer:coarse) { .compose-dialog button, .compose-drafts button, .compose-recovery button, .compose-tools button, .compose-drafts summary { min-height:44px; } }

.compose-label { display:block; padding:6px 0; color:var(--dm-muted, var(--dz-FC-666, #526475)); font-size:13px; }

.threadsort-choices { display:flex; flex-wrap:wrap; gap:2px 1em; box-sizing:border-box; max-height:min(18em, 50vh); overflow:auto; padding:3px; }
.threadsort-choices li { min-width:min(3.5em, 100%); max-width:100%; }
.threadsort-choices label { display:flex; align-items:center; gap:.4em; min-height:26px; line-height:1.5; overflow-wrap:anywhere; }
.threadsort-choices label input { flex:none; margin:0; }
@media (pointer:coarse) {
 .threadsort-choices label { min-width:44px; min-height:44px; }
}
@media (max-width:600px) {
 .post_box .mtext:has(.threadsort-choices) { display:block; }
 .threadsort-fields th { width:5em; }
 .threadsort-fields td[width] { width:auto; }
 .threadsort-fields .px, .threadsort-fields .pt { box-sizing:border-box; width:min(100%, 330px); margin-right:0; }
}

.compose-floating { position:fixed !important; inset:8px !important; margin:auto; height:fit-content; width:660px; box-sizing:border-box; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow:auto; }
.compose-floating .c, .compose-floating .p_c, .compose-floating .tedt { box-sizing:border-box; max-width:100%; }
.compose-floating input[name="subject"] { box-sizing:border-box; max-width:100%; }
.compose-floating .tedt .pt { box-sizing:border-box; width:100%; }
.compose-floating .compose-drafts, .compose-floating .compose-feedback { margin:0 10px; }

.compose-floating .fwin { width:100%; table-layout:fixed; }
.compose-floating .c, .compose-floating .p_c, .compose-floating .tedt { width:100% !important; }
.compose-floating .compose-drafts select { width:100%; min-width:0; }

.compose-form .tedt .bar { height:auto; min-height:36px; padding:6px; }
.compose-form .fpd { display:flex; flex-wrap:wrap; gap:4px; }
.compose-form .fpd a { display:inline-flex; align-items:center; justify-content:center; float:none; width:auto; height:auto; min-height:32px; margin:0; padding:0 8px; background:none; border:1px solid var(--dm-line, var(--dz-BOR-ed, #C6D2DF)); border-radius:4px; color:var(--dm-accent, var(--dz-FC-color, #1764A1)); text-indent:0; font-size:13px; line-height:1.5; text-decoration:none; }
.compose-form .pn { height:auto; min-height:38px; padding:4px 10px; font-size:14px; }
.compose-floating .flbc { width:38px; height:38px; background:none; font-size:0; text-indent:0; }
.compose-floating .flbc::before { content:'×'; display:block; font:24px/38px sans-serif; text-align:center; color:var(--dm-muted, var(--dz-FC-666, #526475)); }
@media(pointer:coarse) { .compose-form .fpd a, .compose-form .pn, .compose-floating .flbc { min-height:44px; min-width:44px; } }
