/* Persian editing surfaces retain their direction even while empty. */
input:not([dir=ltr]):not([type=email]):not([type=url]):not([type=tel]),
textarea:not([dir=ltr]),[contenteditable=true]:not([dir=ltr]){direction:rtl;text-align:right}
input:not([dir=ltr]):not([type=email]):not([type=url]):not([type=tel])::placeholder,
textarea:not([dir=ltr])::placeholder{direction:rtl;text-align:right;unicode-bidi:isolate}

/* Explicit workspace switches animate; typing and background refreshes do not. */
@keyframes surface-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.quick-composer,.board-menu[open]>.board-popover,.person-inline-options{animation:surface-in 160ms ease-out}
#control-popover{animation:surface-in 150ms ease-out}
.light,.textbtn,.iconbtn,.filter-btn,.person-option,.popover-option{transition:background-color 120ms,color 120ms,border-color 120ms}
/* Native discrete transitions retain the top layer until a dialog's exit ends. */
dialog,dialog.card-back{opacity:0;transform:translateY(6px);transition:opacity 160ms ease,transform 160ms ease,display 160ms allow-discrete,overlay 160ms allow-discrete}
dialog[open],dialog.card-back[open]{opacity:1;transform:none;animation:none}
dialog:not([open]){pointer-events:none}
dialog::backdrop{transition:opacity 160ms ease,display 160ms allow-discrete,overlay 160ms allow-discrete;opacity:0}
dialog[open]::backdrop{opacity:1}
@starting-style{dialog[open],dialog.card-back[open]{opacity:0;transform:translateY(6px)}dialog[open]::backdrop{opacity:0}}
html.reduce dialog,html.reduce dialog::backdrop,html.reduce .quick-composer,html.reduce .board-popover,html.reduce .person-inline-options{animation:none;transition:none}
@media(prefers-reduced-motion:reduce){
 dialog,dialog.card-back,dialog::backdrop,.quick-composer,.board-menu[open]>.board-popover,.person-inline-options,#control-popover,.light,.textbtn,.iconbtn,.filter-btn,.person-option,.popover-option{animation:none;transition:none}
}

dialog:not([open])::backdrop{pointer-events:none}

/* Height follows content; long drafts retain a bounded internal scroll. */
.field textarea,.description-editor textarea,.inside-activity form textarea,.quick-composer textarea,textarea.check-title,textarea#check-new{resize:none;overflow-y:hidden;max-height:min(420px,45dvh)}
.inside-activity form textarea,.inside-activity form:focus-within textarea{min-height:48px;max-height:min(420px,45dvh)}
.description-editor textarea{min-height:80px}
.quick-composer textarea{width:100%;min-height:43px;border:1px solid var(--board-border);border-radius:9px;background:var(--surface);color:var(--ink);font:inherit;font-size:14px;line-height:1.8;padding:7px 9px;box-shadow:0 1px 2px #16294418}
.quick-composer textarea:focus-visible{outline:2px solid var(--board-accent);outline-offset:0}
.card-back textarea.check-title,.card-back textarea#check-new{min-height:32px;line-height:1.8;max-height:180px}
.card-back .checkline{align-items:flex-start}
@media(max-width:760px){.quick-composer textarea{font-size:16px}}
