.task-status-dialog {
  position: fixed; inset: 0; margin: auto; padding: 0; width: min(360px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px); border: 1px solid #e5e5e5; border-radius: 14px;
  background: white; color: #262626; box-shadow: 0 20px 70px #0003; overflow: auto;
}
.task-status-dialog::backdrop { background: #0005; }
.task-status-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0; }
.task-status-dialog h2 { font-size: 15px; font-weight: 600; margin: 0; }
.task-status-dialog header button { width: 28px; height: 28px; font-size: 22px; color: #737373; border-radius: 6px; }
.task-status-dialog .status-description { margin: 8px 16px 12px; color: #737373; font-size: 12px; }
.task-status-dialog input { display: block; width: calc(100% - 32px); margin: 0 16px 12px; padding: 8px 10px; border: 1px solid #d4d4d4; border-radius: 7px; background: transparent; font-size: 13px; }
.task-status-dialog .status-options { padding: 0 8px 8px; max-height: min(380px, calc(100dvh - 230px)); overflow-y: auto; }
.task-status-dialog .status-options button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 6px; text-align: left; font-size: 13px; }
.task-status-dialog .status-options svg, .task-status-field svg { width: 16px; height: 16px; flex-shrink: 0; }
.task-status-dialog .status-options button:hover, .task-status-dialog header button:hover { background: #f5f5f5; }
.task-status-dialog .status-options button[aria-selected=true] { background: var(--accent-soft); color: var(--accent-text); }
.task-status-dialog .status-check { margin-left: auto; }
.task-status-dialog .status-options > p { padding: 12px; font-size: 13px; color: #737373; }
.task-status-dialog .status-error:not(:empty) { margin: 0 16px 16px; font-size: 13px; color: #be123c; }
.task-status-dialog button:focus-visible, .task-status-field:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: -2px; }
.task-status-dialog [disabled] { opacity: .55; cursor: wait; }
.task-status-field { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; min-height: 36px; border: 1px solid #d4d4d4; border-radius: 6px; background: transparent; text-align: left; font-size: 13px; }
[data-controller~=status-field] select[hidden] { display: none; }
.dark .task-status-dialog { background: #171717; color: #e5e5e5; border-color: #404040; }
.dark .task-status-dialog input, .dark .task-status-field { border-color: #525252; }
.dark .task-status-dialog .status-options button:hover, .dark .task-status-dialog header button:hover { background: #262626; }
.dark .task-status-dialog .status-options button[aria-selected=true] { background: var(--accent-soft); color: var(--accent-soft-text); }

[data-controller~=task-form-fields] select[hidden] { display: none; }
.task-status-field { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-choice-popover { inset: auto; margin: 0; position: fixed; border-radius: 9px; max-height: calc(100dvh - 16px); box-shadow: 0 8px 30px #0002; }
.task-choice-popover::backdrop { background: transparent; }
.task-choice-popover header, .task-choice-popover .status-description { display: none; }
.task-choice-popover input { margin: 8px; width: calc(100% - 16px); padding: 7px 9px; }
.task-choice-popover .status-options { padding: 0 4px 4px; }
.task-choice-popover .status-options button { padding: 8px; gap: 8px; }
.task-choice-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.task-status-field > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* The description grows naturally; only long content scrolls inside the editor. */
.task-description-editor [data-tiptap-editor-target=element] { max-height: min(240px, 28dvh); overflow-y: auto; overscroll-behavior: contain; }
.task-description-editor .ProseMirror { min-height: 5rem; }
.task-choice-icon { display: inline-flex; flex-shrink: 0; }

.task-choice-popover input[hidden] { display: none; }
.task-choice-popover:has(input[hidden]) .status-options { padding-top: 4px; }
.task-status-field::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 2px 0 auto; flex-shrink: 0; opacity: .55; }

/* Select menus overlay the chosen value; focus and selection stay distinct. */
.task-choice-popover{overflow:hidden}
.task-choice-popover .status-options{overscroll-behavior:contain}
.task-choice-popover .status-options button{padding:4px 6px;min-height:28px;cursor:default}
.task-choice-popover .task-choice-label{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.task-choice-popover .status-options button[aria-selected=true]{background:transparent;color:inherit}
.task-choice-popover .status-options button:hover,.task-choice-popover .status-options button:focus{background:#f5f5f5;outline:none}
.dark .task-choice-popover .status-options button:hover,.dark .task-choice-popover .status-options button:focus{background:#262626}
